From f889f754c479171b07130b9c360f364a2acf6efe Mon Sep 17 00:00:00 2001 From: yggverse Date: Fri, 13 Sep 2024 12:46:04 +0300 Subject: [PATCH] add viewport --- .../main/tab/page/content/text/plain.cpp | 34 ++++++++++++++----- .../main/tab/page/content/text/plain.hpp | 3 +- 2 files changed, 27 insertions(+), 10 deletions(-) diff --git a/src/app/browser/main/tab/page/content/text/plain.cpp b/src/app/browser/main/tab/page/content/text/plain.cpp index 6042e65..64b9c70 100644 --- a/src/app/browser/main/tab/page/content/text/plain.cpp +++ b/src/app/browser/main/tab/page/content/text/plain.cpp @@ -4,20 +4,36 @@ using namespace app::browser::main::tab::page::content::text; Plain::Plain( const Glib::ustring & TEXT +) : Gtk::Viewport( // add scrolled window features support + NULL, + NULL ) { - set_valign( - Gtk::Align::START + set_scroll_to_focus( + false ); - set_wrap( - true + auto label = Gtk::make_managed( // @TODO separated file? + TEXT ); - set_selectable( - true - ); + // Init widget + label->set_valign( + Gtk::Align::START + ); - set_text( - TEXT + label->set_wrap( + true + ); + + label->set_selectable( + true + ); + + label->set_use_markup( + false + ); + + set_child( + * label ); } \ No newline at end of file diff --git a/src/app/browser/main/tab/page/content/text/plain.hpp b/src/app/browser/main/tab/page/content/text/plain.hpp index 770c714..c39f7df 100644 --- a/src/app/browser/main/tab/page/content/text/plain.hpp +++ b/src/app/browser/main/tab/page/content/text/plain.hpp @@ -4,10 +4,11 @@ #include #include #include +#include namespace app::browser::main::tab::page::content::text { - class Plain : public Gtk::Label + class Plain : public Gtk::Viewport { public: