diff options
-rw-r--r-- | Applications/DisplayProperties/DisplayProperties.cpp | 4 | ||||
-rw-r--r-- | Libraries/LibGUI/GTabWidget.cpp | 8 | ||||
-rw-r--r-- | Libraries/LibGUI/GTabWidget.h | 3 |
3 files changed, 7 insertions, 8 deletions
diff --git a/Applications/DisplayProperties/DisplayProperties.cpp b/Applications/DisplayProperties/DisplayProperties.cpp index 74a1dacb7f..090a2dbd1e 100644 --- a/Applications/DisplayProperties/DisplayProperties.cpp +++ b/Applications/DisplayProperties/DisplayProperties.cpp @@ -113,7 +113,7 @@ void DisplayPropertiesWidget::create_frame() apply_button->set_size_policy(Orientation::Horizontal, SizePolicy::Fixed); apply_button->set_preferred_size(60, 22); apply_button->on_click = [this, tab_widget](GButton&) { - send_settings_to_window_server(tab_widget->get_active_tab()); + send_settings_to_window_server(tab_widget->active_tab_index()); }; auto* ok_button = new GButton(bottom_widget); @@ -122,7 +122,7 @@ void DisplayPropertiesWidget::create_frame() ok_button->set_size_policy(Orientation::Horizontal, SizePolicy::Fixed); ok_button->set_preferred_size(60, 22); ok_button->on_click = [this, tab_widget](GButton&) { - send_settings_to_window_server(tab_widget->get_active_tab()); + send_settings_to_window_server(tab_widget->active_tab_index()); GApplication::the().quit(); }; diff --git a/Libraries/LibGUI/GTabWidget.cpp b/Libraries/LibGUI/GTabWidget.cpp index 530fb7f0f8..049be01b1b 100644 --- a/Libraries/LibGUI/GTabWidget.cpp +++ b/Libraries/LibGUI/GTabWidget.cpp @@ -209,13 +209,11 @@ void GTabWidget::set_tab_position(TabPosition tab_position) update(); } -int GTabWidget::get_active_tab() const +int GTabWidget::active_tab_index() const { - for(int i = 0; i < m_tabs.size(); i++) - { - if(m_tabs.at(i).widget == m_active_widget) + for (int i = 0; i < m_tabs.size(); i++) { + if (m_tabs.at(i).widget == m_active_widget) return i; } - return -1; } diff --git a/Libraries/LibGUI/GTabWidget.h b/Libraries/LibGUI/GTabWidget.h index 395b238b3d..22bf13b985 100644 --- a/Libraries/LibGUI/GTabWidget.h +++ b/Libraries/LibGUI/GTabWidget.h @@ -15,7 +15,8 @@ public: TabPosition tab_position() const { return m_tab_position; } void set_tab_position(TabPosition); - int get_active_tab() const; + + int active_tab_index() const; GWidget* active_widget() const { return m_active_widget; } void set_active_widget(GWidget*); |