Merge pull request #35 from bendooru/fix-image-bg-color
Allow setting both background image and colour
This commit is contained in:
commit
368f53e4f1
1
main.c
1
main.c
@ -658,7 +658,6 @@ static int parse_options(int argc, char **argv, struct swaylock_state *state,
|
|||||||
case 'c':
|
case 'c':
|
||||||
if (state) {
|
if (state) {
|
||||||
state->args.colors.background = parse_color(optarg);
|
state->args.colors.background = parse_color(optarg);
|
||||||
state->args.mode = BACKGROUND_MODE_SOLID_COLOR;
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'd':
|
case 'd':
|
||||||
|
4
render.c
4
render.c
@ -59,10 +59,10 @@ void render_frame(struct swaylock_surface *surface) {
|
|||||||
|
|
||||||
cairo_save(cairo);
|
cairo_save(cairo);
|
||||||
cairo_set_operator(cairo, CAIRO_OPERATOR_SOURCE);
|
cairo_set_operator(cairo, CAIRO_OPERATOR_SOURCE);
|
||||||
if (state->args.mode == BACKGROUND_MODE_SOLID_COLOR || !surface->image) {
|
|
||||||
cairo_set_source_u32(cairo, state->args.colors.background);
|
cairo_set_source_u32(cairo, state->args.colors.background);
|
||||||
cairo_paint(cairo);
|
cairo_paint(cairo);
|
||||||
} else {
|
if (surface->image && state->args.mode != BACKGROUND_MODE_SOLID_COLOR) {
|
||||||
|
cairo_set_operator(cairo, CAIRO_OPERATOR_OVER);
|
||||||
render_background_image(cairo, surface->image,
|
render_background_image(cairo, surface->image,
|
||||||
state->args.mode, buffer_width, buffer_height);
|
state->args.mode, buffer_width, buffer_height);
|
||||||
}
|
}
|
||||||
|
@ -55,15 +55,16 @@ Locks your Wayland session.
|
|||||||
Show the current Caps Lock state also on the indicator.
|
Show the current Caps Lock state also on the indicator.
|
||||||
|
|
||||||
*-s, --scaling*
|
*-s, --scaling*
|
||||||
Scaling mode for images: _stretch_, _fill_, _fit_, _center_, or _tile_.
|
Scaling mode for images: _stretch_, _fill_, _fit_, _center_, or _tile_. Use
|
||||||
|
the additional mode _solid\_color_ to display only the background color, even
|
||||||
|
if a background image is specified.
|
||||||
|
|
||||||
*-t, --tiling*
|
*-t, --tiling*
|
||||||
Same as --scaling=tile.
|
Same as --scaling=tile.
|
||||||
|
|
||||||
*-c, --color* <rrggbb[aa]>
|
*-c, --color* <rrggbb[aa]>
|
||||||
Turn the screen into the given color. If -i is used, this sets the
|
Turn the screen into the given color. If -i is used, this sets the
|
||||||
background of the image to the given color. Defaults to white (FFFFFF), or
|
background of the image to the given color. Defaults to white (FFFFFF).
|
||||||
transparent (00000000) if an image is in use.
|
|
||||||
|
|
||||||
*--bs-hl-color* <rrggbb[aa]>
|
*--bs-hl-color* <rrggbb[aa]>
|
||||||
Sets the color of backspace highlight segments.
|
Sets the color of backspace highlight segments.
|
||||||
|
Loading…
Reference in New Issue
Block a user