diff options
Diffstat (limited to 'src/gui/widgets/tabbedarea.cpp')
-rw-r--r-- | src/gui/widgets/tabbedarea.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/gui/widgets/tabbedarea.cpp b/src/gui/widgets/tabbedarea.cpp index c0d070cf..970a5cb1 100644 --- a/src/gui/widgets/tabbedarea.cpp +++ b/src/gui/widgets/tabbedarea.cpp @@ -156,6 +156,19 @@ void TabbedArea::logic() logicChildren(); } +void TabbedArea::mousePressed(gcn::MouseEvent &mouseEvent) +{ + if (mouseEvent.getButton() == gcn::MouseEvent::LEFT) + { + gcn::Widget *widget = mTabContainer->getWidgetAt(mouseEvent.getX(), + mouseEvent.getY()); + gcn::Tab *tab = dynamic_cast<gcn::Tab*>(widget); + + if (tab) + setSelectedTab(tab); + } +} + void TabbedArea::setSelectedTab(gcn::Tab *tab) { gcn::TabbedArea::setSelectedTab(tab); |