pointer_shape_when_dragging option + set_mouse_cursor_when_dragging()
This commit is contained in:
parent
03ac6cab99
commit
b13174cb9c
@ -581,6 +581,11 @@ The default shape of the mouse pointer.
|
|||||||
Valid values are: :code:`arrow`, :code:`beam` and :code:`hand`
|
Valid values are: :code:`arrow`, :code:`beam` and :code:`hand`
|
||||||
'''))
|
'''))
|
||||||
|
|
||||||
|
o('pointer_shape_when_dragging', 'beam', option_type=choices('arrow', 'beam', 'hand'), long_text=('''
|
||||||
|
The default shape of the mouse pointer when dragging across text.
|
||||||
|
Valid values are: :code:`arrow`, :code:`beam` and :code:`hand`
|
||||||
|
'''))
|
||||||
|
|
||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
g('performance') # {{{
|
g('performance') # {{{
|
||||||
|
|||||||
@ -195,6 +195,14 @@ cell_for_pos(Window *w, unsigned int *x, unsigned int *y, bool *in_left_half_of_
|
|||||||
|
|
||||||
#define HANDLER(name) static inline void name(Window UNUSED *w, int UNUSED button, int UNUSED modifiers, unsigned int UNUSED window_idx)
|
#define HANDLER(name) static inline void name(Window UNUSED *w, int UNUSED button, int UNUSED modifiers, unsigned int UNUSED window_idx)
|
||||||
|
|
||||||
|
static inline void
|
||||||
|
set_mouse_cursor_when_dragging(void) {
|
||||||
|
if (mouse_cursor_shape != OPT(pointer_shape_when_dragging)) {
|
||||||
|
mouse_cursor_shape = OPT(pointer_shape_when_dragging);
|
||||||
|
set_mouse_cursor(mouse_cursor_shape);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
update_drag(bool from_button, Window *w, bool is_release, int modifiers) {
|
update_drag(bool from_button, Window *w, bool is_release, int modifiers) {
|
||||||
Screen *screen = w->render_data.screen;
|
Screen *screen = w->render_data.screen;
|
||||||
@ -213,6 +221,7 @@ update_drag(bool from_button, Window *w, bool is_release, int modifiers) {
|
|||||||
} else if (screen->selections.in_progress) {
|
} else if (screen->selections.in_progress) {
|
||||||
screen_update_selection(screen, w->mouse_pos.cell_x, w->mouse_pos.cell_y, w->mouse_pos.in_left_half_of_cell, false, false);
|
screen_update_selection(screen, w->mouse_pos.cell_x, w->mouse_pos.cell_y, w->mouse_pos.in_left_half_of_cell, false, false);
|
||||||
}
|
}
|
||||||
|
set_mouse_cursor_when_dragging();
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline bool
|
static inline bool
|
||||||
@ -250,6 +259,7 @@ extend_selection(Window *w, bool ended) {
|
|||||||
if (screen_has_selection(screen)) {
|
if (screen_has_selection(screen)) {
|
||||||
screen_update_selection(screen, w->mouse_pos.cell_x, w->mouse_pos.cell_y, w->mouse_pos.in_left_half_of_cell, ended, false);
|
screen_update_selection(screen, w->mouse_pos.cell_x, w->mouse_pos.cell_y, w->mouse_pos.in_left_half_of_cell, ended, false);
|
||||||
}
|
}
|
||||||
|
set_mouse_cursor_when_dragging();
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
@ -397,6 +407,7 @@ multi_click(Window *w, unsigned int count) {
|
|||||||
screen_start_selection(screen, w->mouse_pos.cell_x, w->mouse_pos.cell_y, w->mouse_pos.in_left_half_of_cell, false, mode);
|
screen_start_selection(screen, w->mouse_pos.cell_x, w->mouse_pos.cell_y, w->mouse_pos.in_left_half_of_cell, false, mode);
|
||||||
screen_update_selection(screen, w->mouse_pos.cell_x, w->mouse_pos.cell_y, w->mouse_pos.in_left_half_of_cell, false, true);
|
screen_update_selection(screen, w->mouse_pos.cell_x, w->mouse_pos.cell_y, w->mouse_pos.in_left_half_of_cell, false, true);
|
||||||
}
|
}
|
||||||
|
set_mouse_cursor_when_dragging();
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline double
|
static inline double
|
||||||
|
|||||||
@ -704,6 +704,7 @@ PYWRAP1(set_options) {
|
|||||||
S(allow_hyperlinks, PyObject_IsTrue);
|
S(allow_hyperlinks, PyObject_IsTrue);
|
||||||
S(pointer_shape_when_grabbed, pointer_shape);
|
S(pointer_shape_when_grabbed, pointer_shape);
|
||||||
S(default_pointer_shape, pointer_shape);
|
S(default_pointer_shape, pointer_shape);
|
||||||
|
S(pointer_shape_when_dragging, pointer_shape);
|
||||||
|
|
||||||
GA(tab_bar_style);
|
GA(tab_bar_style);
|
||||||
global_state.tab_bar_hidden = PyUnicode_CompareWithASCIIString(ret, "hidden") == 0 ? true: false;
|
global_state.tab_bar_hidden = PyUnicode_CompareWithASCIIString(ret, "hidden") == 0 ? true: false;
|
||||||
|
|||||||
@ -67,6 +67,7 @@ typedef struct {
|
|||||||
monotonic_t resize_debounce_time;
|
monotonic_t resize_debounce_time;
|
||||||
MouseShape pointer_shape_when_grabbed;
|
MouseShape pointer_shape_when_grabbed;
|
||||||
MouseShape default_pointer_shape;
|
MouseShape default_pointer_shape;
|
||||||
|
MouseShape pointer_shape_when_dragging;
|
||||||
struct {
|
struct {
|
||||||
UrlPrefix *values;
|
UrlPrefix *values;
|
||||||
size_t num, max_prefix_len;
|
size_t num, max_prefix_len;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user