summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWill Thompson <wjt@endlessos.org>2023-03-16 13:45:47 +0000
committerWill Thompson <wjt@endlessos.org>2023-03-16 13:45:47 +0000
commitc1d9e53880fac7069c0a60c4175aa0a353600e0e (patch)
treea6c961d0f78e2fc0f4956f490b31fb22c67bc91b
parent71df8e6e657c8a3cf93ff3f2337af6c320ea235c (diff)
parente7b7a1855e31e6916eaba925d7783064db930e58 (diff)
downloadgnome-initial-setup-c1d9e53880fac7069c0a60c4175aa0a353600e0e.tar.gz
Merge branch 'gbsneto/181' into 'master'
privacy: Move subtitles to separate labels Closes #181 See merge request GNOME/gnome-initial-setup!193
-rw-r--r--gnome-initial-setup/pages/privacy/gis-privacy-page.c35
-rw-r--r--gnome-initial-setup/pages/privacy/gis-privacy-page.ui31
2 files changed, 48 insertions, 18 deletions
diff --git a/gnome-initial-setup/pages/privacy/gis-privacy-page.c b/gnome-initial-setup/pages/privacy/gis-privacy-page.c
index 464d383..8c9f47e 100644
--- a/gnome-initial-setup/pages/privacy/gis-privacy-page.c
+++ b/gnome-initial-setup/pages/privacy/gis-privacy-page.c
@@ -42,7 +42,7 @@ struct _GisPrivacyPagePrivate
{
GtkWidget *location_switch;
GtkWidget *reporting_group;
- GtkWidget *reporting_row;
+ GtkWidget *reporting_label;
GtkWidget *reporting_switch;
GSettings *location_settings;
GSettings *privacy_settings;
@@ -82,7 +82,7 @@ update_os_data (GisPrivacyPage *page)
subtitle = g_strdup_printf (_("Sends technical reports that have personal information automatically "
"removed. Data is collected by %s."), name);
}
- adw_action_row_set_subtitle (ADW_ACTION_ROW (priv->reporting_row), subtitle);
+ gtk_label_set_markup (GTK_LABEL (priv->reporting_label), subtitle);
}
static void
@@ -94,7 +94,7 @@ abrt_appeared_cb (GDBusConnection *connection,
GisPrivacyPage *page = user_data;
GisPrivacyPagePrivate *priv = gis_privacy_page_get_instance_private (page);
- gtk_widget_show (priv->reporting_group);
+ gtk_widget_set_visible (priv->reporting_group, TRUE);
}
static void
@@ -105,7 +105,7 @@ abrt_vanished_cb (GDBusConnection *connection,
GisPrivacyPage *page = user_data;
GisPrivacyPagePrivate *priv = gis_privacy_page_get_instance_private (page);
- gtk_widget_hide (priv->reporting_group);
+ gtk_widget_set_visible (priv->reporting_group, FALSE);
}
static void
@@ -179,11 +179,7 @@ notify_progress_cb (GObject *object, GParamSpec *pspec, gpointer user_data)
progress = webkit_web_view_get_estimated_load_progress (web_view);
- if (progress == 1.0)
- gtk_widget_hide (progress_bar);
- else
- gtk_widget_show (progress_bar);
-
+ gtk_widget_set_visible (progress_bar, progress != 1.0);
gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (progress_bar), progress);
}
@@ -192,20 +188,25 @@ activate_link (GtkLabel *label,
const gchar *uri,
GisPrivacyPage *page)
{
+ GtkWidget *headerbar;
GtkWidget *dialog;
GtkWidget *overlay;
GtkWidget *view;
GtkWidget *progress_bar;
- dialog = gtk_dialog_new_with_buttons (_("Privacy Policy"),
- GTK_WINDOW (gtk_widget_get_root (GTK_WIDGET (page))),
- GTK_DIALOG_MODAL
- | GTK_DIALOG_DESTROY_WITH_PARENT
- | GTK_DIALOG_USE_HEADER_BAR,
- NULL, NULL);
+ headerbar = gtk_header_bar_new ();
+ gtk_header_bar_set_show_title_buttons (GTK_HEADER_BAR (headerbar), TRUE);
+
+ dialog = g_object_new (GTK_TYPE_WINDOW,
+ "destroy-with-parent", TRUE,
+ "transient-for", gtk_widget_get_root (GTK_WIDGET (page)),
+ "titlebar", headerbar,
+ "title", _("Privacy Policy"),
+ "modal", TRUE,
+ NULL);
overlay = gtk_overlay_new ();
- gtk_box_append (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), overlay);
+ gtk_window_set_child (GTK_WINDOW (dialog), overlay);
progress_bar = gtk_progress_bar_new ();
gtk_widget_add_css_class (progress_bar, "osd");
@@ -244,7 +245,7 @@ gis_privacy_page_class_init (GisPrivacyPageClass *klass)
gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/org/gnome/initial-setup/gis-privacy-page.ui");
gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (klass), GisPrivacyPage, location_switch);
gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (klass), GisPrivacyPage, reporting_group);
- gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (klass), GisPrivacyPage, reporting_row);
+ gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (klass), GisPrivacyPage, reporting_label);
gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (klass), GisPrivacyPage, reporting_switch);
gtk_widget_class_bind_template_callback (GTK_WIDGET_CLASS (klass), activate_link);
diff --git a/gnome-initial-setup/pages/privacy/gis-privacy-page.ui b/gnome-initial-setup/pages/privacy/gis-privacy-page.ui
index 84ea8e3..6c48d5f 100644
--- a/gnome-initial-setup/pages/privacy/gis-privacy-page.ui
+++ b/gnome-initial-setup/pages/privacy/gis-privacy-page.ui
@@ -25,7 +25,6 @@
<object class="AdwActionRow">
<property name="use-markup">True</property>
<property name="title" translatable="yes">Location Services</property>
- <property name="subtitle" translatable="yes">Allows applications to determine your geographical location. Uses the Mozilla Location Service (&lt;a href='https://location.services.mozilla.com/privacy'&gt;privacy policy&lt;/a&gt;).</property>
<property name="activatable-widget">location_switch</property>
<child>
<object class="GtkSwitch" id="location_switch">
@@ -34,11 +33,27 @@
</child>
</object>
</child>
+ <child>
+ <object class="GtkLabel">
+ <property name="margin-top">12</property>
+ <property name="wrap">True</property>
+ <property name="wrap-mode">word-char</property>
+ <property name="use-markup">True</property>
+ <property name="ellipsize">none</property>
+ <property name="xalign">0.0</property>
+ <property name="label" translatable="yes">Allows applications to determine your geographical location. Uses the Mozilla Location Service (&lt;a href='https://location.services.mozilla.com/privacy'&gt;privacy policy&lt;/a&gt;).</property>
+ <signal name="activate-link" handler="activate_link" object="GisPrivacyPage" swapped="no" />
+ <style>
+ <class name="caption" />
+ </style>
+ </object>
+ </child>
</object>
</child>
<child>
<object class="AdwPreferencesGroup" id="reporting_group">
+ <property name="margin-top">12</property>
<child>
<object class="AdwActionRow" id="reporting_row">
<property name="title" translatable="yes">Automatic Problem Reporting</property>
@@ -50,6 +65,20 @@
</child>
</object>
</child>
+ <child>
+ <object class="GtkLabel" id="reporting_label">
+ <property name="margin-top">12</property>
+ <property name="wrap">True</property>
+ <property name="wrap-mode">word-char</property>
+ <property name="use-markup">True</property>
+ <property name="ellipsize">none</property>
+ <property name="xalign">0.0</property>
+ <signal name="activate-link" handler="activate_link" object="GisPrivacyPage" swapped="no" />
+ <style>
+ <class name="caption" />
+ </style>
+ </object>
+ </child>
</object>
</child>