Commit 2d7369a0 authored by Sergio Costas's avatar Sergio Costas Committed by Jeremy Bicha

Allow close button in the left corner

When the window buttons are put on the left corner, and the left panel is
visible, the frame buttons (like "close") are not visible because they are
marked as permanently hidden. Gedit uses GtkHeaderBar, but, for stetic reasons,
when the left panel is visible it uses two GtkHeaderBar. In this case, the
header bar located in the right part of the window should show only the
frame controls located in the right part, and the header bar located
over the left panel should show the ones located in the left zone.

Function "side_panel_visibility_changed" (located in gedit-window.c) checks
wether the side panel is visible or not, and if it is, takes the decoration
layout, split it in two (by searching for a colon) and applies each half to
the corresponding GtkHeaderBar. Unfortunately, since the left GtkHeaderBar
has as False the "show-close-button" property (in the .ui file), it never
shows the frame controls. The right GtkHeaderBar has a True in that property,
and that's why it shows them when the decoration layout puts the close
button in the right corner.

This patch fixes this bug by changing the "show-close-button" property to
True. This way, when the decoration layout has a "close button" in the left
corner, the GtkHeaderBar will show it. Of course, if the layout puts the
"close button" in the right corner, the left GtkHeaderBar won't show it,
thanks to the code in gedit-window.c
parent 82847144
......@@ -12,7 +12,7 @@
<object class="GtkHeaderBar" id="side_headerbar">
<property name="visible" bind-source="side_panel" bind-property="visible" bind-flags="sync-create"/>
<property name="show_close_button">False</property>
<property name="show_close_button">True</property>
<property name="title" translatable="yes">Documents</property>
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