Files
armorpaint/paint/sources/ui_status.ts
T

46 lines
1.3 KiB
TypeScript
Raw Normal View History

2024-03-11 15:10:18 +01:00
let ui_status_default_status_h: i32 = 33;
function ui_status_init() {
}
function ui_status_width(): i32 {
2025-07-18 23:37:51 +02:00
return iron_window_width() - ui_toolbar_w(true) - config_raw.layout[layout_size_t.SIDEBAR_W];
2024-03-11 15:10:18 +01:00
}
function ui_status_render_ui() {
let statush: i32 = config_raw.layout[layout_size_t.STATUS_H];
2025-03-11 19:49:42 +01:00
if (ui_window(ui_base_hwnds[tab_area_t.STATUS], sys_x(), iron_window_height() - statush, ui_status_width(), statush)) {
2024-03-11 15:10:18 +01:00
ui._y += 2;
// Border
2025-03-02 21:07:17 +01:00
draw_set_color(ui.ops.theme.SEPARATOR_COL);
2025-03-02 19:44:26 +01:00
draw_filled_rect(0, 0, 1, ui._window_h);
draw_filled_rect(ui._window_w - 1, 0, 1, ui._window_h);
2024-03-11 15:10:18 +01:00
// Draw tabs
2024-05-03 21:29:39 +02:00
let hwnd_draws: tab_draw_t[] = ui_base_hwnd_tabs[tab_area_t.STATUS];
2024-09-03 15:52:05 +02:00
let htab: ui_handle_t = ui_base_htabs[tab_area_t.STATUS];
2024-05-03 21:29:39 +02:00
for (let i: i32 = 0; i < hwnd_draws.length; ++i) {
let draw: tab_draw_t = hwnd_draws[i];
draw.f(htab);
2024-03-20 16:13:54 +01:00
}
2024-03-11 15:10:18 +01:00
let minimized: bool = statush <= ui_status_default_status_h * config_raw.window_scale;
2024-05-03 21:29:39 +02:00
if (htab.changed && (htab.position == context_raw.last_status_position || minimized)) {
2024-03-11 15:10:18 +01:00
ui_base_toggle_browser();
}
2024-05-03 21:29:39 +02:00
context_raw.last_status_position = htab.position;
2024-03-11 15:10:18 +01:00
}
}
2024-09-03 15:52:05 +02:00
function ui_status_draw_version_tab(htab: ui_handle_t) {
2024-03-11 15:10:18 +01:00
// Version label
if (!config_raw.touch_ui) {
ui.enabled = false;
2024-09-03 15:52:05 +02:00
ui_tab(ui_base_htabs[tab_area_t.STATUS], manifest_version);
2024-03-11 15:10:18 +01:00
ui.enabled = true;
}
}