diff options
author | Victor Kareh <[email protected]> | 2018-02-01 09:20:32 -0500 |
---|---|---|
committer | Martin Wimpress <[email protected]> | 2018-02-01 06:20:32 -0800 |
commit | c862d81db1e0ae1ce1f62a3aac1d915f5036c81c (patch) | |
tree | 2c59e4d098c4beca891d10d067ca851ce53e56d9 /src/gs-lock-plug.c | |
parent | 64d47ad9e43da564ea4c2b2ae2dd4b1ca22a8770 (diff) | |
download | mate-screensaver-c862d81db1e0ae1ce1f62a3aac1d915f5036c81c.tar.bz2 mate-screensaver-c862d81db1e0ae1ce1f62a3aac1d915f5036c81c.tar.xz |
Add HiDPI support for lock screen (#148)
* Password dialog is now scaled
* Background of lock screen is now scaled
Diffstat (limited to 'src/gs-lock-plug.c')
-rw-r--r-- | src/gs-lock-plug.c | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/src/gs-lock-plug.c b/src/gs-lock-plug.c index 07993c5..5bea72a 100644 --- a/src/gs-lock-plug.c +++ b/src/gs-lock-plug.c @@ -981,6 +981,30 @@ set_face_image (GSLockPlug *plug) } static void +gs_lock_plug_get_preferred_width (GtkWidget *widget, gint *minimum_width, gint *natural_width) +{ + gint scale; + + GTK_WIDGET_CLASS (gs_lock_plug_parent_class)->get_preferred_width (widget, minimum_width, natural_width); + + scale = gtk_widget_get_scale_factor (widget); + *minimum_width /= scale; + *natural_width /= scale; +} + +static void +gs_lock_plug_get_preferred_height_for_width (GtkWidget *widget, gint width, gint *minimum_height, gint *natural_height) +{ + gint scale; + + GTK_WIDGET_CLASS (gs_lock_plug_parent_class)->get_preferred_height_for_width (widget, width, minimum_height, natural_height); + + scale = gtk_widget_get_scale_factor (widget); + *minimum_height /= scale; + *natural_height /= scale; +} + +static void gs_lock_plug_show (GtkWidget *widget) { GSLockPlug *plug = GS_LOCK_PLUG (widget); @@ -1251,9 +1275,11 @@ gs_lock_plug_class_init (GSLockPlugClass *klass) object_class->get_property = gs_lock_plug_get_property; object_class->set_property = gs_lock_plug_set_property; - widget_class->style_set = gs_lock_plug_style_set; - widget_class->show = gs_lock_plug_show; - widget_class->hide = gs_lock_plug_hide; + widget_class->style_set = gs_lock_plug_style_set; + widget_class->show = gs_lock_plug_show; + widget_class->hide = gs_lock_plug_hide; + widget_class->get_preferred_width = gs_lock_plug_get_preferred_width; + widget_class->get_preferred_height_for_width = gs_lock_plug_get_preferred_height_for_width; klass->close = gs_lock_plug_close; |