summaryrefslogtreecommitdiff
path: root/render.c
diff options
context:
space:
mode:
authorPeter Kasza <peter.kasza@itinsight.hu>2019-05-05 11:29:44 +0200
committerDrew DeVault <sir@cmpwn.com>2019-05-05 09:25:59 -0600
commit183d1bd54926b061a8e81585944b80fb9ab0f619 (patch)
tree4d4a740ca4e69c6670f3a8a0e3726b68a0c1d1f0 /render.c
parent84bfc6c7edf1465096f6663c6d931981bd924280 (diff)
Add fixed font-size option for indicator
This commit adds a new command line option called --font-size to specify a fixed font size in the indicator. The default value for font-size is 0, which means that the text will autoscale. Any other positive value will result in a fixed text size.
Diffstat (limited to 'render.c')
-rw-r--r--render.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/render.c b/render.c
index 6d65b96..b2b0956 100644
--- a/render.c
+++ b/render.c
@@ -128,7 +128,11 @@ void render_frame(struct swaylock_surface *surface) {
set_color_for_state(cairo, state, &state->args.colors.text);
cairo_select_font_face(cairo, state->args.font,
CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
- cairo_set_font_size(cairo, arc_radius / 3.0f);
+ if (state->args.font_size > 0) {
+ cairo_set_font_size(cairo, state->args.font_size);
+ } else {
+ cairo_set_font_size(cairo, arc_radius / 3.0f);
+ }
switch (state->auth_state) {
case AUTH_STATE_VALIDATING:
text = "verifying";