[gnome-control-center] power: Hide the icon of the battery row when unused
- From: Robert Ancell <rancell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] power: Hide the icon of the battery row when unused
- Date: Fri, 7 May 2021 02:53:33 +0000 (UTC)
commit 97ba14e002aa992b95a144cfc519ea740bf7deb8
Author: Adrien Plazas <kekun plazas laposte net>
Date: Fri Jan 8 16:29:18 2021 +0100
power: Hide the icon of the battery row when unused
This gives more room to the label.
panels/power/cc-battery-row.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/panels/power/cc-battery-row.c b/panels/power/cc-battery-row.c
index 55d7584d7..f6faca0c1 100644
--- a/panels/power/cc-battery-row.c
+++ b/panels/power/cc-battery-row.c
@@ -275,7 +275,12 @@ cc_battery_row_new (UpDevice *device,
/* Icon */
if (is_kind_battery && icon_name != NULL && icon_name[0] != '\0')
- gtk_image_set_from_icon_name (self->icon, icon_name, GTK_ICON_SIZE_BUTTON);
+ {
+ gtk_image_set_from_icon_name (self->icon, icon_name, GTK_ICON_SIZE_BUTTON);
+ gtk_widget_show (GTK_WIDGET (self->icon));
+ }
+ else
+ gtk_widget_hide (GTK_WIDGET (self->icon));
/* Percentage label */
if (battery_level == UP_DEVICE_LEVEL_NONE)
@@ -347,4 +352,4 @@ UpDeviceKind
cc_battery_row_get_kind (CcBatteryRow *self)
{
return self->kind;
-}
\ No newline at end of file
+}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]