paint: ui fixes
This commit is contained in:
@@ -373,7 +373,7 @@ void tab_layers_draw_layer_slot_full(slot_layer_t *l, i32 i) {
|
|||||||
if (parent_hidden) {
|
if (parent_hidden) {
|
||||||
col -= 0x99000000;
|
col -= 0x99000000;
|
||||||
}
|
}
|
||||||
if (ui_sub_image(icons, col, -1.0, r->x, r->y, r->w, r->h) == UI_STATE_RELEASED) {
|
if (ui_sub_image(icons, col, r->h, r->x, r->y, r->w, r->h) == UI_STATE_RELEASED) {
|
||||||
tab_layers_layer_toggle_visible(l);
|
tab_layers_layer_toggle_visible(l);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -387,19 +387,20 @@ void tab_layers_draw_layer_slot_full(slot_layer_t *l, i32 i) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Layer icon
|
// Layer icon
|
||||||
|
i32 icon_h = (UI_ELEMENT_H() - 3) * 2;
|
||||||
ui->_x = uix + uiw * 0.08 + offx;
|
ui->_x = uix + uiw * 0.08 + offx;
|
||||||
ui->_y = uiy + 3;
|
ui->_y = uiy + 3;
|
||||||
ui->_w = uiw * 0.16;
|
ui->_w = math_max(uiw * 0.16, icon_h);
|
||||||
ui_state_t state = tab_layers_draw_layer_icon(l, i, uix, uiy, false);
|
ui_state_t state = tab_layers_draw_layer_icon(l, i, uix, uiy, false);
|
||||||
tab_layers_handle_layer_icon_state(l, i, state, uix, uiy);
|
tab_layers_handle_layer_icon_state(l, i, state, uix, uiy);
|
||||||
|
|
||||||
// Draw layer name
|
// Draw layer name
|
||||||
ui->_x = uix + uiw * 0.25 + 2 * UI_SCALE() + offx;
|
bool has_blending = !slot_layer_is_group(l) && !slot_layer_is_mask(l) && !slot_layer_is_filter(l);
|
||||||
ui->_y = uiy + center;
|
f32 name_x = math_max(uix + uiw * 0.25 + offx, uix + uiw * 0.08 + offx + icon_h + 4 * UI_SCALE());
|
||||||
ui->_w = uiw * 0.36;
|
f32 name_right = has_blending ? uix + uiw * 0.60 : (has_children ? uix + uiw * 0.90 : uix + uiw); // Blending combo / panel / window edge
|
||||||
if (g_config->touch_ui) {
|
ui->_x = name_x;
|
||||||
ui->_x += 12 * UI_SCALE();
|
ui->_y = uiy + center;
|
||||||
}
|
ui->_w = name_right - name_x;
|
||||||
if (tab_layers_layer_name_edit == l->id) {
|
if (tab_layers_layer_name_edit == l->id) {
|
||||||
tab_layers_layer_name_handle->text = string_copy(l->name);
|
tab_layers_layer_name_handle->text = string_copy(l->name);
|
||||||
l->name = string_copy(ui_text_input(tab_layers_layer_name_handle, "", UI_ALIGN_LEFT, true, false));
|
l->name = string_copy(ui_text_input(tab_layers_layer_name_handle, "", UI_ALIGN_LEFT, true, false));
|
||||||
|
|||||||
@@ -753,7 +753,10 @@ void tab_timeline_draw(ui_handle_t *htab) {
|
|||||||
draw_set_color(ui->ops->theme->LABEL_COL);
|
draw_set_color(ui->ops->theme->LABEL_COL);
|
||||||
i32 label_start = (tab_timeline_scroll / 5) * 5;
|
i32 label_start = (tab_timeline_scroll / 5) * 5;
|
||||||
for (i32 i = label_start; i < tab_timeline_scroll + visible + 1 && i < tab_timeline_max_frames; i += 5) {
|
for (i32 i = label_start; i < tab_timeline_scroll + visible + 1 && i < tab_timeline_max_frames; i += 5) {
|
||||||
f32 lx = start_x + (i - tab_timeline_scroll) * frame_w;
|
f32 lx = start_x + (i - tab_timeline_scroll) * frame_w;
|
||||||
|
if (lx < start_x) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
char *label = i32_to_string(i);
|
char *label = i32_to_string(i);
|
||||||
f32 label_w = draw_string_width(ui->ops->font, ui->font_size, label);
|
f32 label_w = draw_string_width(ui->ops->font, ui->font_size, label);
|
||||||
draw_string(label, lx + (frame_w - label_w) / 2.0f, start_y);
|
draw_string(label, lx + (frame_w - label_w) / 2.0f, start_y);
|
||||||
@@ -779,7 +782,10 @@ void tab_timeline_draw(ui_handle_t *htab) {
|
|||||||
draw_string(layer->name, ui->_x + icon_size + 2, row_y + (strip_h - font_h) / 2.0f);
|
draw_string(layer->name, ui->_x + icon_size + 2, row_y + (strip_h - font_h) / 2.0f);
|
||||||
|
|
||||||
for (i32 i = tab_timeline_scroll; i < tab_timeline_scroll + visible + 1 && i < tab_timeline_max_frames; i++) {
|
for (i32 i = tab_timeline_scroll; i < tab_timeline_scroll + visible + 1 && i < tab_timeline_max_frames; i++) {
|
||||||
f32 x = start_x + (i - tab_timeline_scroll) * frame_w;
|
f32 x = start_x + (i - tab_timeline_scroll) * frame_w;
|
||||||
|
if (x < start_x) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
bool selected = i == tab_timeline_selected_frame && ri == tab_timeline_selected_row;
|
bool selected = i == tab_timeline_selected_frame && ri == tab_timeline_selected_row;
|
||||||
u32 col = selected ? sel_col : (i % 5 == 0) ? bright_col : base_col;
|
u32 col = selected ? sel_col : (i % 5 == 0) ? bright_col : base_col;
|
||||||
|
|
||||||
@@ -820,7 +826,10 @@ void tab_timeline_draw(ui_handle_t *htab) {
|
|||||||
draw_string(mesh->base->name, ui->_x + icon_size + 2, row_y + (strip_h - font_h) / 2.0f);
|
draw_string(mesh->base->name, ui->_x + icon_size + 2, row_y + (strip_h - font_h) / 2.0f);
|
||||||
|
|
||||||
for (i32 i = tab_timeline_scroll; i < tab_timeline_scroll + visible + 1 && i < tab_timeline_max_frames; i++) {
|
for (i32 i = tab_timeline_scroll; i < tab_timeline_scroll + visible + 1 && i < tab_timeline_max_frames; i++) {
|
||||||
f32 x = start_x + (i - tab_timeline_scroll) * frame_w;
|
f32 x = start_x + (i - tab_timeline_scroll) * frame_w;
|
||||||
|
if (x < start_x) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
bool selected = i == tab_timeline_selected_frame && ri == tab_timeline_selected_row;
|
bool selected = i == tab_timeline_selected_frame && ri == tab_timeline_selected_row;
|
||||||
u32 col = selected ? sel_col : (i % 5 == 0) ? bright_col : base_col;
|
u32 col = selected ? sel_col : (i % 5 == 0) ? bright_col : base_col;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user