Files
armorpaint/base/sources/ts/tab_history.ts
T
luboslenco e9bc7dfecb ui cleanup
2025-08-15 22:59:45 +02:00

25 lines
663 B
TypeScript

function tab_history_draw(htab: ui_handle_t) {
if (ui_tab(htab, tr("History"))) {
for (let i: i32 = 0; i < history_steps.length; ++i) {
let active: i32 = history_steps.length - 1 - history_redos;
if (i == active) {
ui_fill(0, 0, ui._window_w, ui.ops.theme.ELEMENT_H, ui.ops.theme.HIGHLIGHT_COL);
}
ui_text(history_steps[i].name);
if (ui.is_released) { // Jump to undo step
let diff: i32 = i - active;
while (diff > 0) {
diff--;
history_redo();
}
while (diff < 0) {
diff++;
history_undo();
}
}
ui_fill(0, 0, (ui._window_w / UI_SCALE() - 2), 1 * UI_SCALE(), ui.ops.theme.SEPARATOR_COL);
}
}
}