draft text container

This commit is contained in:
yggverse 2024-09-12 08:17:17 +03:00
parent 3bfacf7ea9
commit bbc1046c2a
10 changed files with 72 additions and 20 deletions

View file

@ -0,0 +1,26 @@
#include "text.hpp"
#include "text/gemini.hpp"
#include "text/plain.hpp"
using namespace app::browser::main::tab::page::content;
Text::Text()
{
// @TODO GtkViewport?
}
void Text::set_gemini(
const Glib::ustring & GEMTEXT
) {
set_child(
* new text::Gemini( // @TODO manage
GEMTEXT
)
);
}
void Text::set_plain(
const Glib::ustring & TEXT
) {
// @TODO
}

View file

@ -0,0 +1,25 @@
#ifndef APP_BROWSER_MAIN_TAB_PAGE_CONTENT_TEXT_HPP
#define APP_BROWSER_MAIN_TAB_PAGE_CONTENT_TEXT_HPP
#include <glibmm/ustring.h>
#include <gtkmm/scrolledwindow.h>
namespace app::browser::main::tab::page::content
{
class Text : public Gtk::ScrolledWindow
{
public:
Text();
void set_gemini(
const Glib::ustring & GEMTEXT
);
void set_plain(
const Glib::ustring & TEXT
);
};
}
#endif // APP_BROWSER_MAIN_TAB_PAGE_CONTENT_TEXT_HPP

View file

@ -3,7 +3,7 @@
using namespace app::browser::main::tab::page::content::text;
Gemini::Gemini(
const Glib::ustring & gemtext
const Glib::ustring & GEMTEXT
) {
set_wrap(
true
@ -14,6 +14,6 @@ Gemini::Gemini(
);
set_markup(
gemtext // @TODO
GEMTEXT // @TODO
);
}

View file

@ -11,7 +11,7 @@ namespace app::browser::main::tab::page::content::text
public:
Gemini(
const Glib::ustring & gemtext
const Glib::ustring & GEMTEXT
);
};
}

View file

@ -3,7 +3,7 @@
using namespace app::browser::main::tab::page::content::text;
Plain::Plain(
const Glib::ustring & text
const Glib::ustring & TEXT
) {
set_wrap(
true
@ -14,6 +14,6 @@ Plain::Plain(
);
set_text(
text
TEXT
);
}

View file

@ -11,7 +11,7 @@ namespace app::browser::main::tab::page::content::text
public:
Plain(
const Glib::ustring & text
const Glib::ustring & TEXT
);
};
}