[gnome-control-center] printers: Make "Add…" button consistent with user accounts panel



commit 1fc8b772a4caee4606de672c2ec30cfbbb594db9
Author: Eric <eric daigle zaclys net>
Date:   Tue Jun 8 21:04:22 2021 -0400

    printers: Make "Add…" button consistent with user accounts panel
    
    The "Add..." toolbar button on the printers panel is currently hidden until the panel is unlocked.
    This commit makes the button visible but insensitive when the panel is locked (becoming sensitive when 
unlocked),
    as suggested in #1213. It also changes the text from "Add..." to "Add Printer..."
    and updates the subtitle in the infobar to "Unlock to Add Printers and Change Settings."
    These changes make the button's UI consistent with the Accounts panel's "Add User..." toolbar button.
    
    Closes #1213

 panels/printers/cc-printers-panel.c | 4 +++-
 panels/printers/printers.ui         | 4 ++--
 2 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/panels/printers/cc-printers-panel.c b/panels/printers/cc-printers-panel.c
index 4c7d3f779..e1702061a 100644
--- a/panels/printers/cc-printers-panel.c
+++ b/panels/printers/cc-printers-panel.c
@@ -995,7 +995,7 @@ update_sensitivity (gpointer user_data)
   gtk_widget_set_visible (widget, !no_cups);
 
   widget = (GtkWidget*) gtk_builder_get_object (self->builder, "printer-add-button");
-  gtk_widget_set_visible (widget, local_server && self->is_authorized && !no_cups && 
!self->new_printer_name);
+  gtk_widget_set_sensitive (widget, local_server && self->is_authorized && !no_cups && 
!self->new_printer_name);
 
   widget = (GtkWidget*) gtk_builder_get_object (self->builder, "printer-add-button2");
   gtk_widget_set_sensitive (widget, local_server && self->is_authorized && !no_cups && 
!self->new_printer_name);
@@ -1273,6 +1273,8 @@ cc_printers_panel_init (CcPrintersPanel *self)
 
       cc_permission_infobar_set_permission (self->permission_infobar,
                                             self->permission);
+      cc_permission_infobar_set_title (self->permission_infobar,
+                                      _("Unlock to Add Printers and Change Settings"));
 
       on_permission_changed (self);
     }
diff --git a/panels/printers/printers.ui b/panels/printers/printers.ui
index 843e7ed0e..5fbaafb02 100644
--- a/panels/printers/printers.ui
+++ b/panels/printers/printers.ui
@@ -7,9 +7,9 @@
     <child>
       <object class="GtkButton" id="printer-add-button">
         <property name="visible">True</property>
-        <property name="sensitive">True</property>
+        <property name="sensitive">False</property>
         <property name="use_underline">True</property>
-        <property name="label" translatable="yes" comments="Translators: This button adds new 
printer.">Add…</property>
+        <property name="label" translatable="yes" comments="Translators: This button adds new printer.">Add 
Printer…</property>
         <style>
           <class name="suggested-action"/>
         </style>


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