5#include <fifechan/widgets/iconprogressbar.hpp>
7#include <fifechan/exception.hpp>
8#include <fifechan/graphics.hpp>
9#include <fifechan/image.hpp>
28 IconProgressBar::~IconProgressBar()
42 ((
getSelectionMode() & Widget::SelectionMode::Background) == Widget::SelectionMode::Background)) {
55 if (active && (
getSelectionMode() & Widget::SelectionMode::Border) == Widget::SelectionMode::Border) {
121 if (orientation != Orientation::Horizontal && orientation != Orientation::Vertical) {
122 throwException(
"Unknown orientation type in IconProgressBar object");
157 static_cast<void>(recursion);
Abstract interface providing primitive drawing functions (lines, rectangles, etc.).
virtual void drawImage(Image const *image, int srcX, int srcY, int dstX, int dstY, int width, int height)=0
Draws a part of an image.
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.
void adjustSizeImpl()
Adjusts the size of the IconProgressBar to fit the icons.
void setOpaque(bool opaque)
Sets the opacity of the IconProgressBar.
void setIconCount(int icons)
Sets count of icons.
IconProgressBar()
Default constructor.
void advance()
Advances the progress bar to use one more icon.
Orientation mOrientation
IconProgressBar's orientation.
void setMaxIcons(int maxIcons)
Sets count of icons when the progress bar is full.
Image const * mImage
Image used by the progress bar.
void setImage(Image *image)
Sets the IconProgressBar's image.
void resizeToContent()
Resizes the widget's size to fit the content exactly, calls recursively all childs.
int mMaxIcons
Count of icons when progress bar is full.
int mIconCounter
Holds how many icons are currently displayed.
void setOrientation(Orientation orientation)
Sets the IconProgressBar's orientation.
void reset()
Resets the progress bar.
Orientation getOrientation() const
void draw(Graphics *graphics) override
Draws this IconProgressBar.
bool mOpaque
True if the widget is opaque, false otherwise.
void adjustSize() override
Resizes the widget's size to fit the content exactly.
Orientation
Orientation of the IconProgressBar (horizontal or vertical).
Image const * getImage() const
bool mInternalImage
True if the image has been loaded internally, false otherwise.
Abstract holder for image data.