Skip to content

Commit ff8f8d3

Browse files
zhangxianwei8raveit65
authored andcommitted
media-keys: Use constant for icon size in OSD
Signed-off-by: Zhang Xianwei <[email protected]>
1 parent 1a69d22 commit ff8f8d3

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

‎src/gsd-media-keys-window.c‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434

3535
#define MSD_MEDIA_KEYS_WINDOW_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), MSD_TYPE_MEDIA_KEYS_WINDOW, MsdMediaKeysWindowPrivate))
3636

37+
#define ICON_SCALE 0.65 /* size of the icon compared to the whole OSD */
38+
3739
struct MsdMediaKeysWindowPrivate
3840
{
3941
MsdMediaKeysWindowAction action;
@@ -449,8 +451,8 @@ draw_action_volume (MsdMediaKeysWindow *window,
449451

450452
gtk_window_get_size (GTK_WINDOW (window), &window_width, &window_height);
451453

452-
icon_box_width = round (window_width * 0.65);
453-
icon_box_height = round (window_height * 0.65);
454+
icon_box_width = round (window_width * ICON_SCALE);
455+
icon_box_height = round (window_height * ICON_SCALE);
454456
volume_box_width = icon_box_width;
455457
volume_box_height = round (window_height * 0.05);
456458

@@ -573,8 +575,8 @@ draw_action_custom (MsdMediaKeysWindow *window,
573575

574576
gtk_window_get_size (GTK_WINDOW (window), &window_width, &window_height);
575577

576-
icon_box_width = round (window_width * 0.65);
577-
icon_box_height = round (window_height * 0.65);
578+
icon_box_width = round (window_width * ICON_SCALE);
579+
icon_box_height = round (window_height * ICON_SCALE);
578580
bright_box_width = round (icon_box_width);
579581
bright_box_height = round (window_height * 0.05);
580582

0 commit comments

Comments
 (0)