[gedit] Allow close button in the left corner
- From: Jeremy Bicha <jbicha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gedit] Allow close button in the left corner
- Date: Wed, 24 Jan 2018 20:49:49 +0000 (UTC)
commit 2d7369a01afc55092940509dbf98e9b139f08018
Author: Sergio Costas <raster rastersoft com>
Date: Sun May 15 02:20:07 2016 +0200
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
gedit/resources/ui/gedit-window.ui | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/gedit/resources/ui/gedit-window.ui b/gedit/resources/ui/gedit-window.ui
index 63fb081..e25e933 100644
--- a/gedit/resources/ui/gedit-window.ui
+++ b/gedit/resources/ui/gedit-window.ui
@@ -12,7 +12,7 @@
<child>
<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>
</object>
<packing>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]