From 1d8ec008d303c5f350fcc9432c90d5c1d3189c93 Mon Sep 17 00:00:00 2001 From: yggverse Date: Tue, 17 Sep 2024 07:25:23 +0300 Subject: [PATCH] implement label title widget --- src/app/browser/main/tab/label/title.cpp | 22 +++++++++++++++++ src/app/browser/main/tab/label/title.hpp | 30 ++++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 src/app/browser/main/tab/label/title.cpp create mode 100644 src/app/browser/main/tab/label/title.hpp diff --git a/src/app/browser/main/tab/label/title.cpp b/src/app/browser/main/tab/label/title.cpp new file mode 100644 index 00000000..010e2a8a --- /dev/null +++ b/src/app/browser/main/tab/label/title.cpp @@ -0,0 +1,22 @@ +#include "title.hpp" + +using namespace app::browser::main::tab::label; + +Title::Title() +{ + set_text( + _("New page") + ); + + set_ellipsize( + Pango::EllipsizeMode::END + ); + + set_width_chars( + WIDTH_CHARS + ); + + set_single_line_mode( + true + ); +} \ No newline at end of file diff --git a/src/app/browser/main/tab/label/title.hpp b/src/app/browser/main/tab/label/title.hpp new file mode 100644 index 00000000..8f5d55ec --- /dev/null +++ b/src/app/browser/main/tab/label/title.hpp @@ -0,0 +1,30 @@ +#ifndef APP_BROWSER_MAIN_TAB_LABEL_NAME_HPP +#define APP_BROWSER_MAIN_TAB_LABEL_NAME_HPP + +#include +#include +#include +#include + +namespace app::browser::main::tab::label +{ + class Title : public Gtk::Label + { + /* + * Internal members + */ + private: + + // Defaults + static const int WIDTH_CHARS = 16; + + /* + * Class API + */ + public: + + Title(); + }; +} + +#endif // APP_BROWSER_MAIN_TAB_LABEL_NAME_HPP \ No newline at end of file