feat: port Printers app to MTK toolkit

This commit is contained in:
2026-04-15 17:49:07 +02:00
parent a7499c57c9
commit ca954517e9
6 changed files with 179 additions and 159 deletions
+4
View File
@@ -24,6 +24,7 @@ SvgIcon g_icon_list_bullet = {};
SvgIcon g_icon_list_number = {};
SvgIcon g_icon_indent_less = {};
SvgIcon g_icon_indent_more = {};
SvgIcon g_icon_page_view = {};
TrueTypeFont* g_ui_font = nullptr;
TrueTypeFont* g_ui_bold = nullptr;
@@ -58,6 +59,8 @@ void wp_load_icons() {
g_icon_indent_less = svg_load("0:/icons/format-indent-less-symbolic.svg", 16, 16, def_color);
if (!g_icon_indent_more.pixels)
g_icon_indent_more = svg_load("0:/icons/format-indent-more-symbolic.svg", 16, 16, def_color);
if (!g_icon_page_view.pixels)
g_icon_page_view = svg_load("0:/icons/view-paged-symbolic.svg", 16, 16, def_color);
}
void wp_cleanup_state() {
@@ -75,6 +78,7 @@ void wp_cleanup_state() {
if (g_icon_list_number.pixels) svg_free(g_icon_list_number);
if (g_icon_indent_less.pixels) svg_free(g_icon_indent_less);
if (g_icon_indent_more.pixels) svg_free(g_icon_indent_more);
if (g_icon_page_view.pixels) svg_free(g_icon_page_view);
}
extern "C" void _start() {
+2 -11
View File
@@ -297,17 +297,8 @@ void wp_render() {
Color pageview_bg = wp->page_view_mode ? btn_active : btn_bg;
c.fill_rounded_rect(WP_BTN_PAGEVIEW_X, 6, 24, 24, 3, pageview_bg);
{
// Draw a small page icon: rectangle with lines
int px = WP_BTN_PAGEVIEW_X + 4;
int py = 9;
// Page outline
c.rect(px, py, 14, 18, colors::TEXT_COLOR);
// Lines inside page
c.hline(px + 2, py + 4, 10, colors::TEXT_COLOR);
c.hline(px + 2, py + 8, 10, colors::TEXT_COLOR);
c.hline(px + 2, py + 12, 6, colors::TEXT_COLOR);
}
wp_draw_ui_icon_button(c, WP_BTN_PAGEVIEW_X, 6, 24, 24, g_icon_page_view, "\xA7",
pageview_bg, colors::TEXT_COLOR);
c.hline(0, WP_TOOLBAR_H - 1, c.w, colors::BORDER);
@@ -396,6 +396,7 @@ extern SvgIcon g_icon_list_bullet;
extern SvgIcon g_icon_list_number;
extern SvgIcon g_icon_indent_less;
extern SvgIcon g_icon_indent_more;
extern SvgIcon g_icon_page_view;
extern TrueTypeFont* g_ui_font;
extern TrueTypeFont* g_ui_bold;