From 8fd7e1eec1bc9a8f4a52f71442745b068e30428a Mon Sep 17 00:00:00 2001 From: yggverse Date: Tue, 6 Aug 2024 07:41:40 +0300 Subject: [PATCH] fix init browser container --- src/app/browser.cpp | 16 +++++++++++++++- src/app/browser.h | 3 +++ src/app/browser/container.cpp | 17 +++++++++-------- 3 files changed, 27 insertions(+), 9 deletions(-) diff --git a/src/app/browser.cpp b/src/app/browser.cpp index 788481a5..d47499d4 100644 --- a/src/app/browser.cpp +++ b/src/app/browser.cpp @@ -24,7 +24,7 @@ namespace app Browser::HEIGHT ); - // Init components + // Init header this->header = new browser::Header( this ); @@ -38,6 +38,20 @@ namespace app ) ); + // Init container + this->container = new browser::Container( + this + ); + + gtk_window_set_child( + GTK_WINDOW( + this->gtk + ), + GTK_WIDGET( + this->container->gtk + ) + ); + // Render gtk_widget_show( GTK_WIDGET( diff --git a/src/app/browser.h b/src/app/browser.h index b643347f..92b3d1e5 100644 --- a/src/app/browser.h +++ b/src/app/browser.h @@ -6,12 +6,14 @@ // Requirements #include "browser/header.h" +#include "browser/container.h" namespace app { namespace browser { class Header; + class Container; } class Browser @@ -26,6 +28,7 @@ namespace app // Requirements browser::Header *header; + browser::Container *container; // Defaults const guint WIDTH = 640; diff --git a/src/app/browser/container.cpp b/src/app/browser/container.cpp index b6a01076..a4715f02 100644 --- a/src/app/browser/container.cpp +++ b/src/app/browser/container.cpp @@ -14,13 +14,7 @@ namespace app Container::SPACING ); - gtk_widget_show( - GTK_WIDGET( - this->gtk - ) - ); - - // Init tab + // Init tabs component this->tab = new container::Tab( this ); @@ -30,7 +24,14 @@ namespace app this->gtk ), GTK_WIDGET( - this->tab + this->tab->gtk + ) + ); + + // Render + gtk_widget_show( + GTK_WIDGET( + this->gtk ) ); }