8#include "fifechan/widgets/horizontalbar.hpp"
85 if (child ==
nullptr || !child->isVisible()) {
88 int const childEnd = child->getX() + child->getWidth() + child->getMarginRight();
89 contentW = std::max(contentW, childEnd);
92 if (contentW > 0 && contentW <
getWidth()) {
121 if (child ==
nullptr || !child->isVisible()) {
124 int const childEnd = child->getX() + child->getWidth() + child->getMarginRight();
125 contentW = std::max(contentW, childEnd);
128 if (contentW > 0 && contentW <
getWidth()) {
virtual bool isUniformSize() const
True if the container tries to expand the childs to a uniform size.
void draw(Graphics *graphics) override
Draws the widget.
virtual void setLayout(LayoutPolicy policy)
Sets the layout of the container.
virtual void setHorizontalSpacing(unsigned int spacing)
Set the horizontal spacing between columns.
void resizeToContent(bool recursion=true) override
Resize this container to fit its children.
virtual bool isOpaque() const
Checks if the container is opaque or not.
virtual void setUniformSize(bool uniform)
If enabled, the free space is distributed in a way that the size of the childrens will be equal (if p...
void adjustSize() override
Adjust the size of the container after layout computations.
virtual void setOpaque(bool opaque)
Sets the container to be opaque or not.
Abstract interface providing primitive drawing functions (lines, rectangles, etc.).
virtual void drawLine(int x1, int y1, int x2, int y2)=0
Draws a line.
virtual void setColor(Color const &color)=0
Sets the color to use when drawing.
virtual void fillRectangle(Rectangle const &rectangle)=0
Draws a filled rectangle.
unsigned int getFixedHeight() const
Gets the fixed height of the bar.
unsigned int mFixedHeight
Fixed height (0 = content-driven).
bool isExpandChildren() const
Checks if children expand to fill available width.
HorizontalBar()
Constructor.
unsigned int mSpacing
Spacing between children.
unsigned int mPadding
Padding around the bar content.
void setSpacing(unsigned int spacing)
Sets the spacing between children.
void draw(Graphics *graphics) override
Draws the widget.
bool mExpandChildren
Whether children should expand to fill width.
bool mClipping
Whether to clip overflowing content.
void setExpandChildren(bool expand)
Sets whether children should expand to fill available width.
void setClipping(bool clip)
Sets the overflow policy.
unsigned int getSpacing() const
Gets the spacing between children.
bool isClipping() const
Checks if overflowing children are clipped.
void setFixedHeight(unsigned int height)
Sets the default height of the bar.
void setPadding(unsigned int padding)
Sets the padding around the bar content.
unsigned int getPadding() const
Gets the padding around the bar content.
void adjustSize() override
Adjust the size of the container after layout computations.
void resizeToContent(bool recursion=true) override
Resize this container to fit its children.
Represents a rectangular area (X, Y, Width, Height).
Used replacement tokens by configure_file():