mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-10 13:00:29 +03:00
LibGUI: Add TabWidget::activate_last_tab()
This commit is contained in:
parent
04b6a060ca
commit
1b7850f511
Notes:
sideshowbarker
2024-07-17 16:18:19 +09:00
Author: https://github.com/iCristalrope Commit: https://github.com/SerenityOS/serenity/commit/1b7850f511 Pull-request: https://github.com/SerenityOS/serenity/pull/13080 Reviewed-by: https://github.com/awesomekling
@ -592,6 +592,14 @@ void TabWidget::activate_previous_tab()
|
||||
set_active_widget(m_tabs.at(previous_index).widget);
|
||||
}
|
||||
|
||||
void TabWidget::activate_last_tab()
|
||||
{
|
||||
size_t number_of_tabs = m_tabs.size();
|
||||
if (number_of_tabs == 0)
|
||||
return;
|
||||
set_active_widget(m_tabs.at(number_of_tabs - 1).widget);
|
||||
}
|
||||
|
||||
void TabWidget::keydown_event(KeyEvent& event)
|
||||
{
|
||||
if (event.ctrl() && event.key() == Key_Tab) {
|
||||
|
@ -66,6 +66,7 @@ public:
|
||||
|
||||
void activate_next_tab();
|
||||
void activate_previous_tab();
|
||||
void activate_last_tab();
|
||||
|
||||
void set_text_alignment(Gfx::TextAlignment alignment) { m_text_alignment = alignment; }
|
||||
Gfx::TextAlignment text_alignment() const { return m_text_alignment; }
|
||||
|
Loading…
Reference in New Issue
Block a user