[nautilus/wip/coreyberla/app-picker-followups: 4/4] app-chooser: Add a description above the list
- From: Corey Berla <coreyberla src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus/wip/coreyberla/app-picker-followups: 4/4] app-chooser: Add a description above the list
- Date: Sat, 6 Aug 2022 03:56:24 +0000 (UTC)
commit fc485b903b8e1fc58d13c6ce9000eabf849b8119
Author: Corey Berla <corey berla me>
Date: Fri Aug 5 13:16:49 2022 -0700
app-chooser: Add a description above the list
src/nautilus-app-chooser.c | 9 +++++++++
src/resources/ui/nautilus-app-chooser.ui | 7 +++++++
2 files changed, 16 insertions(+)
---
diff --git a/src/nautilus-app-chooser.c b/src/nautilus-app-chooser.c
index 267cf06d6..2470be446 100644
--- a/src/nautilus-app-chooser.c
+++ b/src/nautilus-app-chooser.c
@@ -21,6 +21,7 @@ struct _NautilusAppChooser
gboolean single_content_type;
GtkWidget *app_chooser_widget_box;
+ GtkWidget *label_description;
GtkWidget *label_content_type_description;
GtkWidget *set_as_default_switch;
GtkWidget *set_default_box;
@@ -148,6 +149,7 @@ nautilus_app_chooser_constructed (GObject *object)
NautilusAppChooser *self = NAUTILUS_APP_CHOOSER (object);
g_autoptr (GAppInfo) info = NULL;
g_autofree gchar *content_type_description = NULL;
+ g_autofree gchar *description = NULL;
gchar *title;
G_OBJECT_CLASS (nautilus_app_chooser_parent_class)->constructed (object);
@@ -177,6 +179,12 @@ nautilus_app_chooser_constructed (GObject *object)
G_CALLBACK (on_application_selected),
self);
+ if (self->file_name != NULL)
+ {
+ description = g_strdup_printf (_("Choose an application to open <b>%s</b>."), self->file_name);
+ gtk_label_set_markup (GTK_LABEL (self->label_description), description);
+ }
+
if (!self->single_content_type)
{
title = _("Open Items");
@@ -229,6 +237,7 @@ nautilus_app_chooser_class_init (NautilusAppChooserClass *klass)
gtk_widget_class_bind_template_child (widget_class, NautilusAppChooser, app_chooser_widget_box);
gtk_widget_class_bind_template_child (widget_class, NautilusAppChooser, set_as_default_switch);
+ gtk_widget_class_bind_template_child (widget_class, NautilusAppChooser, label_description);
gtk_widget_class_bind_template_child (widget_class, NautilusAppChooser, label_content_type_description);
gtk_widget_class_bind_template_child (widget_class, NautilusAppChooser, set_default_box);
diff --git a/src/resources/ui/nautilus-app-chooser.ui b/src/resources/ui/nautilus-app-chooser.ui
index 56353ba13..d5d70e711 100644
--- a/src/resources/ui/nautilus-app-chooser.ui
+++ b/src/resources/ui/nautilus-app-chooser.ui
@@ -11,6 +11,13 @@
<child internal-child="content_area">
<object class="GtkBox" id="content_area">
<property name="orientation">vertical</property>
+ <child>
+ <object class="GtkLabel" id="label_description">
+ <property name="margin-top">12</property>
+ <property name="margin-bottom">12</property>
+ <property name="label" translatable="yes">Choose an application to open the selected
files.</property>
+ </object>
+ </child>
<child>
<object class="GtkStack">
<property name="hexpand">True</property>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]