From a3d141173cae34d4c74bcefeaff66d1b6684cc7b Mon Sep 17 00:00:00 2001 From: daleclack Date: Sat, 30 Mar 2024 23:19:41 +0800 Subject: [PATCH] Replace title bar for Image App --- Gtk4_Reset/src/image_app/ImageApp.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Gtk4_Reset/src/image_app/ImageApp.cpp b/Gtk4_Reset/src/image_app/ImageApp.cpp index fa4fce4..4ab6130 100644 --- a/Gtk4_Reset/src/image_app/ImageApp.cpp +++ b/Gtk4_Reset/src/image_app/ImageApp.cpp @@ -1,10 +1,12 @@ #include "ImageApp.h" #include "MyImage.h" +#include "MyTitleBar.h" struct _ImageApp { GtkApplicationWindow parent_instance; // Child widgets + MyTitleBar *title_bar; GtkWidget *main_box, *btn_box; GtkWidget *image_sw; GtkWidget *image_scale, *btnopen; @@ -150,6 +152,8 @@ static void btnopen_clicked(GtkButton *btn, ImageApp *self) static void image_app_init(ImageApp *self) { // Initalize window + self->title_bar = my_titlebar_new(); + my_titlebar_set_window(self->title_bar, self); gtk_window_set_title(GTK_WINDOW(self), "Image Viewer"); gtk_window_set_default_size(GTK_WINDOW(self), 800, 450); gtk_window_set_icon_name(GTK_WINDOW(self), "image_app");