Skip to content

Commit 14f7cbd

Browse files
committed
Add horizontal scrolling to TabBar
1 parent 825ef23 commit 14f7cbd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scene/gui/tab_bar.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ void TabBar::gui_input(const Ref<InputEvent> &p_event) {
174174
Ref<InputEventMouseButton> mb = p_event;
175175

176176
if (mb.is_valid()) {
177-
if (mb->is_pressed() && mb->get_button_index() == MouseButton::WHEEL_UP && !mb->is_command_or_control_pressed()) {
177+
if (mb->is_pressed() && (mb->get_button_index() == MouseButton::WHEEL_UP || (is_layout_rtl() ? mb->get_button_index() == MouseButton::WHEEL_RIGHT : mb->get_button_index() == MouseButton::WHEEL_LEFT)) && !mb->is_command_or_control_pressed()) {
178178
if (scrolling_enabled && buttons_visible) {
179179
if (offset > 0) {
180180
offset--;
@@ -184,7 +184,7 @@ void TabBar::gui_input(const Ref<InputEvent> &p_event) {
184184
}
185185
}
186186

187-
if (mb->is_pressed() && mb->get_button_index() == MouseButton::WHEEL_DOWN && !mb->is_command_or_control_pressed()) {
187+
if (mb->is_pressed() && (mb->get_button_index() == MouseButton::WHEEL_DOWN || mb->get_button_index() == (is_layout_rtl() ? MouseButton::WHEEL_LEFT : MouseButton::WHEEL_RIGHT)) && !mb->is_command_or_control_pressed()) {
188188
if (scrolling_enabled && buttons_visible) {
189189
if (missing_right && offset < tabs.size()) {
190190
offset++;

0 commit comments

Comments
 (0)