UI: Anchor Right When Double-Clicking Last Word
In UI text inputs, when double-clicking to select words, anchor (set initial selection position) to the right if on the last word. This aids in some combined double-click-drag operations. Pull Request: https://projects.blender.org/blender/blender/pulls/113125
This commit is contained in:
committed by
Harley Acheson
parent
eda7926834
commit
8a2e81b16b
@@ -3803,7 +3803,8 @@ static void ui_do_but_textedit(
|
||||
but->pos = short(selend);
|
||||
but->selsta = short(selsta);
|
||||
but->selend = short(selend);
|
||||
data->sel_pos_init = selsta;
|
||||
/* Anchor selection to the left side unless the last word. */
|
||||
data->sel_pos_init = ((selend == strlen(data->str)) && (selsta != 0)) ? selend : selsta;
|
||||
retval = WM_UI_HANDLER_BREAK;
|
||||
changed = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user