[gtk+] Add settings for titlebar actions



commit 1d8a1a04f6c422a5668fee0d9069e973b921bd38
Author: Matthias Clasen <mclasen redhat com>
Date:   Thu Sep 25 01:24:44 2014 -0400

    Add settings for titlebar actions
    
    These match the GSettings that mutter/metacity/gnome-shell have
    for this. We change the default for the middle-click action to
    none, since lower is just a terrible default.
    
    We're slightly bending the rules here, since we're adding new
    settings after .0, but a) it is just barely after .0, and b) settings
    are not really application API.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=729782

 gtk/gtksettings.c |   63 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 63 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtksettings.c b/gtk/gtksettings.c
index 6f69576..2cb6a81 100644
--- a/gtk/gtksettings.c
+++ b/gtk/gtksettings.c
@@ -209,6 +209,9 @@ enum {
   PROP_SHELL_SHOWS_MENUBAR,
   PROP_SHELL_SHOWS_DESKTOP,
   PROP_DECORATION_LAYOUT,
+  PROP_TITLEBAR_DOUBLE_CLICK,
+  PROP_TITLEBAR_MIDDLE_CLICK,
+  PROP_TITLEBAR_RIGHT_CLICK,
   PROP_DIALOGS_USE_HEADER,
   PROP_ENABLE_PRIMARY_PASTE,
   PROP_RECENT_FILES_ENABLED,
@@ -1571,6 +1574,66 @@ gtk_settings_class_init (GtkSettingsClass *class)
   g_assert (result == PROP_DECORATION_LAYOUT);
 
   /**
+   * GtkSettings:gtk-titlebar-double-click:
+   *
+   * This setting determines the action to take when a double-click
+   * occurs on the titlebar of client-side decorated windows.
+   *
+   * Recognized actions are minimize, toggle-maximize, menu, lower
+   * or none.
+   *
+   * Since: 3.14.1
+   */
+  result = settings_install_property_parser (class,
+                                             g_param_spec_string ("gtk-titlebar-double-click",
+                                                                  P_("Titlebar double-click action"),
+                                                                   P_("The action to take on titlebar 
double-click"),
+                                                                   "toggle-maximize", GTK_PARAM_READWRITE),
+                                             NULL);
+  g_assert (result == PROP_TITLEBAR_DOUBLE_CLICK);
+
+  /**
+   * GtkSettings:gtk-titlebar-middle-click:
+   *
+   * This setting determines the action to take when a middle-click
+   * occurs on the titlebar of client-side decorated windows.
+   *
+   * Recognized actions are minimize, toggle-maximize, menu, lower
+   * or none.
+   *
+   * Since: 3.14.1
+   */
+  result = settings_install_property_parser (class,
+                                             g_param_spec_string ("gtk-titlebar-middle-click",
+                                                                  P_("Titlebar middle-click action"),
+                                                                   P_("The action to take on titlebar 
middle-click"),
+                                                                   "none", GTK_PARAM_READWRITE),
+                                             NULL);
+  g_assert (result == PROP_TITLEBAR_MIDDLE_CLICK);
+
+  /**
+   * GtkSettings:gtk-titlebar-right-click:
+   *
+   * This setting determines the action to take when a right-click
+   * occurs on the titlebar of client-side decorated windows.
+   *
+   * Recognized actions are minimize, toggle-maximize, menu, lower
+   * or none.
+   *
+   * Since: 3.14.1
+   */
+  result = settings_install_property_parser (class,
+                                             g_param_spec_string ("gtk-titlebar-right-click",
+                                                                  P_("Titlebar right-click action"),
+                                                                   P_("The action to take on titlebar 
right-click"),
+                                                                   "menu", GTK_PARAM_READWRITE),
+                                             NULL);
+  g_assert (result == PROP_TITLEBAR_RIGHT_CLICK);
+
+
+
+
+  /**
    * GtkSettings:gtk-dialogs-use-header:
    *
    * Whether builtin GTK+ dialogs such as the file chooser, the


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]