mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 00:55:28 +00:00
55 lines
No EOL
766 B
C++
55 lines
No EOL
766 B
C++
#include "content.hpp"
|
|
#include "content/text/gemini.hpp"
|
|
|
|
using namespace app::browser::main::tab::page;
|
|
|
|
Content::Content()
|
|
{
|
|
set_orientation(
|
|
Gtk::Orientation::VERTICAL
|
|
);
|
|
|
|
set_homogeneous(
|
|
true
|
|
);
|
|
|
|
widget = nullptr;
|
|
}
|
|
|
|
Content::~Content()
|
|
{
|
|
delete widget;
|
|
};
|
|
|
|
// Public actions
|
|
void Content::text_gemini(
|
|
const Glib::ustring & gemtext
|
|
) {
|
|
update(
|
|
new content::text::Gemini(
|
|
gemtext
|
|
)
|
|
);
|
|
}
|
|
|
|
// @TODO text_plain, picture, video, etc.
|
|
|
|
// Private helpers
|
|
void Content::update(
|
|
Gtk::Widget * new_widget
|
|
) {
|
|
if (widget != nullptr)
|
|
{
|
|
remove(
|
|
* widget
|
|
);
|
|
|
|
delete widget;
|
|
}
|
|
|
|
widget = new_widget;
|
|
|
|
append(
|
|
* widget
|
|
);
|
|
} |