Browse Source

add viewport

CPP-GTK4
yggverse 3 months ago
parent
commit
f889f754c4
  1. 26
      src/app/browser/main/tab/page/content/text/plain.cpp
  2. 3
      src/app/browser/main/tab/page/content/text/plain.hpp

26
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( Plain::Plain(
const Glib::ustring & TEXT const Glib::ustring & TEXT
) : Gtk::Viewport( // add scrolled window features support
NULL,
NULL
) { ) {
set_valign( set_scroll_to_focus(
false
);
auto label = Gtk::make_managed<Gtk::Label>( // @TODO separated file?
TEXT
);
// Init widget
label->set_valign(
Gtk::Align::START Gtk::Align::START
); );
set_wrap( label->set_wrap(
true true
); );
set_selectable( label->set_selectable(
true true
); );
set_text( label->set_use_markup(
TEXT false
);
set_child(
* label
); );
} }

3
src/app/browser/main/tab/page/content/text/plain.hpp

@ -4,10 +4,11 @@
#include <glibmm/ustring.h> #include <glibmm/ustring.h>
#include <gtkmm/enums.h> #include <gtkmm/enums.h>
#include <gtkmm/label.h> #include <gtkmm/label.h>
#include <gtkmm/viewport.h>
namespace app::browser::main::tab::page::content::text namespace app::browser::main::tab::page::content::text
{ {
class Plain : public Gtk::Label class Plain : public Gtk::Viewport
{ {
public: public:

Loading…
Cancel
Save