update viewport level, make managed

This commit is contained in:
yggverse 2024-09-13 12:31:14 +03:00
parent 3ce19b8160
commit b71eec6944
4 changed files with 31 additions and 62 deletions

View file

@ -4,25 +4,36 @@ using namespace app::browser::main::tab::page::content::text;
Gemini::Gemini(
const Glib::ustring & GEMTEXT
) : Gtk::Viewport( // add scrolled window features support
NULL,
NULL
) {
// Init widget
set_valign(
Gtk::Align::START
set_scroll_to_focus(
false
);
set_wrap(
true
auto label = Gtk::make_managed<Gtk::Label>( // @TODO separated file?
GEMTEXT
);
set_selectable(
true
);
// Init widget
label->set_valign(
Gtk::Align::START
);
set_use_markup(
true
);
label->set_wrap(
true
);
set_markup(
GEMTEXT//markup
label->set_selectable(
true
);
label->set_use_markup(
true
);
set_child(
* label
);
}

View file

@ -4,13 +4,12 @@
#include <glibmm/regex.h>
#include <glibmm/ustring.h>
#include <gtkmm/label.h>
#include <gtkmm/viewport.h>
namespace app::browser::main::tab::page::content::text
{
class Gemini : public Gtk::Label
class Gemini : public Gtk::Viewport
{
Glib::ustring markup;
public:
Gemini(