Merge pull request #113521 from KoBeWi/switch_on_release_not_debug
Make dock tabs switch on button release
This commit is contained in:
@@ -223,7 +223,7 @@ void TabBar::gui_input(const Ref<InputEvent> &p_event) {
|
||||
}
|
||||
}
|
||||
|
||||
if (mb->is_pressed()) {
|
||||
if (mb->is_pressed() != switch_on_release) {
|
||||
Point2 pos = mb->get_position();
|
||||
bool selecting = mb->get_button_index() == MouseButton::LEFT || (select_with_rmb && mb->get_button_index() == MouseButton::RIGHT);
|
||||
|
||||
|
||||
@@ -119,6 +119,7 @@ private:
|
||||
|
||||
bool select_with_rmb = false;
|
||||
bool deselect_enabled = false;
|
||||
bool switch_on_release = false;
|
||||
|
||||
int cb_hover = -1;
|
||||
bool cb_pressing = false;
|
||||
@@ -329,6 +330,8 @@ public:
|
||||
void set_max_tab_width(int p_width);
|
||||
int get_max_tab_width() const;
|
||||
|
||||
void set_switch_on_release(bool p_switch) { switch_on_release = p_switch; }
|
||||
|
||||
Rect2 get_tab_rect(int p_tab) const;
|
||||
Size2 get_minimum_size() const override;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user