mate-desktop / mate-terminal

The MATE Terminal Emulator
http://www.mate-desktop.org
GNU General Public License v3.0
133 stars 73 forks source link

Add confirm-close-dialog.ui #336

Closed rbuj closed 4 years ago

rbuj commented 4 years ago

Before

Screenshot at 2020-03-30 15-06-47

Screenshot at 2020-03-30 15-07-17

Screenshot at 2020-03-30 15-09-03

After

Screenshot at 2020-03-30 15-09-48

Screenshot at 2020-03-30 15-30-05

Screenshot at 2020-03-30 15-30-28

sc0w commented 4 years ago

personally, I prefer 2020-03-30_15-48 instead 2020-03-30_15-48_1 to make sure the dialog comes from the terminal

rbuj commented 4 years ago

@sc0w done.

raveit65 commented 4 years ago

I prefer to use the previous used styleclass linked for the buttonbox. See gtk-inspector on master branch. Bildschirmfoto zu 2020-03-30 15-51-58 In this case the css selector is

buttonbox.linked.horizontal.dialog-action-area button.default.text-button {}

Modern gtk themes like Menta Blue-Submarine or adwita use the linked styleclass for buttons, in result buttons are sorted to left/middle/right buttons, and you can drop the space between buttons by a gtk-theme. Eg. Blue-submarine https://github.com/mate-desktop/mate-themes/blob/master/desktop-themes/Blue-Submarine/gtk-3.0/gtk-widgets.css#L1560

Oldschool themes like Traditional themes don't have the linked button style.

It is possible to add this style class to GtkButtonBox in glade file to restore previous behaviour.

          <object class="GtkButtonBox">
            <property name="visible">True</property>
            <property name="can_focus">False</property>
            <property name="layout_style">end</property>
            <child>

<cut>

            </child>
            <style>
              <class name="linked"/>
            </style>
rbuj commented 4 years ago

@raveit65 done.

rbuj commented 4 years ago

@raveit65 Do you agree to expand the button box, remove window title like in the screenshot below? Screenshot at 2020-03-30 18-34-21

diff --git a/src/confirm-close-dialog.ui b/src/confirm-close-dialog.ui
index 624bf66..999a552 100644
--- a/src/confirm-close-dialog.ui
+++ b/src/confirm-close-dialog.ui
@@ -15,11 +15,9 @@
   <object class="GtkDialog" id="confirm_close_dialog">
     <property name="can_focus">False</property>
     <property name="border_width">5</property>
-    <property name="title" translatable="yes">Confirm Close</property>
     <property name="modal">True</property>
     <property name="window_position">center</property>
     <property name="destroy_with_parent">True</property>
-    <property name="icon_name">utilities-terminal</property>
     <property name="type_hint">dialog</property>
     <child type="titlebar">
       <placeholder/>
@@ -34,7 +32,9 @@
           <object class="GtkButtonBox">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
-            <property name="layout_style">end</property>
+            <property name="hexpand">True</property>
+            <property name="homogeneous">True</property>
+            <property name="layout_style">expand</property>
             <child>
               <object class="GtkButton" id="button_cancel">
                 <property name="label" translatable="yes">_Cancel</property>
@@ -74,7 +74,7 @@
             </style>
           </object>
           <packing>
-            <property name="expand">False</property>
+            <property name="expand">True</property>
             <property name="fill">True</property>
             <property name="pack_type">end</property>
             <property name="position">0</property>
diff --git a/src/terminal-window.c b/src/terminal-window.c
index 63f8580..2a5e9b0 100644
--- a/src/terminal-window.c
+++ b/src/terminal-window.c
@@ -3640,7 +3640,7 @@ confirm_close_window_or_tab (TerminalWindow *window,
                       G_CALLBACK (confirm_close_response_cb), window);

     gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (window));
-
+    gtk_window_set_title (GTK_WINDOW (dialog), "");
     gtk_window_present (GTK_WINDOW (dialog));

     return TRUE;
raveit65 commented 4 years ago

Dialog looks good, good idea to expand the buttonbox . +1

rbuj commented 4 years ago

@raveit65 done.

sc0w commented 4 years ago

@rbuj with this PR the dialog is shown at the center of the monitor, and without this PR the dialog is shown at the center of the mate-terminal window

please, can you respect old behavior to show the dialog at the center of the window?

rbuj commented 4 years ago

@sc0w done.