diff options
author | Joe <rbo@gmx.us> | 2024-01-19 20:20:20 +0100 |
---|---|---|
committer | Joe <rbo@gmx.us> | 2024-01-19 20:20:20 +0100 |
commit | 04388755c50801f060c7fafa49c5c1bb040c3e94 (patch) | |
tree | 6e2885e1619e33b64beae9daba2ebcd81896fcf9 | |
parent | ok (diff) | |
download | hardflip-04388755c50801f060c7fafa49c5c1bb040c3e94.tar.gz hardflip-04388755c50801f060c7fafa49c5c1bb040c3e94.tar.bz2 hardflip-04388755c50801f060c7fafa49c5c1bb040c3e94.tar.xz hardflip-04388755c50801f060c7fafa49c5c1bb040c3e94.tar.zst hardflip-04388755c50801f060c7fafa49c5c1bb040c3e94.zip |
less retarded limits
Diffstat (limited to '')
-rw-r--r-- | i_ui.go | 53 |
1 files changed, 16 insertions, 37 deletions
@@ -179,21 +179,21 @@ func i_draw_delete_box(ui HardUI, item *ItemsNode) { left, right := (ui.dim[W] / 2) - (max_len / 2) - 5, (ui.dim[W] / 2) + (max_len / 2) + 5 - if left < ui.dim[W] / 8 { - left = ui.dim[W] / 8 + if left < 1 { + left = 1 } - if right > ui.dim[W] - ui.dim[W] / 8 - 1 { - right = ui.dim[W] - ui.dim[W] / 8 - 1 + if right > ui.dim[W] - 2 { + right = ui.dim[W] - 2 } top, bot := - (ui.dim[H] / 2) - 4, - (ui.dim[H] / 2) + 3 - i_draw_box(ui.s, left, top, right, bot, "", true) + (ui.dim[H] / 2) - 2, + (ui.dim[H] / 2) + 2 + i_draw_box(ui.s, left, top, right, bot, " Delete ", true) left = (ui.dim[W] / 2) - (len(text) / 2) if left < (ui.dim[W] / 8) + 1 { left = (ui.dim[W] / 8) + 1 } - top = ui.dim[H] / 2 - 2 + top = ui.dim[H] / 2 - 1 i_draw_text(ui.s, left, top, right, top, ui.def_style, text) @@ -205,26 +205,6 @@ func i_draw_delete_box(ui HardUI, item *ItemsNode) { i_draw_text(ui.s, left, top, right, top, ui.def_style.Bold(true), file) - left = right - 11 - if left < (ui.dim[W] / 8) + 1 { - left = (ui.dim[W] / 8) + 1 - } - top = ui.dim[H] / 2 + 1 - i_draw_text(ui.s, - left - 1, top, right, top, - ui.def_style, "[") - i_draw_text(ui.s, - left, top, right, top, - ui.def_style.Bold(true).Underline(true), "y") - i_draw_text(ui.s, - left + 1, top, right, top, - ui.def_style, "es] [") - i_draw_text(ui.s, - left + 6, top, right, top, - ui.def_style.Bold(true).Underline(true), "n") - i_draw_text(ui.s, - left + 7, top, right, top, - ui.def_style, "o]") } func i_draw_err_box() { @@ -264,16 +244,15 @@ func i_draw_load_ui(ui *HardUI) { ui.s.Clear() text := "Loading " + strconv.Itoa(g_load_count) + " hosts" text_len := len(text) / 2 - // TODO: max len i_draw_box(ui.s, 0, 0, ui.dim[W] - 1, ui.dim[H] - 2, " hardflip ", false) left, right := (ui.dim[W] / 2) - (text_len + 2), (ui.dim[W] / 2) + (text_len + 2) - if left < ui.dim[W] / 8 { - left = ui.dim[W] / 8 + if left < 1 { + left = 1 } - if right > ui.dim[W] - ui.dim[W] / 8 - 1 { - right = ui.dim[W] - ui.dim[W] / 8 - 1 + if right > ui.dim[W] - 2 { + right = ui.dim[W] - 2 } top, bot := (ui.dim[H] / 2) - 2, @@ -282,11 +261,11 @@ func i_draw_load_ui(ui *HardUI) { left, right = (ui.dim[W] / 2) - (text_len - 1), (ui.dim[W] / 2) + (text_len + 1) - if left < ui.dim[W] / 8 + 1 { - left = ui.dim[W] / 8 + 1 + if left < 1 { + left = 1 } - if right > ui.dim[W] - ui.dim[W] / 8 - 1 { - right = ui.dim[W] - ui.dim[W] / 8 - 1 + if right > ui.dim[W] - 2 { + right = ui.dim[W] - 2 } i_draw_text(ui.s, left, (ui.dim[H] / 2), right, (ui.dim[H] / 2), |