[gnome-control-center] printers: polish empty state
- From: Felipe Borges <felipeborges src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] printers: polish empty state
- Date: Thu, 22 Oct 2015 14:45:54 +0000 (UTC)
commit e9413b4b6a2aab9e573db98c8337f8006dcd3329
Author: Felipe Borges <feborges redhat com>
Date: Fri Aug 28 14:05:38 2015 +0200
printers: polish empty state
If you don't have any printers, the panel used to look rather bare.
There was also a "No printers available" label, which was confusing,
and the insensitive list might be hard to understand.
https://bugzilla.gnome.org/show_bug.cgi?id=690351
panels/printers/cc-printers-panel.c | 15 ++++-------
panels/printers/printers.ui | 44 ++++++++++++++++++++++++++++++++--
2 files changed, 47 insertions(+), 12 deletions(-)
---
diff --git a/panels/printers/cc-printers-panel.c b/panels/printers/cc-printers-panel.c
index 781b513..d108613 100644
--- a/panels/printers/cc-printers-panel.c
+++ b/panels/printers/cc-printers-panel.c
@@ -1112,15 +1112,6 @@ actualize_printers_list (CcPrintersPanel *self)
else
gtk_notebook_set_current_page (GTK_NOTEBOOK (widget), NOTEBOOK_NO_CUPS_PAGE);
- gtk_list_store_append (store, &iter);
- gtk_list_store_set (store, &iter,
- PRINTER_ID_COLUMN, 0,
- /* Translators: There are no printers available (none is configured or CUPS is not running) */
- PRINTER_NAME_COLUMN, _("No printers available"),
- PRINTER_PAUSED_COLUMN, TRUE,
- PRINTER_DEFAULT_ICON_COLUMN, NULL,
- PRINTER_ICON_COLUMN, NULL,
- -1);
gtk_widget_set_sensitive (GTK_WIDGET (treeview), FALSE);
}
else
@@ -2555,6 +2546,7 @@ update_sensitivity (gpointer user_data)
gboolean already_present_local;
GList *iter;
gchar *current_printer_name = NULL;
+ gchar *no_printer_label;
gint i;
priv = PRINTERS_PANEL_PRIVATE (self);
@@ -2636,6 +2628,11 @@ update_sensitivity (gpointer user_data)
widget = (GtkWidget*) gtk_builder_get_object (priv->builder, "printer-add-button2");
gtk_widget_set_sensitive (widget, local_server && is_authorized && !no_cups && !priv->new_printer_name);
+ widget = (GtkWidget*) gtk_builder_get_object (priv->builder, "no-printer-label");
+ no_printer_label = g_strdup_printf ("<span size=\"larger\" weight=\"bold\">%s</span>", _("No printers"));
+ gtk_label_set_markup (GTK_LABEL (widget), no_printer_label);
+ g_free (no_printer_label);
+
widget = (GtkWidget*) gtk_builder_get_object (priv->builder, "printer-remove-button");
gtk_widget_set_sensitive (widget, already_present_local && printer_selected && !no_cups);
diff --git a/panels/printers/printers.ui b/panels/printers/printers.ui
index bdbb3c1..f27efca 100644
--- a/panels/printers/printers.ui
+++ b/panels/printers/printers.ui
@@ -30,6 +30,7 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="headers_visible">False</property>
+ <property name="width-request">200</property>
</object>
</child>
</object>
@@ -536,19 +537,56 @@
</packing>
</child>
<child>
- <object class="GtkButtonBox" id="hbuttonbox2">
+ <object class="GtkBox" id="hbuttonbox2">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">10</property>
+ <property name="orientation">vertical</property>
+ <property name="valign">center</property>
+ <child>
+ <object class="GtkImage" id="no-printer-image">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="valign">start</property>
+ <property name="pixel_size">64</property>
+ <property name="icon_name">printer-symbolic</property>
+ <style>
+ <class name="dim-label"/>
+ </style>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="no-printer-label">
+ <property name="visible">True</property>
+ <style>
+ <class name="dim-label"/>
+ </style>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
<child>
<object class="GtkButton" id="printer-add-button2">
- <property name="label" translatable="yes" comments="Translators: This button adds new
printer.">Add New Printer</property>
+ <property name="label" translatable="yes" comments="Translators: This button adds new
printer.">Add a Printer</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
+ <property name="halign">center</property>
+ <property name="relief">normal</property>
+ <style>
+ <class name="suggested-action"/>
+ </style>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
- <property name="position">0</property>
+ <property name="position">2</property>
</packing>
</child>
</object>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]