diff options
author | Drew DeVault <sir@cmpwn.com> | 2018-04-24 16:30:54 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-24 16:30:54 +0200 |
commit | 5024f0888581cde0a9bc6b86222c14a97890b479 (patch) | |
tree | 35941cb448213c81a4956360af05c53537809ff5 /swaylock/render.c | |
parent | 38c44f2f27f218ed7e61c9910491eef78551d8ea (diff) | |
parent | 2d884d4e4f8b8e7cac87f8096c0cc31535bd0642 (diff) |
Merge pull request #1848 from snaggen/improved_key_handling
Improved key handling in swaylock
Diffstat (limited to 'swaylock/render.c')
-rw-r--r-- | swaylock/render.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/swaylock/render.c b/swaylock/render.c index cd387be5..7d9d25a5 100644 --- a/swaylock/render.c +++ b/swaylock/render.c @@ -43,6 +43,7 @@ void render_frame(struct swaylock_surface *surface) { cairo_arc(cairo, buffer_width / 2, buffer_height / 2, arc_radius, 0, 2 * M_PI); switch (state->auth_state) { case AUTH_STATE_INPUT: + case AUTH_STATE_INPUT_NOP: case AUTH_STATE_BACKSPACE: { cairo_set_source_rgba(cairo, 0, 0, 0, 0.75); cairo_fill_preserve(cairo); @@ -61,6 +62,12 @@ void render_frame(struct swaylock_surface *surface) { cairo_set_source_rgb(cairo, 125.0 / 255, 51.0 / 255, 0); cairo_stroke(cairo); } break; + case AUTH_STATE_CLEAR: { + cairo_set_source_rgba(cairo, 229.0/255, 164.0/255, 69.0/255, 0.75); + cairo_fill_preserve(cairo); + cairo_set_source_rgb(cairo, 229.0/255, 164.0/255, 69.0/255); + cairo_stroke(cairo); + } break; default: break; } @@ -77,6 +84,15 @@ void render_frame(struct swaylock_surface *surface) { case AUTH_STATE_INVALID: text = "wrong"; break; + case AUTH_STATE_CLEAR: + text = "cleared"; + break; + case AUTH_STATE_INPUT: + case AUTH_STATE_INPUT_NOP: + if (state->xkb.caps_lock) { + text = "Caps Lock"; + cairo_set_source_rgb(cairo, 229.0/255, 164.0/255, 69.0/255); + } default: break; } |