1
0
gnome-control-center/gnome-control-center-upower-icons.patch
Dominique Leuenberger 7e6e98030b Accepting request 211794 from openSUSE:Factory:Staging:upower
- Add gnome-control-center-upower-DeviceChanged-signal.patch,
  gnome-control-center-upower-display.patch,
  gnome-control-center-upower-fix-build.patch,
  gnome-control-center-upower-icons.patch,
  gnome-control-center-upower-changed-signal.patch -- update for libupower-glib
  API changes, from 3.11.
- Up libupower-glib dependency

OBS-URL: https://build.opensuse.org/request/show/211794
OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/gnome-control-center?expand=0&rev=230
2013-12-23 17:57:12 +00:00

55 lines
1.9 KiB
Diff

From 63bf77196ec880ba7d013d8e5329656adc0b1c3e Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess@hadess.net>
Date: Thu, 17 Oct 2013 16:51:31 +0200
Subject: [PATCH] power: Use icons from UPower
https://bugzilla.gnome.org/show_bug.cgi?id=710393
---
panels/power/cc-power-panel.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/panels/power/cc-power-panel.c b/panels/power/cc-power-panel.c
index d9d09b3..cab6b4a 100644
--- a/panels/power/cc-power-panel.c
+++ b/panels/power/cc-power-panel.c
@@ -382,6 +382,7 @@ add_battery (CcPowerPanel *panel, UpDevice *device)
GtkWidget *widget;
gchar *s;
gchar *native_path;
+ gchar *icon_name;
const gchar *name;
g_object_get (device,
@@ -389,6 +390,7 @@ add_battery (CcPowerPanel *panel, UpDevice *device)
"state", &state,
"percentage", &percentage,
"native-path", &native_path,
+ "icon-name", &icon_name,
NULL);
if (native_path && strstr (native_path, "BAT0"))
@@ -412,10 +414,9 @@ add_battery (CcPowerPanel *panel, UpDevice *device)
gtk_box_pack_start (GTK_BOX (box), box2, FALSE, TRUE, 0);
#if 1
- if (state == UP_DEVICE_STATE_DISCHARGING ||
- state == UP_DEVICE_STATE_CHARGING)
+ if (icon_name != NULL && *icon_name != '\0')
{
- widget = gtk_image_new_from_icon_name ("battery-good-charging-symbolic", GTK_ICON_SIZE_BUTTON);
+ widget = gtk_image_new_from_icon_name (icon_name, GTK_ICON_SIZE_BUTTON);
gtk_style_context_add_class (gtk_widget_get_style_context (widget), GTK_STYLE_CLASS_DIM_LABEL);
gtk_widget_set_halign (widget, GTK_ALIGN_END);
gtk_widget_set_valign (widget, GTK_ALIGN_CENTER);
@@ -455,6 +456,7 @@ add_battery (CcPowerPanel *panel, UpDevice *device)
gtk_widget_show_all (row);
g_free (native_path);
+ g_free (icon_name);
gtk_widget_set_visible (priv->battery_section, TRUE);
}
--
1.8.4