From 00920d39a9da09a717b9b53c4ffd737cad553af6 Mon Sep 17 00:00:00 2001 From: yggverse Date: Tue, 6 Aug 2024 09:31:57 +0300 Subject: [PATCH] update header bar structure --- Makefile | 1 - src/app/browser/header.cpp | 2 +- src/app/browser/header/bar.cpp | 14 ------------ src/app/browser/header/bar.h | 4 ---- src/app/browser/header/bar/title.cpp | 24 -------------------- src/app/browser/header/bar/title.h | 33 ---------------------------- 6 files changed, 1 insertion(+), 77 deletions(-) delete mode 100644 src/app/browser/header/bar/title.cpp delete mode 100644 src/app/browser/header/bar/title.h diff --git a/Makefile b/Makefile index cdf22534..739d1a38 100644 --- a/Makefile +++ b/Makefile @@ -12,7 +12,6 @@ SRCS = src/main.cpp\ src/app/browser/container/tab.cpp\ src/app/browser/header.cpp\ src/app/browser/header/bar.cpp\ - src/app/browser/header/bar/title.cpp\ src/app/browser/header/bar/menu.cpp\ src/app/browser/header/bar/menu/main.cpp\ src/app/browser/header/bar/menu/main/debug.cpp\ diff --git a/src/app/browser/header.cpp b/src/app/browser/header.cpp index 7d1d535c..13431d41 100644 --- a/src/app/browser/header.cpp +++ b/src/app/browser/header.cpp @@ -22,7 +22,7 @@ namespace app ); // Init title widget - gtk_header_bar_set_title_widget( + gtk_header_bar_pack_start( GTK_HEADER_BAR( this->gtk ), diff --git a/src/app/browser/header/bar.cpp b/src/app/browser/header/bar.cpp index 5fd32baf..df00de30 100644 --- a/src/app/browser/header/bar.cpp +++ b/src/app/browser/header/bar.cpp @@ -33,20 +33,6 @@ namespace app ) ); - // Init title - this->title = new bar::Title( - this - ); - - gtk_box_append( - GTK_BOX( - this->gtk - ), - GTK_WIDGET( - this->title->gtk - ) - ); - // Render gtk_widget_show( GTK_WIDGET( diff --git a/src/app/browser/header/bar.h b/src/app/browser/header/bar.h index dce12fcc..bf857e18 100644 --- a/src/app/browser/header/bar.h +++ b/src/app/browser/header/bar.h @@ -6,7 +6,6 @@ // Requirements #include "bar/menu.h" -#include "bar/title.h" namespace app::browser { @@ -17,8 +16,6 @@ namespace app::browser namespace bar { class Menu; - - class Title; }; class Bar @@ -36,7 +33,6 @@ namespace app::browser // Requirements bar::Menu *menu; - bar::Title *title; Bar( Header *header diff --git a/src/app/browser/header/bar/title.cpp b/src/app/browser/header/bar/title.cpp deleted file mode 100644 index 9aef395a..00000000 --- a/src/app/browser/header/bar/title.cpp +++ /dev/null @@ -1,24 +0,0 @@ -#include "title.h" - -namespace app::browser::header::bar -{ - // Construct - Title::Title( - Bar *bar - ) { - // Init dependencies - this->bar = bar; - - // Init GTK - this->gtk = gtk_label_new( - Title::LABEL - ); - - // Render - gtk_widget_show( - GTK_WIDGET( - this->gtk - ) - ); - } -} \ No newline at end of file diff --git a/src/app/browser/header/bar/title.h b/src/app/browser/header/bar/title.h deleted file mode 100644 index bb97c1a2..00000000 --- a/src/app/browser/header/bar/title.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef APP_BROWSER_HEADER_BAR_TITLE_H -#define APP_BROWSER_HEADER_BAR_TITLE_H - -// Dependencies -#include "../bar.h" - -namespace app::browser::header -{ - class Bar; - - namespace bar - { - class Title - { - public: - - // GTK - GtkWidget *gtk; - - // Defaults - const char* LABEL = "Yoda"; - - // Dependencies - Bar *bar; - - Title( - Bar *bar - ); - }; - }; -}; - -#endif \ No newline at end of file