From 3af6c0e9590f17a221ffcdbb43411f569af67b9d Mon Sep 17 00:00:00 2001 From: Steve Dodier-Lazaro Date: Sat, 21 Feb 2015 06:05:17 +0000 Subject: [PATCH] Adding a UI for the xfwm4 zoom feature in the a11y dialog --- .../accessibility-dialog.glade | 77 ++++++++++++++++++++++ dialogs/accessibility-settings/main.c | 15 +++++ 2 files changed, 92 insertions(+) diff --git a/dialogs/accessibility-settings/accessibility-dialog.glade b/dialogs/accessibility-settings/accessibility-dialog.glade index bf097d1..06b09dc 100644 --- a/dialogs/accessibility-settings/accessibility-dialog.glade +++ b/dialogs/accessibility-settings/accessibility-dialog.glade @@ -932,6 +932,83 @@ next time you login False + + + True + False + 12 + + + True + False + 0 + none + + + True + False + 6 + 12 + + + True + False + 6 + + + Enable _zooming the display (Alt + scroll up/down) + False + True + True + False + When enabled, you can zoom in or out the entire display by pressing Alt and scrolling up or down; Only available with Xfce's window manager + True + True + + + False + False + 0 + + + + + + + + + True + False + Display Zoom + + + + + + + + False + True + 0 + + + + + 3 + + + + + True + False + _Display + True + + + 3 + False + + True diff --git a/dialogs/accessibility-settings/main.c b/dialogs/accessibility-settings/main.c index 07d482e..ba77d15 100644 --- a/dialogs/accessibility-settings/main.c +++ b/dialogs/accessibility-settings/main.c @@ -27,6 +27,7 @@ #include #include +#include #include #include @@ -49,6 +50,7 @@ static GOptionEntry entries[] = /* global xfconf channel */ static XfconfChannel *accessibility_channel = NULL; +static XfconfChannel *display_channel = NULL; static XfconfChannel *session_channel = NULL; @@ -98,6 +100,7 @@ static void accessibility_settings_dialog_configure_widgets (GtkBuilder *builder) { GObject *box, *object; + const char *wm_name; /* assistive technologies */ object = gtk_builder_get_object (builder, "start-at"); @@ -155,6 +158,16 @@ accessibility_settings_dialog_configure_widgets (GtkBuilder *builder) object = gtk_builder_get_object (builder, "mouse-emulation-curve"); xfconf_g_property_bind (accessibility_channel, "/MouseKeys/Curve", G_TYPE_INT, object, "value"); + + /* Display keys */ + object = gtk_builder_get_object (builder, "display-zoom-enabled"); + xfconf_g_property_bind (display_channel, "/general/zoom_desktop", G_TYPE_BOOLEAN, object, "active"); + + wm_name = gdk_x11_screen_get_window_manager_name (gdk_screen_get_default ()); + if (G_UNLIKELY (g_ascii_strcasecmp (wm_name, "Xfwm4"))) + { + gtk_widget_set_sensitive (GTK_WIDGET (object), FALSE); + } } @@ -227,6 +240,7 @@ main (gint argc, gchar **argv) /* open the channels */ accessibility_channel = xfconf_channel_new ("accessibility"); + display_channel = xfconf_channel_new ("xfwm4"); session_channel = xfconf_channel_new ("xfce4-session"); /* hook to make sure the libxfce4ui library is linked */ @@ -288,6 +302,7 @@ main (gint argc, gchar **argv) /* release the channels */ g_object_unref (G_OBJECT (accessibility_channel)); + g_object_unref (G_OBJECT (display_channel)); g_object_unref (G_OBJECT (session_channel)); /* shutdown xfconf */ -- 2.3.0