GNOME Bugzilla – Bug 779702
Hide the supply level bar entirely when there's no ink info to show
Last modified: 2017-06-15 13:40:21 UTC
It would save us some vertical space to hide the supply level bar, instead of greying it out, when there's no inklevel data to show.
Makes sense to me.
I was thinking about the same 10 minutes ago when looking at the panel.
Created attachment 347388 [details] [review] printers: Hide supply level bar when there's no inklevel data
be aware that we are going through a freeze.
Review of attachment 347388 [details] [review]: Thank you for the patch. When I apply the patch the icons are not aligned if there are printers with/without "Ink Level" indicator or with/without "Location" field. Maybe a GtkSizeGroup could help here.
Created attachment 347549 [details] screenshot (In reply to Marek Kašík from comment #5) > Review of attachment 347388 [details] [review] [review]: > > Thank you for the patch. When I apply the patch the icons are not aligned if > there are printers with/without "Ink Level" indicator or with/without > "Location" field. Maybe a GtkSizeGroup could help here. Please, can you be more specific? I don't see which misalignment you mean.
Created attachment 347551 [details] screenshot of missalignment
Created attachment 348398 [details] [review] printers: Hide supply level bar when there's no inklevel data
Created attachment 348401 [details] printer-entry-alignment I think now we got the alignments correctly.
Review of attachment 348398 [details] [review]: Not yet. You have to consider the entries which do not have Location field.
Created attachment 352947 [details] [review] printers: Hide supply level bar when there's no inklevel data
Review of attachment 352947 [details] [review]: Unfortunately, the misalignment is still there. Try to use e.g. ky_KG or pl_PL locale. For this kind of issues it is better to use some systematic solutions (e.g. size group) since a fixed value can be wrong with another locale.
Created attachment 353384 [details] [review] printers: Hide supply level bar when there is no inklevel data
Created attachment 353385 [details] [review] printers: Hide supply level bar when there's no inklevel data
attachment 353385 [details] [review] and attachment 353384 [details] [review] are two alternatives for the alignment issue.
Review of attachment 353384 [details] [review]: Thank you for the 2 alternatives. I would use this one with some modifications. Moreover, set xalign to 1.0 for the labels so they are aligned to right. ::: panels/printers/cc-printers-panel.c @@ +758,3 @@ + for (; widgets != NULL; widgets = g_slist_next (widgets)) + gtk_size_group_add_widget (priv->size_group, GTK_WIDGET (widgets->data)); + g_slist_free (widgets); This wouldn't free anything since you've overwritten the pointer. Use some dedicated iterator here. ::: panels/printers/pp-printer-entry.c @@ +680,3 @@ + + gtk_size_group_add_widget (group, GTK_WIDGET (self->printer_icon)); + gtk_size_group_add_widget (group, GTK_WIDGET (self->printer_location_label)); Add self->printer_model_label and self->printer_inklevel_label please. ::: panels/printers/pp-printer-entry.h @@ +37,3 @@ void pp_printer_entry_update_jobs_count (PpPrinterEntry *self); +GtkSizeGroup *pp_printer_entry_get_size_group (PpPrinterEntry *self); Lets return just a list of widgets which needs to be grouped and maybe change the name to pp_printer_entry_get_size_group_widgets().
Created attachment 353735 [details] [review] printers: Hide supply level bar when there is no inklevel data
Review of attachment 353735 [details] [review]: Except the one small issue the patch looks good to me. Thank you for all of them! ::: panels/printers/pp-printer-entry.c @@ +678,3 @@ +pp_printer_entry_get_size_group_widgets (PpPrinterEntry *self) +{ + GSList *widgets; You need to initialize this to NULL.
Thanks. Pushed with the change. Attachment 353735 [details] pushed as 0d0b42e - printers: Hide supply level bar when there is no inklevel data