Cleanup: move ui-selextend defines into header
This commit is contained in:
@@ -304,7 +304,13 @@ typedef struct uiHandleButtonData {
|
||||
/* text selection/editing */
|
||||
/* size of 'str' (including terminator) */
|
||||
int maxlen;
|
||||
int selextend;
|
||||
/* Button text selection:
|
||||
* extension direction, selextend, inside ui_do_but_TEX */
|
||||
enum {
|
||||
EXTEND_NONE = 0,
|
||||
EXTEND_LEFT = 1,
|
||||
EXTEND_RIGHT = 2,
|
||||
} selextend;
|
||||
float selstartx;
|
||||
/* allow to realloc str/editstr and use 'maxlen' to track alloc size (maxlen + 1) */
|
||||
bool is_str_dynamic;
|
||||
@@ -2719,7 +2725,7 @@ static void ui_textedit_move(
|
||||
but->pos = but->selend = but->selsta;
|
||||
}
|
||||
}
|
||||
data->selextend = 0;
|
||||
data->selextend = EXTEND_NONE;
|
||||
}
|
||||
else {
|
||||
int pos_i = but->pos;
|
||||
@@ -2730,7 +2736,7 @@ static void ui_textedit_move(
|
||||
/* existing selection */
|
||||
if (has_sel) {
|
||||
|
||||
if (data->selextend == 0) {
|
||||
if (data->selextend == EXTEND_NONE) {
|
||||
data->selextend = EXTEND_RIGHT;
|
||||
}
|
||||
|
||||
@@ -2999,7 +3005,7 @@ static void ui_textedit_begin(bContext *C, uiBut *but, uiHandleButtonData *data)
|
||||
len = strlen(data->str);
|
||||
|
||||
data->origstr = BLI_strdupn(data->str, len);
|
||||
data->selextend = 0;
|
||||
data->selextend = EXTEND_NONE;
|
||||
data->selstartx = 0.0f;
|
||||
|
||||
/* set cursor pos to the end of the text */
|
||||
|
||||
@@ -155,14 +155,6 @@ extern const short ui_radial_dir_to_angle[8];
|
||||
#define PNL_GRID (UI_UNIT_Y / 5) /* 4 default */
|
||||
#define PNL_HEADER (UI_UNIT_Y + 4) /* 24 default */
|
||||
|
||||
/* Button text selection:
|
||||
* extension direction, selextend, inside ui_do_but_TEX */
|
||||
#define EXTEND_LEFT 1
|
||||
#define EXTEND_RIGHT 2
|
||||
|
||||
/* for scope resize zone */
|
||||
#define SCOPE_RESIZE_PAD 9
|
||||
|
||||
/* bit button defines */
|
||||
/* Bit operations */
|
||||
#define UI_BITBUT_TEST(a, b) ( ( (a) & 1 << (b) ) != 0)
|
||||
|
||||
Reference in New Issue
Block a user