Make tab's close button responsive to touch taps

This commit is contained in:
Fredia Huya-Kouadio 2023-04-04 18:05:01 -07:00 committed by Fredia Huya-Kouadio
parent 3943de2e6c
commit de20011cbe

View file

@ -193,12 +193,14 @@ void Tabs::_gui_input(const Ref<InputEvent> &p_event) {
for (int i = offset; i <= max_drawn_tab; i++) {
if (tabs[i].rb_rect.has_point(pos)) {
rb_pressing = true;
_update_hover();
update();
return;
}
if (tabs[i].cb_rect.has_point(pos) && (cb_displaypolicy == CLOSE_BUTTON_SHOW_ALWAYS || (cb_displaypolicy == CLOSE_BUTTON_SHOW_ACTIVE_ONLY && i == current))) {
cb_pressing = true;
_update_hover();
update();
return;
}