[geary/mjog/mutiple-main-windows: 14/14] Show HeaderBar close buttons by default



commit ccb1135961d4c1d2459c9ef5f1911aaa3a2c72dc
Author: Michael Gratton <mike vee net>
Date:   Mon Nov 18 15:29:39 2019 +1100

    Show HeaderBar close buttons by default
    
    Only disable under Unity where they aren't desirable.

 src/client/application/application-main-window.vala | 2 +-
 src/client/components/main-toolbar.vala             | 3 +--
 src/client/composer/composer-window.vala            | 2 +-
 ui/composer-headerbar.ui                            | 1 +
 ui/main-toolbar.ui                                  | 1 +
 5 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/src/client/application/application-main-window.vala 
b/src/client/application/application-main-window.vala
index fee96fa2..4f2efb85 100644
--- a/src/client/application/application-main-window.vala
+++ b/src/client/application/application-main-window.vala
@@ -962,9 +962,9 @@ public class Application.MainWindow :
         this.main_toolbar.bind_property("find-open", this.conversation_viewer.conversation_find_bar,
                 "search-mode-enabled", BindingFlags.SYNC_CREATE | BindingFlags.BIDIRECTIONAL);
         if (config.desktop_environment == UNITY) {
+            this.main_toolbar.show_close_button = false;
             this.main_layout.pack_start(main_toolbar, false, true, 0);
         } else {
-            main_toolbar.show_close_button = true;
             set_titlebar(this.main_toolbar);
         }
 
diff --git a/src/client/components/main-toolbar.vala b/src/client/components/main-toolbar.vala
index 9f148b14..5afaea6c 100644
--- a/src/client/components/main-toolbar.vala
+++ b/src/client/components/main-toolbar.vala
@@ -13,7 +13,7 @@ public class MainToolbar : Gtk.Box {
     public string account { get; set; }
     public string folder { get; set; }
     // Close button settings
-    public bool show_close_button { get; set; default = false; }
+    public bool show_close_button { get; set; default = true; }
     public bool show_close_button_left { get; private set; default = true; }
     public bool show_close_button_right { get; private set; default = true; }
     // Search and find bar
@@ -115,7 +115,6 @@ public class MainToolbar : Gtk.Box {
         header.get_style_context().remove_class("geary-titlebar");
         header.get_style_context().remove_class("geary-titlebar-right");
         guest_header_binding.unbind();
-        header.show_close_button = false;
         header.decoration_layout = Gtk.Settings.get_default().gtk_decoration_layout;
         conversation_header.show();
     }
diff --git a/src/client/composer/composer-window.vala b/src/client/composer/composer-window.vala
index 7e6f4056..51f131b1 100644
--- a/src/client/composer/composer-window.vala
+++ b/src/client/composer/composer-window.vala
@@ -42,9 +42,9 @@ public class Composer.Window : Gtk.ApplicationWindow, Container {
 
         this.composer.update_window_title();
         if (application.config.desktop_environment == UNITY) {
+            composer.header.show_close_button = false;
             composer.embed_header();
         } else {
-            composer.header.show_close_button = true;
             set_titlebar(this.composer.header);
         }
 
diff --git a/ui/composer-headerbar.ui b/ui/composer-headerbar.ui
index fb672ae1..7c71c178 100644
--- a/ui/composer-headerbar.ui
+++ b/ui/composer-headerbar.ui
@@ -5,6 +5,7 @@
   <template class="ComposerHeaderbar" parent="GtkHeaderBar">
     <property name="visible">True</property>
     <property name="can_focus">False</property>
+    <property name="show_close_button">True</property>
     <child>
       <object class="GtkBox" id="detach_start">
         <property name="visible">True</property>
diff --git a/ui/main-toolbar.ui b/ui/main-toolbar.ui
index 353b9ff1..5cf9e4d8 100644
--- a/ui/main-toolbar.ui
+++ b/ui/main-toolbar.ui
@@ -100,6 +100,7 @@
       <object class="GtkHeaderBar" id="conversation_header">
         <property name="visible">True</property>
         <property name="can_focus">False</property>
+        <property name="show_close_button">True</property>
         <child>
           <object class="GtkBox" id="reply_forward_buttons">
             <property name="visible">True</property>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]