From 7c5c72a43f6dfe68b37767efbb9835211d096106 Mon Sep 17 00:00:00 2001 From: yggverse Date: Sun, 4 Aug 2024 23:31:59 +0300 Subject: [PATCH] init header class --- src/Yoda/Browser/Header.cpp | 21 +++++++++++++++++++++ src/Yoda/Browser/Header.h | 30 ++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 src/Yoda/Browser/Header.cpp create mode 100644 src/Yoda/Browser/Header.h diff --git a/src/Yoda/Browser/Header.cpp b/src/Yoda/Browser/Header.cpp new file mode 100644 index 00000000..6283b2ae --- /dev/null +++ b/src/Yoda/Browser/Header.cpp @@ -0,0 +1,21 @@ +#include "Header.h" + +YodaBrowser::Header::Header( + Yoda::Browser *browser +) { + // Init GTK + this->gtk = gtk_header_bar_new(); + + gtk_header_bar_set_show_title_buttons( + GTK_HEADER_BAR( + this->gtk + ), + Header::SHOW_TITLE_BUTTONS + ); + + gtk_widget_show( + GTK_WIDGET( + this->gtk + ) + ); +} \ No newline at end of file diff --git a/src/Yoda/Browser/Header.h b/src/Yoda/Browser/Header.h new file mode 100644 index 00000000..8b32cb88 --- /dev/null +++ b/src/Yoda/Browser/Header.h @@ -0,0 +1,30 @@ +#ifndef YODA_BROWSER_HEADER_H +#define YODA_BROWSER_HEADER_H + +#include "../../main.h" + +#include "../Browser.h" + +namespace YodaBrowser +{ + class Header + { + public: + + // GTK + GtkWidget *gtk; + + // Dependencies + Yoda::Browser *browser; + + // Defaults + const gboolean SHOW_TITLE_BUTTONS = true; + + // Construct + Header( + Yoda::Browser *browser + ); + }; +}; + +#endif \ No newline at end of file