Welcome: Rename m_initial_tip_index=>m_tip_index

This commit is contained in:
thankyouverycool 2023-01-29 09:59:11 -05:00 committed by Linus Groh
parent 883abffa25
commit 4b8bae8151
Notes: sideshowbarker 2024-07-17 00:59:44 +09:00
2 changed files with 7 additions and 7 deletions

View file

@ -48,10 +48,10 @@ ErrorOr<void> WelcomeWidget::create_widgets()
m_tip_frame->set_visible(true);
if (m_tips.is_empty())
return;
m_initial_tip_index++;
if (m_initial_tip_index >= m_tips.size())
m_initial_tip_index = 0;
m_tip_label->set_text(m_tips[m_initial_tip_index].to_deprecated_string());
m_tip_index++;
if (m_tip_index >= m_tips.size())
m_tip_index = 0;
m_tip_label->set_text(m_tips[m_tip_index].to_deprecated_string());
};
m_help_button = find_descendant_of_type_named<GUI::Button>("help_button");
@ -114,8 +114,8 @@ void WelcomeWidget::set_random_tip()
if (m_tips.is_empty())
return;
m_initial_tip_index = get_random_uniform(m_tips.size());
m_tip_label->set_text(m_tips[m_initial_tip_index].to_deprecated_string());
m_tip_index = get_random_uniform(m_tips.size());
m_tip_label->set_text(m_tips[m_tip_index].to_deprecated_string());
}
void WelcomeWidget::paint_event(GUI::PaintEvent& event)

View file

@ -38,6 +38,6 @@ private:
RefPtr<GUI::CheckBox> m_startup_checkbox;
RefPtr<WebView::OutOfProcessWebView> m_web_view;
size_t m_initial_tip_index { 0 };
size_t m_tip_index { 0 };
Vector<String> m_tips;
};