Codechange: Replace mishmash of types for widget index with WidgetID.
Indices were stored as int, but often passed around as uint/uint8_t and casts. Now they should all use WidgetID.
This commit is contained in:

committed by
Peter Nelson

parent
fd84f73323
commit
a0dfb76e34
@@ -126,7 +126,7 @@ uint TextfileWindow::GetContentHeight()
|
||||
return this->lines.back().bottom;
|
||||
}
|
||||
|
||||
/* virtual */ void TextfileWindow::UpdateWidgetSize(int widget, Dimension *size, [[maybe_unused]] const Dimension &padding, [[maybe_unused]] Dimension *fill, [[maybe_unused]] Dimension *resize)
|
||||
/* virtual */ void TextfileWindow::UpdateWidgetSize(WidgetID widget, Dimension *size, [[maybe_unused]] const Dimension &padding, [[maybe_unused]] Dimension *fill, [[maybe_unused]] Dimension *resize)
|
||||
{
|
||||
switch (widget) {
|
||||
case WID_TF_BACKGROUND:
|
||||
@@ -516,7 +516,7 @@ void TextfileWindow::AfterLoadMarkdown()
|
||||
}
|
||||
}
|
||||
|
||||
/* virtual */ void TextfileWindow::OnClick([[maybe_unused]] Point pt, int widget, [[maybe_unused]] int click_count)
|
||||
/* virtual */ void TextfileWindow::OnClick([[maybe_unused]] Point pt, WidgetID widget, [[maybe_unused]] int click_count)
|
||||
{
|
||||
switch (widget) {
|
||||
case WID_TF_WRAPTEXT:
|
||||
@@ -548,7 +548,7 @@ void TextfileWindow::AfterLoadMarkdown()
|
||||
}
|
||||
}
|
||||
|
||||
/* virtual */ void TextfileWindow::DrawWidget(const Rect &r, int widget) const
|
||||
/* virtual */ void TextfileWindow::DrawWidget(const Rect &r, WidgetID widget) const
|
||||
{
|
||||
if (widget != WID_TF_BACKGROUND) return;
|
||||
|
||||
@@ -592,7 +592,7 @@ void TextfileWindow::AfterLoadMarkdown()
|
||||
this->SetupScrollbars(true);
|
||||
}
|
||||
|
||||
void TextfileWindow::OnDropdownSelect(int widget, int index)
|
||||
void TextfileWindow::OnDropdownSelect(WidgetID widget, int index)
|
||||
{
|
||||
if (widget != WID_TF_JUMPLIST) return;
|
||||
|
||||
|
Reference in New Issue
Block a user