power: Remove icons from power profiles

They were originally included was to educate users about what the icons
mean, for when they appeared in the top bar. However, since we no
longer plan on showing the status icon in the top bar, it's not so
important that people learn the meaning of the icons.

See https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1421
This commit is contained in:
Bastien Nocera 2021-08-04 11:26:33 +02:00
parent 7b21494774
commit 19fb4e4a0c
2 changed files with 2 additions and 26 deletions

View file

@ -35,7 +35,6 @@ struct _CcPowerProfileRow
GtkListBoxRow parent_instance; GtkListBoxRow parent_instance;
GtkRadioButton *button; GtkRadioButton *button;
GtkImage *icon_image;
GtkLabel *subtitle_label; GtkLabel *subtitle_label;
GtkLabel *title_label; GtkLabel *title_label;
@ -106,7 +105,6 @@ cc_power_profile_row_class_init (CcPowerProfileRowClass *klass)
gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/control-center/power/cc-power-profile-row.ui"); gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/control-center/power/cc-power-profile-row.ui");
gtk_widget_class_bind_template_child (widget_class, CcPowerProfileRow, button); gtk_widget_class_bind_template_child (widget_class, CcPowerProfileRow, button);
gtk_widget_class_bind_template_child (widget_class, CcPowerProfileRow, icon_image);
gtk_widget_class_bind_template_child (widget_class, CcPowerProfileRow, subtitle_label); gtk_widget_class_bind_template_child (widget_class, CcPowerProfileRow, subtitle_label);
gtk_widget_class_bind_template_child (widget_class, CcPowerProfileRow, title_label); gtk_widget_class_bind_template_child (widget_class, CcPowerProfileRow, title_label);
@ -175,7 +173,7 @@ CcPowerProfileRow *
cc_power_profile_row_new (CcPowerProfile power_profile) cc_power_profile_row_new (CcPowerProfile power_profile)
{ {
CcPowerProfileRow *self; CcPowerProfileRow *self;
const char *text, *subtext, *icon_name, *class_name; const char *text, *subtext;
self = g_object_new (CC_TYPE_POWER_PROFILE_ROW, NULL); self = g_object_new (CC_TYPE_POWER_PROFILE_ROW, NULL);
@ -185,20 +183,14 @@ cc_power_profile_row_new (CcPowerProfile power_profile)
case CC_POWER_PROFILE_PERFORMANCE: case CC_POWER_PROFILE_PERFORMANCE:
text = _("Performance"); text = _("Performance");
subtext = _("High performance and power usage."); subtext = _("High performance and power usage.");
icon_name = "power-profile-performance-symbolic";
class_name = "performance";
break; break;
case CC_POWER_PROFILE_BALANCED: case CC_POWER_PROFILE_BALANCED:
text = _("Balanced Power"); text = _("Balanced Power");
subtext = _("Standard performance and power usage."); subtext = _("Standard performance and power usage.");
icon_name = "power-profile-balanced-symbolic";
class_name = NULL;
break; break;
case CC_POWER_PROFILE_POWER_SAVER: case CC_POWER_PROFILE_POWER_SAVER:
text = _("Power Saver"); text = _("Power Saver");
subtext = _("Reduced performance and power usage."); subtext = _("Reduced performance and power usage.");
icon_name = "power-profile-power-saver-symbolic";
class_name = "low-power";
break; break;
default: default:
g_assert_not_reached (); g_assert_not_reached ();
@ -206,9 +198,6 @@ cc_power_profile_row_new (CcPowerProfile power_profile)
gtk_label_set_markup (self->title_label, text); gtk_label_set_markup (self->title_label, text);
gtk_label_set_markup (self->subtitle_label, subtext); gtk_label_set_markup (self->subtitle_label, subtext);
gtk_image_set_from_icon_name (self->icon_image, icon_name, GTK_ICON_SIZE_MENU);
if (class_name != NULL)
gtk_style_context_add_class (gtk_widget_get_style_context (GTK_WIDGET (self->icon_image)), class_name);
return self; return self;
} }

View file

@ -28,19 +28,6 @@
<property name="height">2</property> <property name="height">2</property>
</packing> </packing>
</child> </child>
<child>
<object class="GtkImage" id="icon_image">
<property name="visible">True</property>
<property name="margin-end">6</property>
<style>
<class name="power-profile"/>
</style>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
</packing>
</child>
<child> <child>
<object class="GtkLabel" id="title_label"> <object class="GtkLabel" id="title_label">
<property name="visible">True</property> <property name="visible">True</property>
@ -53,7 +40,7 @@
<property name="margin-end">6</property> <property name="margin-end">6</property>
</object> </object>
<packing> <packing>
<property name="left_attach">2</property> <property name="left_attach">1</property>
<property name="top_attach">0</property> <property name="top_attach">0</property>
</packing> </packing>
</child> </child>