Cleanup
This commit is contained in:
@@ -32,8 +32,6 @@ bool ui_is_cut = false;
|
||||
bool ui_is_copy = false;
|
||||
bool ui_is_paste = false;
|
||||
void (*ui_on_border_hover)(ui_handle_t *, int) = NULL; // Mouse over window border, use for resizing
|
||||
void (*ui_on_text_hover)(void) = NULL; // Mouse over text input, use to set I-cursor
|
||||
void (*ui_on_deselect_text)(void) = NULL; // Text editing finished
|
||||
void (*ui_on_tab_drop)(ui_handle_t *, int, ui_handle_t *, int) = NULL; // Tab reorder via drag and drop
|
||||
#ifdef WITH_EVAL
|
||||
float js_eval(char *str);
|
||||
@@ -1027,6 +1025,8 @@ void ui_submit_text_edit() {
|
||||
current->text_selected[0] = '\0';
|
||||
}
|
||||
|
||||
void keyboard_up_listener(int key_code);
|
||||
|
||||
void ui_deselect_text(ui_t *ui) {
|
||||
if (ui->text_selected_handle == NULL) {
|
||||
return;
|
||||
@@ -1040,9 +1040,9 @@ void ui_deselect_text(ui_t *ui) {
|
||||
}
|
||||
iron_keyboard_hide();
|
||||
ui->highlight_anchor = ui->cursor_x;
|
||||
if (ui_on_deselect_text != NULL) {
|
||||
ui_on_deselect_text();
|
||||
}
|
||||
#ifdef IRON_IOS
|
||||
keyboard_up_listener(IRON_KEY_SHIFT);
|
||||
#endif
|
||||
}
|
||||
|
||||
void ui_remove_char_at(char *str, int at) {
|
||||
@@ -1976,8 +1976,8 @@ char *ui_text_input(ui_handle_t *handle, char *label, int align, bool editable,
|
||||
}
|
||||
|
||||
bool hover = ui_get_hover(UI_ELEMENT_H());
|
||||
if (hover && ui_on_text_hover != NULL) {
|
||||
ui_on_text_hover();
|
||||
if (hover) {
|
||||
iron_mouse_set_cursor(IRON_CURSOR_IBEAM);
|
||||
}
|
||||
draw_set_color(hover ? theme->HOVER_COL : theme->BUTTON_COL); // Text bg
|
||||
ui_draw_rect(false, current->_x + current->button_offset_y, current->_y + current->button_offset_y, current->_w - current->button_offset_y * 2, UI_BUTTON_H());
|
||||
|
||||
@@ -372,8 +372,6 @@ extern bool ui_is_cut;
|
||||
extern bool ui_is_copy;
|
||||
extern bool ui_is_paste;
|
||||
extern void (*ui_on_border_hover)(ui_handle_t *, int);
|
||||
extern void (*ui_on_text_hover)(void);
|
||||
extern void (*ui_on_deselect_text)(void);
|
||||
extern void (*ui_on_tab_drop)(ui_handle_t *, int, ui_handle_t *, int);
|
||||
extern const char *ui_theme_keys[];
|
||||
extern int ui_theme_keys_count;
|
||||
|
||||
@@ -684,8 +684,6 @@ declare let ui_touch_scroll: bool;
|
||||
declare let ui_touch_hold : bool;
|
||||
declare let ui_touch_tooltip: bool;
|
||||
declare let ui_on_border_hover: any;
|
||||
declare let ui_on_text_hover: any;
|
||||
declare let ui_on_deselect_text: any;
|
||||
declare let ui_on_tab_drop: any;
|
||||
declare let ui_nodes_on_link_drag: any;
|
||||
declare let ui_nodes_on_socket_released: any;
|
||||
|
||||
@@ -116,7 +116,6 @@ function main() {
|
||||
let text_coloring: ui_text_coloring_t = json_parse(sys_buffer_to_string(blob_coloring));
|
||||
ui_text_area_coloring = text_coloring;
|
||||
ui_on_border_hover = on_border_hover;
|
||||
ui_on_text_hover = on_text_hover;
|
||||
ui_text_area_line_numbers = true;
|
||||
ui_text_area_scroll_past_end = true;
|
||||
|
||||
@@ -376,10 +375,6 @@ function on_border_hover(handle: ui_handle_t, side: i32) {
|
||||
}
|
||||
}
|
||||
|
||||
function on_text_hover() {
|
||||
iron_mouse_set_cursor(cursor_t.IBEAM);
|
||||
}
|
||||
|
||||
////
|
||||
type config_t = { server: string; };
|
||||
let config_raw: config_t;
|
||||
|
||||
@@ -391,11 +391,6 @@ function project_import_mesh_box(path: string, replace_existing: bool = true, cl
|
||||
_project_import_mesh_box_clear_layers = clear_layers;
|
||||
_project_import_mesh_box_done = done;
|
||||
|
||||
///if arm_ios
|
||||
// Import immediately while access to resource is unlocked
|
||||
// data_get_blob(path);
|
||||
///end
|
||||
|
||||
ui_box_show_custom(function () {
|
||||
let path: string = _project_import_mesh_box_path;
|
||||
let replace_existing: bool = _project_import_mesh_box_replace_existing;
|
||||
|
||||
@@ -118,8 +118,6 @@ function ui_base_init() {
|
||||
};
|
||||
ui = ui_create(ops);
|
||||
ui_on_border_hover = ui_base_on_border_hover;
|
||||
ui_on_text_hover = ui_base_on_text_hover;
|
||||
ui_on_deselect_text = ui_base_on_deselect_text;
|
||||
ui_on_tab_drop = ui_base_on_tab_drop;
|
||||
if (UI_SCALE() > 1) {
|
||||
ui_base_set_icon_scale();
|
||||
@@ -1385,16 +1383,6 @@ function ui_base_on_border_hover(handle: ui_handle_t, side: i32) {
|
||||
}
|
||||
}
|
||||
|
||||
function ui_base_on_text_hover() {
|
||||
iron_mouse_set_cursor(cursor_t.IBEAM);
|
||||
}
|
||||
|
||||
function ui_base_on_deselect_text() {
|
||||
///if arm_ios
|
||||
keyboard_up_listener(key_code_t.SHIFT);
|
||||
///end
|
||||
}
|
||||
|
||||
function ui_base_on_tab_drop(to: ui_handle_t, to_position: i32, from: ui_handle_t, from_position: i32) {
|
||||
let i: i32 = -1;
|
||||
let j: i32 = -1;
|
||||
|
||||
Reference in New Issue
Block a user