Files
armorpaint/base/sources/tab_history.ts
T

30 lines
734 B
TypeScript
Raw Normal View History

2024-03-14 15:31:22 +01:00
///if (is_paint || is_sculpt)
2024-09-03 15:52:05 +02:00
function tab_history_draw(htab: ui_handle_t) {
let ui: ui_t = ui_base_ui;
if (ui_tab(htab, tr("History"))) {
2024-03-14 15:31:22 +01:00
for (let i: i32 = 0; i < history_steps.length; ++i) {
let active: i32 = history_steps.length - 1 - history_redos;
if (i == active) {
2024-09-03 15:52:05 +02:00
ui_fill(0, 0, ui._window_w, ui.ops.theme.ELEMENT_H, ui.ops.theme.HIGHLIGHT_COL);
2024-03-14 15:31:22 +01:00
}
2024-09-03 15:52:05 +02:00
ui_text(history_steps[i].name);
2024-03-14 15:31:22 +01:00
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();
}
}
2024-09-03 15:52:05 +02:00
ui_fill(0, 0, (ui._window_w / ui_SCALE(ui) - 2), 1 * ui_SCALE(ui), ui.ops.theme.SEPARATOR_COL);
2024-03-14 15:31:22 +01:00
}
}
}
///end