Preferences: remove tweak/drag threshold distinction

Currently the preferences have both tweak and drag threshold,
this is confusing because most actions users would consider
dragging use the 'tweak' setting.

Now one drag threshold is used for both, with a maximum limit of half
the button unit-size in case of dragging UI elements.
This commit is contained in:
2019-02-11 15:34:19 +11:00
parent 1daaa74b08
commit 43156d8304
7 changed files with 21 additions and 13 deletions

View File

@@ -157,6 +157,16 @@ void ui_block_to_window_rctf(const ARegion *ar, uiBlock *block, rctf *rct_dst, c
ui_block_to_window_fl(ar, block, &rct_dst->xmax, &rct_dst->ymax);
}
float ui_block_to_window_scale(const ARegion *ar, uiBlock *block)
{
/* We could have function for this to avoid dummy arg. */
float dummy_x;
float min_y = 0, max_y = 1;
ui_block_to_window_fl(ar, block, &dummy_x, &min_y);
ui_block_to_window_fl(ar, block, &dummy_x, &max_y);
return max_y - min_y;
}
/* for mouse cursor */
void ui_window_to_block_fl(const ARegion *ar, uiBlock *block, float *x, float *y)
{