[gnome-software/wip/mcrha/gs-update-dialog-ui-title: 31/33] gs-app-details-page: Add read-only 'title' property
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software/wip/mcrha/gs-update-dialog-ui-title: 31/33] gs-app-details-page: Add read-only 'title' property
- Date: Tue, 2 Nov 2021 07:56:00 +0000 (UTC)
commit cabec3168560d55f701f8cb491717fa16b2c7ec1
Author: Milan Crha <mcrha redhat com>
Date: Tue Nov 2 08:48:15 2021 +0100
gs-app-details-page: Add read-only 'title' property
Reflects current window title, to be tight to the parent's window title.
src/gs-app-details-page.c | 20 +++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)
---
diff --git a/src/gs-app-details-page.c b/src/gs-app-details-page.c
index 938ccdd78..b2470eded 100644
--- a/src/gs-app-details-page.c
+++ b/src/gs-app-details-page.c
@@ -31,6 +31,7 @@
typedef enum {
PROP_APP = 1,
PROP_SHOW_BACK_BUTTON,
+ PROP_TITLE,
} GsAppDetailsPageProperty;
enum {
@@ -38,7 +39,7 @@ enum {
SIGNAL_LAST
};
-static GParamSpec *obj_props[PROP_SHOW_BACK_BUTTON + 1] = { NULL, };
+static GParamSpec *obj_props[PROP_TITLE + 1] = { NULL, };
static guint signals[SIGNAL_LAST] = { 0 };
@@ -147,6 +148,8 @@ set_updates_description_ui (GsAppDetailsPage *page, GsApp *app)
gs_app_get_update_version (app));
}
+ g_object_notify_by_pspec (G_OBJECT (page), obj_props[PROP_TITLE]);
+
/* set update header */
update_details = gs_app_get_update_details (app);
if (update_details == NULL) {
@@ -319,6 +322,9 @@ gs_app_details_page_get_property (GObject *object, guint prop_id, GValue *value,
case PROP_SHOW_BACK_BUTTON:
g_value_set_boolean (value, gs_app_details_page_get_show_back_button (page));
break;
+ case PROP_TITLE:
+ g_value_set_string (value, adw_window_title_get_title (page->window_title));
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -383,6 +389,18 @@ gs_app_details_page_class_init (GsAppDetailsPageClass *klass)
TRUE,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_EXPLICIT_NOTIFY);
+ /**
+ * GsAppDetailsPage:title
+ *
+ * Read-only window title.
+ *
+ * Since: 42
+ */
+ obj_props[PROP_TITLE] =
+ g_param_spec_string ("title", NULL, NULL,
+ NULL,
+ G_PARAM_READABLE | G_PARAM_STATIC_STRINGS | G_PARAM_EXPLICIT_NOTIFY);
+
g_object_class_install_properties (object_class, G_N_ELEMENTS (obj_props), obj_props);
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]