Commit 4a3013ac authored by Yosef Or Boczko's avatar Yosef Or Boczko Committed by Ignacio Casal Quinteiro

window: Fix the location of the buttons in the headerbar when is split

parent 0c5a2f82
......@@ -2609,6 +2609,7 @@ side_panel_visibility_changed (GtkWidget *panel,
gboolean visible;
GAction *action;
GtkStyleContext *context;
gchar *layout_desc;
visible = gtk_widget_get_visible (panel);
......@@ -2632,6 +2633,34 @@ side_panel_visibility_changed (GtkWidget *panel,
gtk_style_context_remove_class (context, "gedit-titlebar-right");
gtk_widget_grab_focus (GTK_WIDGET (window->priv->multi_notebook));
g_object_get (gtk_settings_get_default (),
"gtk-decoration-layout", &layout_desc,
if (visible)
gchar **tokens;
tokens = g_strsplit (layout_desc, ":", 2);
if (tokens)
gchar *layout_headerbar;
layout_headerbar = g_strdup_printf ("%c%s", ':', tokens[1]);
gtk_header_bar_set_decoration_layout (GTK_HEADER_BAR (window->priv->headerbar), layout_headerbar);
gtk_header_bar_set_decoration_layout (GTK_HEADER_BAR (window->priv->side_headerbar), tokens[0]);
g_free (layout_headerbar);
g_strfreev (tokens);
gtk_header_bar_set_decoration_layout (GTK_HEADER_BAR (window->priv->headerbar), layout_desc);
gtk_header_bar_set_decoration_layout (GTK_HEADER_BAR (window->priv->side_headerbar), NULL);
g_free (layout_desc);
static void
......@@ -111,6 +111,7 @@
<object class="GtkHeaderBar" id="side_headerbar">
<property name="visible">True</property>
<property name="title">Documents</property>
<property name="show_close_button">True</property>
<class name="gedit-titlebar-left"/>
<class name="titlebar"/>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment