paint: ui fixes

This commit is contained in:
luboslenco
2026-06-10 08:49:55 +02:00
parent dd4af35eac
commit 93611d6ceb
2 changed files with 14 additions and 10 deletions
+3 -3
View File
@@ -605,9 +605,6 @@ void tab_meshes_draw_mesh_slot(mesh_object_t *o, i32 i) {
f32 uix = g_ui->_x; f32 uix = g_ui->_x;
f32 uiy = g_ui->_y; f32 uiy = g_ui->_y;
// Separator
ui_fill(0, 0, (g_ui->_w / (float)UI_SCALE() - 2), 1 * UI_SCALE(), g_theme->SEPARATOR_COL);
// Eye icon // Eye icon
f32_array_t *row = f32_array_create_from_raw( f32_array_t *row = f32_array_create_from_raw(
(f32[]){ (f32[]){
@@ -701,6 +698,9 @@ void tab_meshes_draw_mesh_slot(mesh_object_t *o, i32 i) {
g_ui->_y = uiy + step * 2 * UI_SCALE(); g_ui->_y = uiy + step * 2 * UI_SCALE();
g_ui->_w = uiw; g_ui->_w = uiw;
// Separator line
ui_fill(0, 0, (g_ui->_w / (float)UI_SCALE() - 2), 1 * UI_SCALE(), g_theme->SEPARATOR_COL);
// Highlight selected // Highlight selected
if (g_context->paint_object == o) { if (g_context->paint_object == o) {
ui_rect(1, -step * 2 - 1, g_ui->_w / (float)UI_SCALE() - 2, step * 2 + 1, g_theme->HIGHLIGHT_COL, 2); ui_rect(1, -step * 2 - 1, g_ui->_w / (float)UI_SCALE() - 2, step * 2 + 1, g_theme->HIGHLIGHT_COL, 2);
+11 -7
View File
@@ -95,6 +95,16 @@ void ui_view2d_draw_edit() {
} }
g_ui->enabled = true; g_ui->enabled = true;
} }
char *view_type = ui_view2d_type == VIEW_2D_TYPE_ASSET ? tr("Asset")
: ui_view2d_type == VIEW_2D_TYPE_NODE ? tr("Node")
: ui_view2d_type == VIEW_2D_TYPE_FONT ? tr("Font")
: ui_view2d_type == VIEW_2D_TYPE_UVMAP ? tr("UVMap")
: tr("Layer");
g_ui->enabled = false;
ui_text(view_type, UI_ALIGN_LEFT, 0x00000000);
g_ui->enabled = true;
} }
void ui_view2d_draw_image(gpu_texture_t *image, f32 dx, f32 dy, f32 dw, f32 dh, i32 channel) { void ui_view2d_draw_image(gpu_texture_t *image, f32 dx, f32 dy, f32 dw, f32 dh, i32 channel) {
@@ -587,14 +597,8 @@ void ui_view2d_update(void *_) {
g_ui->_y = 2 + start_y; g_ui->_y = 2 + start_y;
} }
char *view_type = ui_view2d_type == VIEW_2D_TYPE_ASSET ? tr("Asset")
: ui_view2d_type == VIEW_2D_TYPE_NODE ? tr("Node")
: ui_view2d_type == VIEW_2D_TYPE_FONT ? tr("Font")
: ui_view2d_type == VIEW_2D_TYPE_UVMAP ? tr("UVMap")
: tr("Layer");
g_ui->_w = math_floor(ew * 0.7 + 3); g_ui->_w = math_floor(ew * 0.7 + 3);
if (ui_icon_button(view_type, ICON_EDIT, UI_ALIGN_CENTER)) { if (ui_icon_button("Edit", ICON_EDIT, UI_ALIGN_CENTER)) {
gc_unroot(ui_view2d_tex); gc_unroot(ui_view2d_tex);
ui_view2d_tex = tex; ui_view2d_tex = tex;
gc_root(ui_view2d_tex); gc_root(ui_view2d_tex);