Set up stacked widget.
This commit is contained in:
parent
4e85edacc8
commit
ee51f3ee09
51 changed files with 808 additions and 195 deletions
|
@ -12,16 +12,35 @@
|
|||
|
||||
class Widget
|
||||
{
|
||||
protected:
|
||||
public:
|
||||
struct BoundaryOffset{
|
||||
unsigned mLeft = 0;
|
||||
unsigned mRight = 0;
|
||||
unsigned mTop = 0;
|
||||
unsigned mBottom = 0;
|
||||
};
|
||||
|
||||
struct BoundedSize{
|
||||
unsigned mWidth = 0;
|
||||
unsigned mMaxWidth = 0;
|
||||
unsigned mMinWidth = 0;
|
||||
unsigned mHeight = 0;
|
||||
unsigned mMaxHeight = 0;
|
||||
unsigned mMinHeight = 0;
|
||||
};
|
||||
|
||||
protected:
|
||||
DiscretePoint mLocation;
|
||||
unsigned mWidth;
|
||||
unsigned mHeight;
|
||||
unsigned mMaxHeight;
|
||||
BoundedSize mSize;
|
||||
BoundaryOffset mPadding;
|
||||
BoundaryOffset mMargin;
|
||||
std::vector<VisualLayerUPtr> mMyLayers;
|
||||
std::vector<VisualLayer*> mLayers;
|
||||
std::vector<std::unique_ptr<Widget> > mChildren;
|
||||
unsigned mBorderThickness;
|
||||
ColorUPtr mBackgroundColor;
|
||||
ColorUPtr mBorderColor;
|
||||
bool mVisible;
|
||||
|
||||
public:
|
||||
|
||||
|
@ -33,11 +52,7 @@ public:
|
|||
|
||||
virtual void AddWidget(std::unique_ptr<Widget> widget);
|
||||
|
||||
unsigned GetWidth() const;
|
||||
|
||||
unsigned GetHeight() const;
|
||||
|
||||
unsigned GetMaxHeight() const;
|
||||
BoundedSize GetSize() const;
|
||||
|
||||
std::vector<VisualLayer*> GetLayers() const;
|
||||
|
||||
|
@ -53,11 +68,21 @@ public:
|
|||
|
||||
void SetBackgroundColor(ColorUPtr color);
|
||||
|
||||
void SetSize(unsigned mWidth, unsigned mHeight);
|
||||
void SetBounds(unsigned width, unsigned height);
|
||||
|
||||
void SetSize(const BoundedSize& size);
|
||||
|
||||
void SetMargin(unsigned margin);
|
||||
|
||||
void SetMargin(const BoundaryOffset& margin);
|
||||
|
||||
void SetPadding(unsigned padding);
|
||||
|
||||
void SetPadding(const BoundaryOffset& padding);
|
||||
|
||||
void SetLocation(const DiscretePoint& loc);
|
||||
|
||||
void SetMaxHeight(unsigned maxHeight);
|
||||
void SetVisible(bool visible);
|
||||
|
||||
protected:
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue