5#include "fifechan/widgets/activitybaritem.hpp"
12#include "fifechan/widgets/label.hpp"
13#include "fifechan/widgets/tooltip.hpp"
25 mPanel->addWidgetListener(
this);
29 ActivityBarItem::~ActivityBarItem()
41 mPanel->removeWidgetListener(
this);
48 mPanel->addWidgetListener(
this);
100 int const tooltipX =
getWidth() + 5;
101 int const tooltipY = 0;
131 mPanel->setVisible(selected);
148 mPanel->setVisible(visible);
void toggleSelected() override
Toggles the check box between being selected and not being selected.
std::unique_ptr< Tooltip > mTooltipWidget
Tooltip widget instance (lazily created).
void widgetShown(Event const &event) override
Invoked when a widget is shown, i.e it's set to be visible.
Widget * getPanel() const
Gets the target panel that this item controls.
void setPanel(Widget *panel)
Sets the target panel that this item controls.
std::string const & getTooltip() const
Gets the tooltip text for this activity bar item.
std::string mTooltip
Tooltip text for this item.
void setTooltip(std::string const &tooltip)
Sets the tooltip text for this activity bar item.
void setPanelVisible(bool visible)
Sets the panel visibility and updates button state accordingly.
void setSize(int size)
Sets the default size for activity bar items.
void setSelected(bool selected) override
Sets the check box to be selected or not.
int mSize
Default size for items.
int getSize() const
Gets the default size.
void widgetHidden(Event const &event) override
Invoked when a widget is hidden, i.e it's set to be not visible.
ActivityBarItem(std::string const &icon, std::string const &tooltip="", Widget *panel=nullptr)
Constructor.
Widget * mPanel
Panel that this item controls.
void mouseEntered(MouseEvent &mouseEvent) override
Called when the mouse has entered into the widget area.
void mouseExited(MouseEvent &mouseEvent) override
Called when the mouse has exited the widget area.
Base class for all GUI event objects.
Widget * getSource() const
Gets the source widget of the event.
Represents a mouse event.
Used replacement tokens by configure_file():