Skip to content

Commit

Permalink
media-keys: Use constant for icon size in OSD
Browse files Browse the repository at this point in the history
Signed-off-by: Zhang Xianwei <zhang.xianwei8@zte.com.cn>
  • Loading branch information
zhangxianwei8 authored and raveit65 committed Nov 27, 2018
1 parent 1a69d22 commit ff8f8d3
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/gsd-media-keys-window.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@

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

#define ICON_SCALE 0.65 /* size of the icon compared to the whole OSD */

struct MsdMediaKeysWindowPrivate
{
MsdMediaKeysWindowAction action;
Expand Down Expand Up @@ -449,8 +451,8 @@ draw_action_volume (MsdMediaKeysWindow *window,

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

icon_box_width = round (window_width * 0.65);
icon_box_height = round (window_height * 0.65);
icon_box_width = round (window_width * ICON_SCALE);
icon_box_height = round (window_height * ICON_SCALE);
volume_box_width = icon_box_width;
volume_box_height = round (window_height * 0.05);

Expand Down Expand Up @@ -573,8 +575,8 @@ draw_action_custom (MsdMediaKeysWindow *window,

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

icon_box_width = round (window_width * 0.65);
icon_box_height = round (window_height * 0.65);
icon_box_width = round (window_width * ICON_SCALE);
icon_box_height = round (window_height * ICON_SCALE);
bright_box_width = round (icon_box_width);
bright_box_height = round (window_height * 0.05);

Expand Down

0 comments on commit ff8f8d3

Please sign in to comment.