5#ifndef INCLUDE_FIFECHAN_WIDGETS_ICON_HPP_
6#define INCLUDE_FIFECHAN_WIDGETS_ICON_HPP_
10#include "fifechan/image.hpp"
11#include "fifechan/platform.hpp"
12#include "fifechan/widget.hpp"
21 class FIFEGUI_API Icon :
public Widget
31 explicit Icon(std::string
const & filename);
38 explicit Icon(
Image const * image);
42 Icon(Icon
const &) =
delete;
43 Icon& operator=(Icon
const &) =
delete;
44 Icon(Icon&&) =
delete;
45 Icon& operator=(Icon&&) =
delete;
53 void setImage(std::string
const & filename);
149 void adjustSizeImpl();
Abstract interface providing primitive drawing functions (lines, rectangles, etc.).
bool mOpaque
True if opaque, otherwise false.
void setTiling(bool tile)
Sets if the image should be tiled to widget size.
void adjustSize() override
Resizes the widget's size to fit the content exactly.
bool mTile
True if tiling is enabled, otherwise false.
bool mInternalImage
True if the image has been loaded internally, false otherwise.
bool isTiling() const
Gets if the image is tiled to widget size.
bool isScaling() const
Gets if the image is scaled to widget size.
void resizeToContent(bool recursion) override
Resize this widget to fit its content.
Image const * getImage() const
Gets the current image.
bool mScale
True if scaling is enabled, otherwise false.
Image const * mImage
The image to display.
void draw(Graphics *graphics) override
Draws the widget.
void setOpaque(bool opaque)
Sets the opacity of the background.
void setScaling(bool scale)
Sets if the image should be scaled to widget size.
void setImage(std::string const &filename)
Sets the image to display.
Abstract holder for image data.