Codechange: Use unified NWidgetContainer methods instead of duplicating.
Most NWidgetContainer derivatives implemented Draw() and GetWidgetFromPos() the same way. Move this these to NWidgetContainer itself to avoid repeating.
This commit is contained in:

committed by
Peter Nelson

parent
af41c5cb4e
commit
59a2abd298
@@ -412,6 +412,9 @@ public:
|
||||
void Add(NWidgetBase *wid);
|
||||
void FillNestedArray(NWidgetBase **array, uint length) override;
|
||||
|
||||
void Draw(const Window *w) override;
|
||||
NWidgetCore *GetWidgetFromPos(int x, int y) override;
|
||||
|
||||
/** Return whether the container is empty. */
|
||||
inline bool IsEmpty() { return head == nullptr; }
|
||||
|
||||
@@ -480,9 +483,6 @@ public:
|
||||
void AdjustPaddingForZoom() override;
|
||||
void SetPIP(uint8_t pip_pre, uint8_t pip_inter, uint8_t pip_post);
|
||||
|
||||
void Draw(const Window *w) override;
|
||||
NWidgetCore *GetWidgetFromPos(int x, int y) override;
|
||||
|
||||
protected:
|
||||
NWidContainerFlags flags; ///< Flags of the container.
|
||||
uint8_t pip_pre; ///< Amount of space before first widget.
|
||||
|
Reference in New Issue
Block a user