Changeset - r25317:845aee38c395
[Not reviewed]
master
0 2 0
Peter Nelson - 3 years ago 2021-04-22 00:18:22
peter1138@openttd.org
Cleanup: Horizontal widget size is commonly width rather than length.
2 files changed with 4 insertions and 4 deletions:
0 comments (0 inline, 0 general)
src/widget.cpp
Show inline comments
 
@@ -1494,30 +1494,30 @@ void NWidgetVertical::AssignSizePosition
 
	uint position = 0; // Place to put next child relative to origin of the container.
 
	for (NWidgetBase *child_wid = this->head; child_wid != nullptr; child_wid = child_wid->next) {
 
		uint child_x = x + (rtl ? child_wid->padding_right : child_wid->padding_left);
 
		uint child_height = child_wid->current_y;
 

	
 
		child_wid->AssignSizePosition(sizing, child_x, y + position + child_wid->padding_top, child_wid->current_x, child_height, rtl);
 
		position += child_height + child_wid->padding_top + child_wid->padding_bottom;
 
	}
 
}
 

	
 
/**
 
 * Generic spacer widget.
 
 * @param length Horizontal size of the spacer widget.
 
 * @param width  Horizontal size of the spacer widget.
 
 * @param height Vertical size of the spacer widget.
 
 */
 
NWidgetSpacer::NWidgetSpacer(int length, int height) : NWidgetResizeBase(NWID_SPACER, 0, 0)
 
NWidgetSpacer::NWidgetSpacer(int width, int height) : NWidgetResizeBase(NWID_SPACER, 0, 0)
 
{
 
	this->SetMinimalSize(length, height);
 
	this->SetMinimalSize(width, height);
 
	this->SetResize(0, 0);
 
}
 

	
 
void NWidgetSpacer::SetupSmallestSize(Window *w, bool init_array)
 
{
 
	this->smallest_x = this->min_x;
 
	this->smallest_y = this->min_y;
 
}
 

	
 
void NWidgetSpacer::FillNestedArray(NWidgetBase **array, uint length)
 
{
 
}
src/widget_type.h
Show inline comments
 
@@ -534,25 +534,25 @@ private:
 
	int widgets_y;  ///< The number of visible widgets in vertical direction.
 

	
 
	void GetScrollOffsets(int &start_x, int &start_y, int &base_offs_x, int &base_offs_y);
 
};
 

	
 

	
 
/**
 
 * Spacer widget.
 
 * @ingroup NestedWidgets
 
 */
 
class NWidgetSpacer : public NWidgetResizeBase {
 
public:
 
	NWidgetSpacer(int length, int height);
 
	NWidgetSpacer(int width, int height);
 

	
 
	void SetupSmallestSize(Window *w, bool init_array) override;
 
	void FillNestedArray(NWidgetBase **array, uint length) override;
 

	
 
	void Draw(const Window *w) override;
 
	void SetDirty(const Window *w) const override;
 
	NWidgetCore *GetWidgetFromPos(int x, int y) override;
 
};
 

	
 
/**
 
 * Nested widget with a child.
 
 * @ingroup NestedWidgets
0 comments (0 inline, 0 general)