[gnome-control-center/gbsneto/applications-panel-cleanups: 6/19] applications: Make CcInfoRow subclass AdwActionRow
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center/gbsneto/applications-panel-cleanups: 6/19] applications: Make CcInfoRow subclass AdwActionRow
- Date: Thu, 20 Jan 2022 20:23:42 +0000 (UTC)
commit bcf6fab074f8db0f97808304f9d417a7d1453df2
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Thu Jan 20 13:09:39 2022 -0300
applications: Make CcInfoRow subclass AdwActionRow
Same case as previous commit
panels/applications/cc-applications-panel.ui | 1 -
panels/applications/cc-info-row.c | 30 +-----------------
panels/applications/cc-info-row.h | 4 +--
panels/applications/cc-info-row.ui | 46 ++++++++--------------------
4 files changed, 16 insertions(+), 65 deletions(-)
---
diff --git a/panels/applications/cc-applications-panel.ui b/panels/applications/cc-applications-panel.ui
index 984fc12dc..35b845600 100644
--- a/panels/applications/cc-applications-panel.ui
+++ b/panels/applications/cc-applications-panel.ui
@@ -435,7 +435,6 @@
<child>
<object class="CcInfoRow" id="total">
<property name="title" translatable="yes"><b>Total</b></property>
- <property name="use-markup">1</property>
<property name="info">Unknown</property>
</object>
</child>
diff --git a/panels/applications/cc-info-row.c b/panels/applications/cc-info-row.c
index e86b82e01..cb835df12 100644
--- a/panels/applications/cc-info-row.c
+++ b/panels/applications/cc-info-row.c
@@ -28,7 +28,6 @@ struct _CcInfoRow
{
GtkListBoxRow parent;
- GtkWidget *title;
GtkWidget *info;
GtkWidget *expander;
@@ -36,13 +35,11 @@ struct _CcInfoRow
gboolean link;
};
-G_DEFINE_TYPE (CcInfoRow, cc_info_row, GTK_TYPE_LIST_BOX_ROW)
+G_DEFINE_TYPE (CcInfoRow, cc_info_row, ADW_TYPE_ACTION_ROW)
enum
{
PROP_0,
- PROP_TITLE,
- PROP_USE_MARKUP,
PROP_INFO,
PROP_HAS_EXPANDER,
PROP_IS_LINK,
@@ -59,18 +56,12 @@ cc_info_row_get_property (GObject *object,
switch (prop_id)
{
- case PROP_TITLE:
- g_value_set_string (value, gtk_label_get_label (GTK_LABEL (row->title)));
- break;
case PROP_INFO:
g_value_set_string (value, gtk_label_get_label (GTK_LABEL (row->info)));
break;
case PROP_HAS_EXPANDER:
g_value_set_boolean (value, gtk_widget_get_visible (row->expander));
break;
- case PROP_USE_MARKUP:
- g_value_set_boolean (value, gtk_label_get_use_markup (GTK_LABEL (row->title)));
- break;
case PROP_IS_LINK:
g_value_set_boolean (value, row->link);
break;
@@ -104,10 +95,6 @@ cc_info_row_set_property (GObject *object,
switch (prop_id)
{
- case PROP_TITLE:
- gtk_label_set_label (GTK_LABEL (row->title), g_value_get_string (value));
- break;
-
case PROP_INFO:
gtk_label_set_label (GTK_LABEL (row->info), g_value_get_string (value));
break;
@@ -117,10 +104,6 @@ cc_info_row_set_property (GObject *object,
gtk_list_box_row_set_activatable (GTK_LIST_BOX_ROW (row), g_value_get_boolean (value));
break;
- case PROP_USE_MARKUP:
- gtk_label_set_use_markup (GTK_LABEL (row->title), g_value_get_boolean (value));
- break;
-
case PROP_IS_LINK:
row->link = g_value_get_boolean (value);
update_expander (row);
@@ -147,21 +130,11 @@ cc_info_row_class_init (CcInfoRowClass *klass)
gtk_widget_class_set_template_from_resource (widget_class,
"/org/gnome/control-center/applications/cc-info-row.ui");
- g_object_class_install_property (object_class,
- PROP_TITLE,
- g_param_spec_string ("title", "title", "title",
- NULL, G_PARAM_READWRITE));
-
g_object_class_install_property (object_class,
PROP_INFO,
g_param_spec_string ("info", "info", "info",
NULL, G_PARAM_READWRITE));
- g_object_class_install_property (object_class,
- PROP_USE_MARKUP,
- g_param_spec_boolean ("use-markup", "use-markup", "use-markup",
- FALSE, G_PARAM_READWRITE));
-
g_object_class_install_property (object_class,
PROP_HAS_EXPANDER,
g_param_spec_boolean ("has-expander", "has-expander", "has-expander",
@@ -177,7 +150,6 @@ cc_info_row_class_init (CcInfoRowClass *klass)
g_param_spec_boolean ("is-link", "is-link", "is-link",
FALSE, G_PARAM_READWRITE));
- gtk_widget_class_bind_template_child (widget_class, CcInfoRow, title);
gtk_widget_class_bind_template_child (widget_class, CcInfoRow, info);
gtk_widget_class_bind_template_child (widget_class, CcInfoRow, expander);
}
diff --git a/panels/applications/cc-info-row.h b/panels/applications/cc-info-row.h
index 57b9d4a9e..f1376dcd4 100644
--- a/panels/applications/cc-info-row.h
+++ b/panels/applications/cc-info-row.h
@@ -20,12 +20,12 @@
#pragma once
-#include <gtk/gtk.h>
+#include <adwaita.h>
G_BEGIN_DECLS
#define CC_TYPE_INFO_ROW (cc_info_row_get_type())
-G_DECLARE_FINAL_TYPE (CcInfoRow, cc_info_row, CC, INFO_ROW, GtkListBoxRow)
+G_DECLARE_FINAL_TYPE (CcInfoRow, cc_info_row, CC, INFO_ROW, AdwActionRow)
CcInfoRow* cc_info_row_new (void);
diff --git a/panels/applications/cc-info-row.ui b/panels/applications/cc-info-row.ui
index 341bcb3a7..d5c92155a 100644
--- a/panels/applications/cc-info-row.ui
+++ b/panels/applications/cc-info-row.ui
@@ -1,39 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
- <template class="CcInfoRow" parent="GtkListBoxRow">
- <property name="activatable">False</property>
+ <template class="CcInfoRow" parent="AdwActionRow">
<child>
- <object class="GtkBox">
- <property name="margin-top">12</property>
- <property name="margin-bottom">12</property>
- <property name="margin-start">12</property>
- <property name="margin-end">12</property>
- <property name="spacing">12</property>
- <child>
- <object class="GtkLabel" id="title">
- <property name="xalign">0</property>
- <property name="hexpand">1</property>
- <property name="ellipsize">end</property>
- </object>
- </child>
- <child>
- <object class="GtkLabel" id="info">
- <property name="valign">center</property>
- <style>
- <class name="dim-label"/>
- </style>
- </object>
- </child>
- <child>
- <object class="GtkImage" id="expander">
- <property name="visible">False</property>
- <property name="valign">center</property>
- <property name="icon-name">pan-end-symbolic</property>
- <style>
- <class name="dim-label"/>
- </style>
- </object>
- </child>
+ <object class="GtkLabel" id="info">
+ <property name="valign">center</property>
+ <style>
+ <class name="dim-label"/>
+ </style>
+ </object>
+ </child>
+ <child>
+ <object class="GtkImage" id="expander">
+ <property name="visible">False</property>
+ <property name="valign">center</property>
+ <property name="icon-name">pan-end-symbolic</property>
</object>
</child>
</template>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]