[dconf-editor] Custom close-window button on small screen.
- From: Arnaud B. <arnaudb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [dconf-editor] Custom close-window button on small screen.
- Date: Thu, 22 Nov 2018 12:36:41 +0000 (UTC)
commit 8761704f35ee1590bac22c2337fad7a03ae9f67e
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date: Thu Nov 22 13:09:42 2018 +0100
Custom close-window button on small screen.
editor/browser-headerbar.ui | 19 +++++++++++++++++++
editor/browser-headerbar.vala | 27 +++++++++++++++++++--------
2 files changed, 38 insertions(+), 8 deletions(-)
---
diff --git a/editor/browser-headerbar.ui b/editor/browser-headerbar.ui
index ff76edd..96d3ff2 100644
--- a/editor/browser-headerbar.ui
+++ b/editor/browser-headerbar.ui
@@ -167,6 +167,25 @@
</child>
</object>
</child>
+ <child>
+ <object class="GtkMenuButton" id="quit_button">
+ <property name="visible">False</property>
+ <property name="action-name">app.quit</property>
+ <style>
+ <class name="titlebutton"/>
+ </style>
+ <child>
+ <object class="GtkImage">
+ <property name="visible">True</property>
+ <property name="icon-name">window-close-symbolic</property>
+ <property name="icon-size">1</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="pack-type">end</property>
+ </packing>
+ </child>
<child>
<object class="GtkButton" id="show_modifications_button">
<property name="visible">False</property>
diff --git a/editor/browser-headerbar.vala b/editor/browser-headerbar.vala
index c53f286..bb7dd7e 100644
--- a/editor/browser-headerbar.vala
+++ b/editor/browser-headerbar.vala
@@ -199,6 +199,7 @@ private class BrowserHeaderBar : HeaderBar, AdaptativeWidget
[GtkChild] private Separator modifications_separator;
[GtkChild] private Button show_modifications_button;
[GtkChild] private Button hide_modifications_button;
+ [GtkChild] private Button quit_button;
[GtkChild] private MenuButton modifications_actions_button;
bool in_window_modifications = false;
@@ -221,29 +222,39 @@ private class BrowserHeaderBar : HeaderBar, AdaptativeWidget
private void update_modifications_button ()
{
- if (extra_small_window && delay_mode)
+ if (extra_small_window)
{
set_show_close_button (false);
if (in_window_modifications)
{
+ quit_button.hide ();
show_modifications_button.hide ();
modifications_separator.hide ();
}
- else if (in_window_bookmarks || in_window_about)
- {
- show_modifications_button.show ();
- modifications_separator.hide ();
- }
else
{
- show_modifications_button.show ();
- modifications_separator.show ();
+ if (delay_mode)
+ {
+ quit_button.hide ();
+ show_modifications_button.show ();
+ }
+ else
+ {
+ show_modifications_button.hide ();
+ quit_button.show ();
+ }
+
+ if (in_window_bookmarks || in_window_about)
+ modifications_separator.hide ();
+ else
+ modifications_separator.show ();
}
}
else
{
if (in_window_modifications)
hide_in_window_modifications ();
+ quit_button.hide ();
show_modifications_button.hide ();
modifications_separator.hide ();
set_show_close_button (true);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]