ui tweaks
This commit is contained in:
@@ -2049,6 +2049,9 @@ function ui_base_on_tab_drop(to: ui_handle_t, to_position: i32, from: ui_handle_
|
||||
if (i > -1 && j > -1) {
|
||||
let tabsi: tab_draw_t[] = ui_base_hwnd_tabs[i];
|
||||
let tabsj: tab_draw_t[] = ui_base_hwnd_tabs[j];
|
||||
if (tabsj.length == 1) {
|
||||
return; // Keep at least one tab in place
|
||||
}
|
||||
let element: tab_draw_t = tabsj[from_position];
|
||||
array_splice(tabsj, from_position, 1);
|
||||
array_insert(tabsi, to_position, element);
|
||||
|
||||
@@ -145,12 +145,20 @@ function ui_menubar_draw_tab_header() {
|
||||
panel_x = (sys_x() - item_w) + ui_menubar_w;
|
||||
|
||||
if (ui_window(ui_menubar_workspace_handle, panel_x, 0, ww, ui_header_h)) {
|
||||
|
||||
if (!config_raw.touch_ui) {
|
||||
ui_tab(ui_header_worktab, tr("3D View"));
|
||||
if (config_raw.touch_ui) {
|
||||
ui_fill(0, 0, ui._window_w, ui._window_h + 4, ui.ops.theme.SEPARATOR_COL);
|
||||
}
|
||||
else {
|
||||
ui_fill(0, 0, ui._window_w, ui._window_h + 4, ui.ops.theme.SEPARATOR_COL);
|
||||
ui_tab(ui_header_worktab, tr("3D View"));
|
||||
|
||||
if (ui_tab(ui_header_worktab, tr(">"))) {
|
||||
ui_header_worktab.position = 0;
|
||||
ui_menu_draw(function () {
|
||||
if (ui_menu_button(tr("3D View"))) {}
|
||||
if (ui_menu_button(tr("2D View"))) {}
|
||||
if (ui_menu_button(tr("Nodes"))) {}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1121,7 +1121,7 @@ function ui_nodes_draw_menubar() {
|
||||
let c: ui_node_canvas_t = ui_nodes_get_canvas(true);
|
||||
let ew: i32 = math_floor(UI_ELEMENT_W() * 0.7);
|
||||
|
||||
draw_set_color(ui.ops.theme.SEPARATOR_COL);
|
||||
draw_set_color(ui.ops.theme.WINDOW_BG_COL);
|
||||
draw_filled_rect(0, UI_ELEMENT_H(), ui_nodes_ww, UI_ELEMENT_H() + UI_ELEMENT_OFFSET() * 2);
|
||||
draw_set_color(0xffffffff);
|
||||
|
||||
@@ -1178,7 +1178,7 @@ function ui_nodes_draw_menubar() {
|
||||
}
|
||||
|
||||
let _BUTTON_COL: i32 = ui.ops.theme.BUTTON_COL;
|
||||
ui.ops.theme.BUTTON_COL = ui.ops.theme.SEPARATOR_COL;
|
||||
ui.ops.theme.BUTTON_COL = ui.ops.theme.WINDOW_BG_COL;
|
||||
|
||||
let cats: string[] = ui_nodes_canvas_type == canvas_type_t.MATERIAL ? nodes_material_categories : nodes_brush_categories;
|
||||
|
||||
|
||||
@@ -5,13 +5,13 @@ function ui_statusbar_init() {
|
||||
}
|
||||
|
||||
function ui_statusbar_width(): i32 {
|
||||
return iron_window_width() - ui_toolbar_w(true) - config_raw.layout[layout_size_t.SIDEBAR_W];
|
||||
return iron_window_width() - config_raw.layout[layout_size_t.SIDEBAR_W];
|
||||
}
|
||||
|
||||
function ui_statusbar_render_ui() {
|
||||
let statush: i32 = config_raw.layout[layout_size_t.STATUS_H];
|
||||
|
||||
if (ui_window(ui_base_hwnds[tab_area_t.STATUS], sys_x(), iron_window_height() - statush, ui_statusbar_width(), statush)) {
|
||||
if (ui_window(ui_base_hwnds[tab_area_t.STATUS], 0, iron_window_height() - statush, ui_statusbar_width(), statush)) {
|
||||
ui._y += 2;
|
||||
|
||||
// Border
|
||||
|
||||
@@ -90,7 +90,7 @@ function ui_toolbar_x(): i32 {
|
||||
function ui_toolbar_render_ui() {
|
||||
let x: i32 = 0;
|
||||
let y: i32 = ui_header_h;
|
||||
let h: i32 = iron_window_height() - ui_header_h;
|
||||
let h: i32 = iron_window_height() - ui_header_h - config_raw.layout[layout_size_t.STATUS_H];
|
||||
let _WINDOW_BG_COL: i32 = ui.ops.theme.WINDOW_BG_COL;
|
||||
|
||||
if (context_is_floating_toolbar()) {
|
||||
|
||||
@@ -24,6 +24,7 @@ let _ui_view2d_render_tw: f32;
|
||||
let _ui_view2d_render_th: f32;
|
||||
let ui_view2d_grid: gpu_texture_t = null;
|
||||
let ui_view2d_grid_redraw: bool = true;
|
||||
let ui_view2d_htab: ui_handle_t = ui_handle_create();
|
||||
|
||||
function ui_view2d_init() {
|
||||
ui_view2d_pipe = gpu_create_pipeline();
|
||||
@@ -102,7 +103,11 @@ function ui_view2d_render() {
|
||||
|
||||
if (ui_window(ui_view2d_hwnd, ui_view2d_wx, ui_view2d_wy, ui_view2d_ww, ui_view2d_wh)) {
|
||||
|
||||
ui_tab(ui_handle(__ID__), tr("2D View"));
|
||||
ui_tab(ui_view2d_htab, tr("2D View"));
|
||||
|
||||
if (ui_tab(ui_view2d_htab, tr("+"))) {
|
||||
ui_view2d_htab.position = 0;
|
||||
}
|
||||
|
||||
// Grid
|
||||
draw_set_color(0xffffffff);
|
||||
@@ -234,7 +239,7 @@ function ui_view2d_render() {
|
||||
|
||||
// Menu
|
||||
let ew: i32 = math_floor(UI_ELEMENT_W());
|
||||
draw_set_color(ui.ops.theme.SEPARATOR_COL);
|
||||
draw_set_color(ui.ops.theme.WINDOW_BG_COL);
|
||||
draw_filled_rect(0, UI_ELEMENT_H(), ui_view2d_ww, UI_ELEMENT_H() + UI_ELEMENT_OFFSET() * 2);
|
||||
draw_set_color(0xffffffff);
|
||||
|
||||
@@ -330,6 +335,13 @@ function ui_view2d_render() {
|
||||
ui_text(tex.width + "x" + tex.height);
|
||||
}
|
||||
|
||||
ui.enabled = false;
|
||||
let view_type: string = ui_view2d_type == view_2d_type_t.ASSET ? "Asset" :
|
||||
ui_view2d_type == view_2d_type_t.NODE ? "Node" :
|
||||
ui_view2d_type == view_2d_type_t.FONT ? "Font" : "Layer";
|
||||
ui_text(view_type);
|
||||
ui.enabled = true;
|
||||
|
||||
// Picked position
|
||||
if (context_raw.tool == tool_type_t.PICKER && (ui_view2d_type == view_2d_type_t.LAYER || ui_view2d_type == view_2d_type_t.ASSET)) {
|
||||
let cursor_img: gpu_texture_t = resource_get("cursor.k");
|
||||
|
||||
Reference in New Issue
Block a user