Changeset - r28065:cf0d1fa0fc61
[Not reviewed]
master
0 2 0
Peter Nelson - 13 months ago 2023-11-01 20:12:08
peter1138@openttd.org
Codechange: Call Widget::SetDirty/SetLowered directly. (#11417)

In these instances we already have the widget to hand, so don't need to look it up by index again.
2 files changed with 4 insertions and 4 deletions:
0 comments (0 inline, 0 general)
src/widgets/dropdown.cpp
Show inline comments
 
@@ -438,9 +438,9 @@ void ShowDropDownList(Window *w, DropDow
 
	if ((nwi->type & WWT_MASK) == NWID_BUTTON_DROPDOWN) {
 
		nwi->disp_flags |= ND_DROPDOWN_ACTIVE;
 
	} else {
 
		w->LowerWidget(button);
 
		nwi->SetLowered(true);
 
	}
 
	w->SetWidgetDirty(button);
 
	nwi->SetDirty(w);
 

	
 
	if (width != 0) {
 
		if (_current_text_dir == TD_RTL) {
src/window.cpp
Show inline comments
 
@@ -228,7 +228,7 @@ void Window::DisableAllWidgetHighlight()
 

	
 
		if (nwid->IsHighlighted()) {
 
			nwid->SetHighlighted(TC_INVALID);
 
			this->SetWidgetDirty(i);
 
			nwid->SetDirty(this);
 
		}
 
	}
 

	
 
@@ -248,7 +248,7 @@ void Window::SetWidgetHighlight(byte wid
 
	if (nwid == nullptr) return;
 

	
 
	nwid->SetHighlighted(highlighted_colour);
 
	this->SetWidgetDirty(widget_index);
 
	nwid->SetDirty(this);
 

	
 
	if (highlighted_colour != TC_INVALID) {
 
		/* If we set a highlight, the window has a highlight */
0 comments (0 inline, 0 general)