8#include "fifechan/graphics.hpp"
9#include "fifechan/widgets/activitybar.hpp"
10#include "fifechan/widgets/togglebutton.hpp"
47 mActionListeners.push_back(listener);
54 mActionListeners.remove(listener);
61 if (toggle !=
nullptr) {
62 toggle->setSelected(
true);
71 if (toggle !=
nullptr) {
72 toggle->setSelected(
false);
110 for (
auto* listener : mActionListeners) {
111 listener->action(event);
Represents an action trigger (e.g., button click).
void hideAll()
Hides all panels (toggles all buttons to unselected state).
void showAll()
Shows all panels (toggles all buttons to selected state).
void addActionListener(ActionListener *listener)
Adds an action listener to the activity bar.
void resizeToContent(bool recursion=true) override
Resizes the widget's size to fit the content exactly, calls recursively all childs.
void adjustSize() override
Resizes the widget's size to fit the content exactly.
ActivityBar(int width=48)
Constructor.
void setSpacing(unsigned int spacing)
Sets the spacing between items.
void removeActionListener(ActionListener *listener)
Removes an action listener from the activity bar.
unsigned int getSpacing() const
Gets the spacing between items.
void setWidth(int width) override
Sets the width of the activity bar.
void action(ActionEvent const &event) override
Handles an action event emitted by a widget.
int getWidth() const
Gets the width of the activity bar.
void draw(Graphics *graphics) override
Draws the widget.
void draw(Graphics *graphics) override
Draws the widget.
virtual void setLayout(LayoutPolicy policy)
Sets the layout of the container.
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 setVerticalSpacing(unsigned int spacing)
Set the vertical spacing between rows.
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.
Represents a rectangular area (X, Y, Width, Height).
Used replacement tokens by configure_file():