From 8f9a176183e00efb8605cc5603962bdc1b8c3221 Mon Sep 17 00:00:00 2001 From: daleclack Date: Sat, 30 Mar 2024 23:22:57 +0800 Subject: [PATCH] Replace title bar for Preferences --- Gtk4_Reset/src/ui/MyPrefs.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Gtk4_Reset/src/ui/MyPrefs.cpp b/Gtk4_Reset/src/ui/MyPrefs.cpp index 2594a34..3eaacc3 100644 --- a/Gtk4_Reset/src/ui/MyPrefs.cpp +++ b/Gtk4_Reset/src/ui/MyPrefs.cpp @@ -7,6 +7,7 @@ #include #include #include "../json_nlohmann/json.hpp" +#include "MyTitleBar.h" using json = nlohmann::json; typedef std::vector str_vec; @@ -14,6 +15,7 @@ typedef std::vector str_vec; struct _MyPrefs { GtkWindow parent_instance; + MyTitleBar *title_bar; GtkBuilder *prefs_builder; GtkWidget *background, *back_page; GtkWidget *stack_box, *combo_box; @@ -746,6 +748,8 @@ static void my_prefs_init(MyPrefs *self) my_prefs_load_config(self); // Initalize window + self->title_bar = my_titlebar_new(); + my_titlebar_set_window(self->title_bar, self); gtk_window_set_default_size(GTK_WINDOW(self), 800, 450); gtk_window_set_icon_name(GTK_WINDOW(self), "My_GtkUI"); gtk_window_set_title(GTK_WINDOW(self), "Preferences");