fix: update template, prevent double-spaced persisted kernel logs

This commit is contained in:
2026-08-22 12:47:13 +02:00
parent 903218168d
commit 8a74b771e1
21 changed files with 584 additions and 384 deletions
+18 -3
View File
@@ -40,6 +40,8 @@ struct ContextMenuItem {
const char* label;
int id;
bool enabled;
const char* shortcut;
bool separator_after;
};
enum ContextMenuResult : int {
@@ -210,8 +212,8 @@ inline void draw_context_menu(Canvas& c,
Rect menu = context_menu_rect(state, item_count, c.w, c.h,
menu_w, item_h);
c.fill_rect(menu.x + 2, menu.y + 2, menu.w, menu.h,
Color::from_rgb(0x80, 0x80, 0x80));
c.fill_rounded_rect(menu.x + 2, menu.y + 2, menu.w, menu.h, 4,
Color::from_rgb(0x80, 0x80, 0x80));
c.fill_rounded_rect(menu.x, menu.y, menu.w, menu.h, 4,
colors::MENU_BG);
c.rect(menu.x, menu.y, menu.w, menu.h, theme.border);
@@ -226,6 +228,19 @@ inline void draw_context_menu(Canvas& c,
Color label_color = items[i].enabled ? theme.text : theme.text_muted;
context_menu_draw_label(c, menu.x + 12, item.y + (item.h - fh) / 2,
items[i].label, label_color, font, font_size);
if (items[i].shortcut && items[i].shortcut[0]) {
int shortcut_w = font && font->valid && font_size > 0
? font->measure_text(items[i].shortcut, font_size)
: text_width(items[i].shortcut);
context_menu_draw_label(c, menu.x + menu.w - 12 - shortcut_w,
item.y + (item.h - fh) / 2,
items[i].shortcut, theme.text_muted,
font, font_size);
}
if (items[i].separator_after) {
c.hline(menu.x + 10, item.y + item.h - 1,
menu.w - 20, theme.border);
}
}
}
@@ -380,7 +395,7 @@ inline void text_input_delete_range(char* text, int* len, int start, int end) {
inline bool text_input_char_allowed(char ch, TextInputCharFilter filter = nullptr,
void* userdata = nullptr) {
unsigned char u = (unsigned char)ch;
if (u < 0x20 || u >= 0x7F) return false;
if (u < 0x20 || u == 0x7F) return false;
return filter == nullptr || filter(ch, userdata);
}