Browse Source

implement gemini source view widget

CPP-GTK4
yggverse 2 months ago
parent
commit
90c9c36ebf
  1. 1
      Makefile
  2. 1
      po/POTFILES.in
  3. 32
      src/app/browser/main/tab/page/content/text/gemini/source.cpp
  4. 24
      src/app/browser/main/tab/page/content/text/gemini/source.hpp

1
Makefile

@ -20,6 +20,7 @@ SRCS = src/app.cpp\
src/app/browser/main/tab/page/content/text.cpp\ src/app/browser/main/tab/page/content/text.cpp\
src/app/browser/main/tab/page/content/text/gemini.cpp\ src/app/browser/main/tab/page/content/text/gemini.cpp\
src/app/browser/main/tab/page/content/text/gemini/reader.cpp\ src/app/browser/main/tab/page/content/text/gemini/reader.cpp\
src/app/browser/main/tab/page/content/text/gemini/source.cpp\
src/app/browser/main/tab/page/content/text/plain.cpp\ src/app/browser/main/tab/page/content/text/plain.cpp\
src/app/browser/main/tab/page/content/text/plain/reader.cpp\ src/app/browser/main/tab/page/content/text/plain/reader.cpp\
src/app/browser/main/tab/page/navigation.cpp\ src/app/browser/main/tab/page/navigation.cpp\

1
po/POTFILES.in

@ -15,6 +15,7 @@ src/app/browser/main/tab/page/content.cpp
src/app/browser/main/tab/page/content/text.cpp src/app/browser/main/tab/page/content/text.cpp
src/app/browser/main/tab/page/content/text/gemini.cpp src/app/browser/main/tab/page/content/text/gemini.cpp
src/app/browser/main/tab/page/content/text/gemini/reader.cpp src/app/browser/main/tab/page/content/text/gemini/reader.cpp
src/app/browser/main/tab/page/content/text/gemini/source.cpp
src/app/browser/main/tab/page/content/text/plain.cpp src/app/browser/main/tab/page/content/text/plain.cpp
src/app/browser/main/tab/page/content/text/plain/reader.cpp src/app/browser/main/tab/page/content/text/plain/reader.cpp
src/app/browser/main/tab/page/navigation.cpp src/app/browser/main/tab/page/navigation.cpp

32
src/app/browser/main/tab/page/content/text/gemini/source.cpp

@ -0,0 +1,32 @@
#include "source.hpp"
using namespace app::browser::main::tab::page::content::text::gemini;
Source::Source(
const Glib::ustring & GEMTEXT
) {
set_valign(
Gtk::Align::START
);
set_wrap(
true
);
set_selectable(
true
);
set_use_markup(
true
);
set_markup(
Glib::ustring::sprintf(
"<tt>%s</tt>",
Glib::Markup::escape_text(
GEMTEXT
)
)
);
}

24
src/app/browser/main/tab/page/content/text/gemini/source.hpp

@ -0,0 +1,24 @@
#ifndef APP_BROWSER_MAIN_TAB_PAGE_CONTENT_TEXT_GEMINI_SOURCE_HPP
#define APP_BROWSER_MAIN_TAB_PAGE_CONTENT_TEXT_GEMINI_SOURCE_HPP
#include <glibmm/markup.h>
#include <glibmm/ustring.h>
#include <gtkmm/enums.h>
#include <gtkmm/label.h>
namespace app::browser::main::tab::page::content::text::gemini
{
class Source : public Gtk::Label
{
/*
* Gemini class API
*/
public:
Source(
const Glib::ustring & GEMTEXT
);
};
}
#endif // APP_BROWSER_MAIN_TAB_PAGE_CONTENT_TEXT_GEMINI_SOURCE_HPP
Loading…
Cancel
Save