[nautilus/wip/cdavis/hdywindow: 2/4] window: Make bottom corners rounded
- From: António Fernandes <antoniof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus/wip/cdavis/hdywindow: 2/4] window: Make bottom corners rounded
- Date: Tue, 9 Feb 2021 00:45:28 +0000 (UTC)
commit 212e06649936a707077dff867456af42add7d493
Author: Christopher Davis <brainblasted disroot org>
Date: Thu Feb 4 01:32:44 2021 -0800
window: Make bottom corners rounded
CSS alone is not enough to achieve the desired result. The required
pieces are provided by HdyApplicationWindow.
src/nautilus-toolbar.c | 2 +-
src/nautilus-toolbar.h | 3 ++-
src/nautilus-window.c | 4 ++--
src/nautilus-window.h | 3 ++-
src/resources/ui/nautilus-toolbar.ui | 2 +-
src/resources/ui/nautilus-window.ui | 11 ++++++-----
6 files changed, 14 insertions(+), 11 deletions(-)
---
diff --git a/src/nautilus-toolbar.c b/src/nautilus-toolbar.c
index 89ebac72f..31b67bb2f 100644
--- a/src/nautilus-toolbar.c
+++ b/src/nautilus-toolbar.c
@@ -128,7 +128,7 @@ enum
static GParamSpec *properties[NUM_PROPERTIES] = { NULL, };
-G_DEFINE_TYPE (NautilusToolbar, nautilus_toolbar, GTK_TYPE_HEADER_BAR);
+G_DEFINE_TYPE (NautilusToolbar, nautilus_toolbar, HDY_TYPE_HEADER_BAR);
static void nautilus_toolbar_set_window_slot_real (NautilusToolbar *self,
NautilusWindowSlot *slot);
diff --git a/src/nautilus-toolbar.h b/src/nautilus-toolbar.h
index 13f00721e..364bc76d8 100644
--- a/src/nautilus-toolbar.h
+++ b/src/nautilus-toolbar.h
@@ -24,6 +24,7 @@
#pragma once
#include <gtk/gtk.h>
+#include <libhandy-1/handy.h>
#include "nautilus-window-slot.h"
@@ -31,7 +32,7 @@ G_BEGIN_DECLS
#define NAUTILUS_TYPE_TOOLBAR nautilus_toolbar_get_type()
-G_DECLARE_FINAL_TYPE (NautilusToolbar, nautilus_toolbar, NAUTILUS, TOOLBAR, GtkHeaderBar)
+G_DECLARE_FINAL_TYPE (NautilusToolbar, nautilus_toolbar, NAUTILUS, TOOLBAR, HdyHeaderBar)
GtkWidget *nautilus_toolbar_new (void);
diff --git a/src/nautilus-window.c b/src/nautilus-window.c
index 4be36ebbf..c21042b41 100644
--- a/src/nautilus-window.c
+++ b/src/nautilus-window.c
@@ -98,7 +98,7 @@ static void close_slot (NautilusWindow *window,
struct _NautilusWindow
{
- GtkApplicationWindow parent_instance;
+ HdyApplicationWindow parent_instance;
GtkWidget *notebook;
@@ -164,7 +164,7 @@ enum
static guint signals[LAST_SIGNAL] = { 0 };
-G_DEFINE_TYPE (NautilusWindow, nautilus_window, GTK_TYPE_APPLICATION_WINDOW);
+G_DEFINE_TYPE (NautilusWindow, nautilus_window, HDY_TYPE_APPLICATION_WINDOW);
static const struct
{
diff --git a/src/nautilus-window.h b/src/nautilus-window.h
index ac8833a20..27ebbb247 100644
--- a/src/nautilus-window.h
+++ b/src/nautilus-window.h
@@ -27,13 +27,14 @@
#pragma once
#include <gtk/gtk.h>
+#include <libhandy-1/handy.h>
#include "nautilus-types.h"
G_BEGIN_DECLS
#define NAUTILUS_TYPE_WINDOW (nautilus_window_get_type ())
-G_DECLARE_FINAL_TYPE (NautilusWindow, nautilus_window, NAUTILUS, WINDOW, GtkApplicationWindow);
+G_DECLARE_FINAL_TYPE (NautilusWindow, nautilus_window, NAUTILUS, WINDOW, HdyApplicationWindow);
typedef gboolean (* NautilusWindowGoToCallback) (NautilusWindow *window,
GFile *location,
diff --git a/src/resources/ui/nautilus-toolbar.ui b/src/resources/ui/nautilus-toolbar.ui
index 51a882838..4bf6e3621 100644
--- a/src/resources/ui/nautilus-toolbar.ui
+++ b/src/resources/ui/nautilus-toolbar.ui
@@ -477,7 +477,7 @@
</object>
</child>
</object>
- <template class="NautilusToolbar" parent="GtkHeaderBar">
+ <template class="NautilusToolbar" parent="HdyHeaderBar">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="show_close_button">True</property>
diff --git a/src/resources/ui/nautilus-window.ui b/src/resources/ui/nautilus-window.ui
index 8ce69c64f..e554696ca 100644
--- a/src/resources/ui/nautilus-window.ui
+++ b/src/resources/ui/nautilus-window.ui
@@ -1,14 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
- <template class="NautilusWindow" parent="GtkApplicationWindow">
+ <template class="NautilusWindow" parent="HdyApplicationWindow">
<property name="show-menubar">False</property>
<property name="title" translatable="yes">_Files</property>
- <child type="titlebar">
- <object class="NautilusToolbar" id="toolbar"/>
- </child>
<child>
- <object class="GtkGrid">
+ <object class="GtkBox">
<property name="visible">True</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <object class="NautilusToolbar" id="toolbar"/>
+ </child>
<child>
<object class="GtkPaned" id="content_paned">
<property name="visible">True</property>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]