[simple-scan/gnome-3-38] Revert "Improve layout and behaviour of device buttons."



commit 151fe2f3df4412b0ce00ea2c85ebb3824700e104
Author: Bartosz <gang65 poczta onet pl>
Date:   Wed Nov 25 18:55:47 2020 +0000

    Revert "Improve layout and behaviour of device buttons."
    
    This reverts commit 22fdf2ddfdac1c53081ec8dffd677405428e2353

 src/app-window.ui   |  5 +----
 src/app-window.vala | 16 ++++++----------
 2 files changed, 7 insertions(+), 14 deletions(-)
---
diff --git a/src/app-window.ui b/src/app-window.ui
index 170bfbd5..0f7ba27d 100644
--- a/src/app-window.ui
+++ b/src/app-window.ui
@@ -564,7 +564,6 @@
             <child>
               <object class="GtkButton" id="scan_button">
                 <property name="visible">True</property>
-                <property name="sensitive">False</property>
                 <property name="can_focus">False</property>
                 <property name="receives_default">False</property>
                 <property name="tooltip_text" translatable="yes" comments="Tooltip for scan toolbar 
button">Scan a single page from the scanner</property>
@@ -795,15 +794,13 @@
                       </packing>
                     </child>
                     <child>
-                      <object class="GtkBox" id="device_buttons_box">
+                      <object class="GtkBox" id="device_combo_box">
                         <property name="visible">False</property>
                         <property name="can_focus">False</property>
                         <property name="orientation">horizontal</property>
-                        <property name="halign">center</property>
                         <property name="spacing">10</property>
                         <child>
                           <object class="GtkComboBox" id="device_combo">
-                            <property name="width_request">200</property>
                             <property name="visible">True</property>
                             <property name="model">device_model</property>
                             <signal name="changed" handler="device_combo_changed_cb" swapped="no"/>
diff --git a/src/app-window.vala b/src/app-window.vala
index 13b87ad8..6d025b5b 100644
--- a/src/app-window.vala
+++ b/src/app-window.vala
@@ -58,7 +58,7 @@ public class AppWindow : Gtk.ApplicationWindow
     [GtkChild]
     private Gtk.ListStore device_model;
     [GtkChild]
-    private Gtk.Box device_buttons_box;
+    private Gtk.Box device_combo_box;
     [GtkChild]
     private Gtk.ComboBox device_combo;
     [GtkChild]
@@ -254,7 +254,7 @@ public class AppWindow : Gtk.ApplicationWindow
             status_primary_label.set_text (/* Label shown when searching for scanners */
                                            _("Searching for Scanners…"));
             status_secondary_label.visible = false;
-            device_buttons_box.visible = false;
+            device_combo_box.visible = false;
         }
         else if (get_selected_device () != null)
         {
@@ -263,8 +263,7 @@ public class AppWindow : Gtk.ApplicationWindow
                                            _("Ready to Scan"));
             status_secondary_label.set_text (get_selected_device_label ());
             status_secondary_label.visible = false;
-            device_buttons_box.visible = true;
-            device_buttons_box.sensitive = true;
+            device_combo_box.visible = true;
             device_combo.sensitive = true;
         }
         else if (this.missing_driver != null)
@@ -274,7 +273,7 @@ public class AppWindow : Gtk.ApplicationWindow
             /* Instructions to install driver software */
             status_secondary_label.set_markup (_("You need to <a href=\"install-firmware\">install driver 
software</a> for your scanner."));
             status_secondary_label.visible = true;
-            device_buttons_box.visible = false;
+            device_combo_box.visible = false;
         }
         else
         {
@@ -283,9 +282,7 @@ public class AppWindow : Gtk.ApplicationWindow
             /* Hint to user on why there are no scanners detected */
             status_secondary_label.set_text (_("Please check your scanner is connected and powered on"));
             status_secondary_label.visible = true;
-            device_buttons_box.visible = true;
-            device_buttons_box.sensitive = true;
-            device_combo.sensitive = false; // We would like to be refresh button to be active
+            device_combo_box.visible = false;
         }
     }
 
@@ -834,8 +831,7 @@ public class AppWindow : Gtk.ApplicationWindow
     {
         status_primary_label.set_text (/* Label shown when scan started */
                                        _("Contacting scanner…"));
-        device_buttons_box.visible = true;
-        device_buttons_box.sensitive = false;
+        device_combo.sensitive = false;
         start_scan (get_selected_device (), options);
     }
 


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