[nautilus/wip/cdavis/hdywindow] properties-window: Use HdyWindow
- From: Christopher Davis <christopherdavis src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus/wip/cdavis/hdywindow] properties-window: Use HdyWindow
- Date: Sat, 6 Feb 2021 23:49:04 +0000 (UTC)
commit 362d993e7818d84686a397fac0bd5d0b8991a911
Author: Christopher Davis <brainblasted disroot org>
Date: Sat Feb 6 15:48:44 2021 -0800
properties-window: Use HdyWindow
src/nautilus-properties-window.c | 7 +++++--
src/nautilus-properties-window.h | 3 ++-
src/resources/ui/nautilus-properties-window.ui | 20 +++++++++++---------
3 files changed, 18 insertions(+), 12 deletions(-)
---
diff --git a/src/nautilus-properties-window.c b/src/nautilus-properties-window.c
index d21d6a56c..a5b1a8ca5 100644
--- a/src/nautilus-properties-window.c
+++ b/src/nautilus-properties-window.c
@@ -74,11 +74,12 @@ typedef struct
struct _NautilusPropertiesWindow
{
- GtkWindow parent_instance;
+ HdyWindow parent_instance;
GList *original_files;
GList *target_files;
+ HdyHeaderBar *titlebar;
GtkNotebook *notebook;
/* Basic tab widgets */
@@ -315,7 +316,7 @@ static void name_field_activate (GtkWidget *name_field,
gpointer user_data);
static void setup_pie_widget (NautilusPropertiesWindow *self);
-G_DEFINE_TYPE (NautilusPropertiesWindow, nautilus_properties_window, GTK_TYPE_WINDOW);
+G_DEFINE_TYPE (NautilusPropertiesWindow, nautilus_properties_window, HDY_TYPE_WINDOW);
static gboolean
is_multi_file_window (NautilusPropertiesWindow *self)
@@ -912,6 +913,7 @@ update_properties_window_title (NautilusPropertiesWindow *self)
}
gtk_window_set_title (GTK_WINDOW (self), title);
+ hdy_header_bar_set_title (HDY_HEADER_BAR (self->titlebar), title);
}
static void
@@ -5387,6 +5389,7 @@ nautilus_properties_window_class_init (NautilusPropertiesWindowClass *klass)
gtk_widget_class_set_template_from_resource (widget_class,
"/org/gnome/nautilus/ui/nautilus-properties-window.ui");
+ gtk_widget_class_bind_template_child (widget_class, NautilusPropertiesWindow, titlebar);
gtk_widget_class_bind_template_child (widget_class, NautilusPropertiesWindow, notebook);
gtk_widget_class_bind_template_child (widget_class, NautilusPropertiesWindow, icon_stack);
gtk_widget_class_bind_template_child (widget_class, NautilusPropertiesWindow, icon_image);
diff --git a/src/nautilus-properties-window.h b/src/nautilus-properties-window.h
index c1b44a103..84f8166a9 100644
--- a/src/nautilus-properties-window.h
+++ b/src/nautilus-properties-window.h
@@ -24,12 +24,13 @@
#pragma once
#include <gtk/gtk.h>
+#include <libhandy-1/handy.h>
#define NAUTILUS_TYPE_PROPERTIES_WINDOW (nautilus_properties_window_get_type ())
G_DECLARE_FINAL_TYPE (NautilusPropertiesWindow, nautilus_properties_window,
NAUTILUS, PROPERTIES_WINDOW,
- GtkWindow)
+ HdyWindow)
typedef void (* NautilusPropertiesWindowCallback) (gpointer callback_data);
diff --git a/src/resources/ui/nautilus-properties-window.ui b/src/resources/ui/nautilus-properties-window.ui
index 23916f5a2..acf5b2861 100644
--- a/src/resources/ui/nautilus-properties-window.ui
+++ b/src/resources/ui/nautilus-properties-window.ui
@@ -2,7 +2,7 @@
<!-- Generated with glade 3.36.0 -->
<interface>
<requires lib="gtk+" version="3.20"/>
- <template class="NautilusPropertiesWindow" parent="GtkWindow">
+ <template class="NautilusPropertiesWindow" parent="HdyWindow">
<property name="can_focus">False</property>
<property name="modal">True</property>
<property name="type_hint">dialog</property>
@@ -10,11 +10,21 @@
<object class="GtkBox" id="content_box">
<property name="visible">True</property>
<property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <object class="HdyHeaderBar" id="titlebar">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="show_close_button">True</property>
+ </object>
+ </child>
<child>
<object class="GtkNotebook" id="notebook">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="show_border">False</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
<child>
<object class="GtkBox" id="basic_box">
<property name="visible">True</property>
@@ -1390,19 +1400,11 @@
<placeholder/>
</child>
</object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
</child>
<style>
<class name="view"/>
</style>
</object>
</child>
- <child type="titlebar">
- <placeholder/>
- </child>
</template>
</interface>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]