[gtk+/wip/baedert/box: 93/108] window: Remove decoration-button-layout style property
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/baedert/box: 93/108] window: Remove decoration-button-layout style property
- Date: Mon, 17 Oct 2016 14:58:44 +0000 (UTC)
commit 4dc59fde02d1e7f45ba9629dd28ee5a4ace7ca3d
Author: Timm Bäder <mail baedert org>
Date: Sat Oct 15 21:56:09 2016 +0200
window: Remove decoration-button-layout style property
GtkSettings has a gtk-decoration-layout property for this.
gtk/gtkheaderbar.c | 20 ++++++--------------
gtk/gtkwindow.c | 9 ---------
2 files changed, 6 insertions(+), 23 deletions(-)
---
diff --git a/gtk/gtkheaderbar.c b/gtk/gtkheaderbar.c
index 268eb20..ac90c64 100644
--- a/gtk/gtkheaderbar.c
+++ b/gtk/gtkheaderbar.c
@@ -84,6 +84,7 @@ struct _GtkHeaderBarPrivate
GtkWidget *titlebar_icon;
GtkCssGadget *gadget;
+ guint shows_app_menu : 1;
};
typedef struct _Child Child;
@@ -295,6 +296,7 @@ _gtk_header_bar_update_window_buttons (GtkHeaderBar *bar)
}
priv->titlebar_icon = NULL;
+ priv->shows_app_menu = FALSE;
if (!priv->shows_wm_decorations)
return;
@@ -384,6 +386,7 @@ _gtk_header_bar_update_window_buttons (GtkHeaderBar *bar)
priv->titlebar_icon = image;
if (!_gtk_header_bar_update_window_icon (bar, window))
gtk_image_set_from_icon_name (GTK_IMAGE (priv->titlebar_icon), "process-stop-symbolic",
GTK_ICON_SIZE_MENU);
+ priv->shows_app_menu = TRUE;
}
else if (strcmp (t[j], "minimize") == 0 &&
is_sovereign_window)
@@ -505,21 +508,9 @@ gboolean
_gtk_header_bar_shows_app_menu (GtkHeaderBar *bar)
{
GtkHeaderBarPrivate *priv = gtk_header_bar_get_instance_private (bar);
- GtkWindow *window;
- gchar *layout_desc;
- gboolean ret;
-
- window = GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (bar)));
- gtk_widget_style_get (GTK_WIDGET (window),
- "decoration-button-layout", &layout_desc,
- NULL);
-
- ret = priv->shows_wm_decorations &&
- (layout_desc && strstr (layout_desc, "menu"));
-
- g_free (layout_desc);
- return ret;
+ return priv->shows_wm_decorations &&
+ priv->shows_app_menu;
}
/* As an intended side effect, this function allows @child
@@ -2119,6 +2110,7 @@ gtk_header_bar_init (GtkHeaderBar *bar)
priv->has_subtitle = TRUE;
priv->decoration_layout = NULL;
priv->decoration_layout_set = FALSE;
+ priv->shows_app_menu = FALSE;
init_sizing_box (bar);
construct_label_box (bar);
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index 667ddd6..8ee4562 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -1061,15 +1061,6 @@ gtk_window_class_init (GtkWindowClass *klass)
g_object_class_install_properties (gobject_class, LAST_ARG, window_props);
- /* Style properties.
- */
- gtk_widget_class_install_style_property (widget_class,
- g_param_spec_string ("decoration-button-layout",
- P_("Decorated button layout"),
- P_("Decorated button layout"),
- "menu:close",
- GTK_PARAM_READABLE|G_PARAM_DEPRECATED));
-
/**
* GtkWindow:set-focus:
* @window: the window which received the signal
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]