diff --git a/base/sources/iron_ui.c b/base/sources/iron_ui.c index b8cd5bb5..41fd44bb 100644 --- a/base/sources/iron_ui.c +++ b/base/sources/iron_ui.c @@ -1405,15 +1405,20 @@ void ui_draw_tabs() { current->_w = !current->current_window->scroll_enabled ? current->_window_w : current->_window_w - UI_SCROLL_W(); } -void ui_draw_arrow(bool selected) { +void ui_draw_arrow(bool selected, bool align_right) { float x = current->_x + current->arrow_offset_x; float y = current->_y + current->arrow_offset_y; - draw_set_color(theme->TEXT_COL); + draw_set_color(theme->LABEL_COL); if (selected) { - draw_filled_triangle(x, y, x + UI_ARROW_SIZE(), y, x + UI_ARROW_SIZE() / 2.0, y + UI_ARROW_SIZE()); + draw_filled_triangle(x, y, x + UI_ARROW_SIZE() + 0.1, y, x + UI_ARROW_SIZE() / 2.0, y + UI_ARROW_SIZE()); } else { - draw_filled_triangle(x, y, x, y + UI_ARROW_SIZE(), x + UI_ARROW_SIZE(), y + UI_ARROW_SIZE() / 2.0); + if (align_right) { + draw_filled_triangle(x + UI_ARROW_SIZE(), y - 1, x + UI_ARROW_SIZE(), y + UI_ARROW_SIZE() + 1, x, y + UI_ARROW_SIZE() / 2.0); + } + else { + draw_filled_triangle(x + UI_ARROW_SIZE(), y - 0.1, x, y + UI_ARROW_SIZE() + 0.1, x + UI_ARROW_SIZE(), y + UI_ARROW_SIZE() / 2.0); + } } } @@ -1423,11 +1428,11 @@ void ui_draw_tree(bool selected) { float y = current->_y + current->arrow_offset_y + 1; draw_set_color(theme->TEXT_COL); if (selected) { - draw_filled_rect(x, y + SIGN_W / 2.0 - 1, SIGN_W, SIGN_W / 8.0); + draw_filled_rect(x, y + SIGN_W / 2.0 - 1, SIGN_W, SIGN_W / 7.0); } else { - draw_filled_rect(x, y + SIGN_W / 2.0 - 1, SIGN_W, SIGN_W / 8.0); - draw_filled_rect(x + SIGN_W / 2.0 - 1, y, SIGN_W / 8.0, SIGN_W); + draw_filled_rect(x, y + SIGN_W / 2.0 - 1, SIGN_W, SIGN_W / 7.0); + draw_filled_rect(x + SIGN_W / 2.0 - 1, y, SIGN_W / 7.0, SIGN_W); } } @@ -1892,7 +1897,7 @@ bool ui_tab(ui_handle_t *handle, char *text, bool vertical, uint32_t color, bool return handle->i == current->tab_count - 1; } -bool ui_panel(ui_handle_t *handle, char *text, bool is_tree, bool filled) { +bool ui_panel(ui_handle_t *handle, char *text, bool is_tree, bool filled, bool align_right) { if (!ui_is_visible(UI_ELEMENT_H())) { ui_end_element(); return handle->b; @@ -1912,7 +1917,7 @@ bool ui_panel(ui_handle_t *handle, char *text, bool is_tree, bool filled) { ui_draw_tree(handle->b); } else { - ui_draw_arrow(handle->b); + ui_draw_arrow(handle->b, align_right); } draw_set_color(theme->LABEL_COL); // Title diff --git a/base/sources/iron_ui.h b/base/sources/iron_ui.h index 86dff18a..59ae130c 100644 --- a/base/sources/iron_ui.h +++ b/base/sources/iron_ui.h @@ -293,7 +293,7 @@ bool ui_window(ui_handle_t *handle, int x, int y, int w, int h, bool drag); // bool ui_button(char *text, int align, char *label); int ui_text(char *text, int align, int bg); bool ui_tab(ui_handle_t *handle, char *text, bool vertical, uint32_t color, bool align_right); -bool ui_panel(ui_handle_t *handle, char *text, bool is_tree, bool filled); +bool ui_panel(ui_handle_t *handle, char *text, bool is_tree, bool filled, bool align_right); int ui_sub_image(gpu_texture_t *image, uint32_t tint, int h, int sx, int sy, int sw, int sh); int ui_image(gpu_texture_t *image, uint32_t tint, int h); char *ui_text_input(ui_handle_t *handle, char *label, int align, bool editable, bool live_update); diff --git a/base/sources/plugins/plugin_api.c b/base/sources/plugins/plugin_api.c index aba2bd54..f1c590e4 100644 --- a/base/sources/plugins/plugin_api.c +++ b/base/sources/plugins/plugin_api.c @@ -444,7 +444,7 @@ FN(ui_panel) { uint64_t p; JS_ToBigUint64(ctx, &p, argv[0]); char *s = (char *)JS_ToCString(ctx, argv[1]); - bool result = ui_panel((void *)p, s, false, false); + bool result = ui_panel((void *)p, s, false, false, false); return JS_NewBool(ctx, result); } diff --git a/base/sources/ts/iron.ts b/base/sources/ts/iron.ts index 4c899548..168a5b03 100644 --- a/base/sources/ts/iron.ts +++ b/base/sources/ts/iron.ts @@ -721,7 +721,7 @@ declare function _ui_menu_button(s: string): bool; declare function ui_begin_region(ui: ui_t, x: i32, y: i32, w: i32): void; declare function ui_inline_radio(handle: ui_handle_t, texts: string[], align: i32): i32; declare function ui_end_input(): void; -declare function ui_panel(handle: ui_handle_t, text: string, is_tree: bool = false, filled: bool = true): bool; +declare function ui_panel(handle: ui_handle_t, text: string, is_tree: bool = false, filled: bool = true, align_right: bool = false): bool; declare function ui_nodes_rgba_popup(nhandle: ui_handle_t, val: f32_ptr, x: i32, y: i32): void; declare function ui_get_link(links: ui_node_link_t[], id: i32): ui_node_link_t; declare function ui_get_node(nodes: ui_node_t[], id: i32): ui_node_t; diff --git a/paint/sources/box_export.ts b/paint/sources/box_export.ts index 5be0d3df..2ecc4ea4 100644 --- a/paint/sources/box_export.ts +++ b/paint/sources/box_export.ts @@ -31,7 +31,7 @@ function box_export_show_textures() { /// if (arm_android || arm_ios) box_export_tab_export_mesh(box_export_htab); /// end - }, 540, 340, null, true, tr("Export")); + }, 600, 400, null, true, tr("Export")); } function box_export_show_bake_material() { @@ -47,7 +47,7 @@ function box_export_show_bake_material() { box_export_tab_export_textures(tr("Bake to Textures"), true); box_export_tab_presets(); - }, 540, 340, null, true, tr("Export")); + }, 600, 400, null, true, tr("Export")); } function box_export_tab_export_textures(title: string, bake_material: bool = false) { diff --git a/paint/sources/config.ts b/paint/sources/config.ts index d1fb5abb..062a5e9a 100644 --- a/paint/sources/config.ts +++ b/paint/sources/config.ts @@ -3,8 +3,7 @@ let config_raw: config_t = null; let config_keymap: map_t; let config_loaded: bool = false; let config_button_align: ui_align_t = ui_align_t.LEFT; -let config_default_button_spacing: string = " "; -let config_button_spacing: string = config_default_button_spacing; +let config_button_spacing: string = " "; function config_load() { let path: string = ""; @@ -439,13 +438,9 @@ function config_load_theme(theme: string, tag_redraw: bool = true) { base_theme.ARROW_SIZE = 5 + 2; base_theme.CHECK_SIZE = 15 + 4; base_theme.CHECK_SELECT_SIZE = 8 + 2; - config_button_align = ui_align_t.LEFT; - config_button_spacing = ""; } else { base_theme.FULL_TABS = false; - config_button_align = ui_align_t.LEFT; - config_button_spacing = config_default_button_spacing; } } diff --git a/paint/sources/tab_layers.ts b/paint/sources/tab_layers.ts index a5fc3540..040ddb3e 100644 --- a/paint/sources/tab_layers.ts +++ b/paint/sources/tab_layers.ts @@ -444,7 +444,7 @@ function tab_layers_draw_layer_slot_full(l: slot_layer_t, i: i32) { let layer_panel: ui_handle_t = ui_nest(ui_handle(__ID__), l.id); layer_panel.b = l.show_panel; - l.show_panel = ui_panel(layer_panel, "", true, false); + l.show_panel = ui_panel(layer_panel, "", false, false, true); } ui._x = uix; diff --git a/paint/sources/ui_menu.ts b/paint/sources/ui_menu.ts index 53ee3018..57c65a02 100644 --- a/paint/sources/ui_menu.ts +++ b/paint/sources/ui_menu.ts @@ -115,12 +115,7 @@ function ui_menu_fit_to_screen() { function ui_menu_separator() { ui._y++; - if (config_raw.touch_ui) { - ui_fill(0, 0, ui._w / UI_SCALE(), 1, ui.ops.theme.BUTTON_COL); - } - else { - ui_fill(26, 0, ui._w / UI_SCALE() - 26, 1, ui.ops.theme.BUTTON_COL); - } + ui_fill(26, 0, ui._w / UI_SCALE() - 26, 1, ui.ops.theme.BUTTON_COL); } function ui_menu_button(text: string, label: string = "", icon: icon_t = icon_t.NONE): bool {