5#include "fifechan/widgets/tab.hpp"
7#include "fifechan/font.hpp"
8#include "fifechan/graphics.hpp"
9#include "fifechan/widgets/tabbedarea.hpp"
16 setLayout(Container::LayoutPolicy::Horizontal);
20 Tab::~Tab() =
default;
54 Color highlightColor = faceColor + 0x303030;
55 highlightColor.
a = alpha;
56 Color shadowColor = faceColor - 0x303030;
57 shadowColor.
a = alpha;
A rectangle specifically used for clipping rendering regions.
uint8_t a
Alpha color component (0-255).
virtual void setLayout(LayoutPolicy policy)
Sets the layout of the container.
void adjustSize() override
Adjust the size of the container after layout computations.
Abstract interface providing primitive drawing functions (lines, rectangles, etc.).
virtual void popClipArea()
Removes the top most clip area from the stack.
virtual ClipRectangle const & getCurrentClipArea()
Gets the current clip area.
virtual bool pushClipArea(Rectangle area)
Pushes a clip area onto the stack.
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 drawRectangle(Rectangle const &rectangle)=0
Draws a simple, non-filled rectangle with a one pixel width.
virtual void fillRectangle(Rectangle const &rectangle)=0
Draws a filled rectangle.
Represents a mouse event.
Represents a rectangular area (X, Y, Width, Height).
int width
Holds the width of the rectangle.
int y
Holds the x coordinate of the rectangle.
int x
Holds the x coordinate of the rectangle.
int height
Holds the height of the rectangle.
Rectangle getChildrenArea() override
Gets the area of the widget occupied by the widget's children.
bool mHasMouse
True if the tab has the mouse, false otherwise.
void mouseExited(MouseEvent &mouseEvent) override
Called when the mouse has exited the widget area.
void setTabbedArea(TabbedArea *tabbedArea)
Sets the tabbed area the tab should be a part of.
void adjustSize() override
Adjusts the size of the tab to fit the caption.
void mouseEntered(MouseEvent &mouseEvent) override
Called when the mouse has entered into the widget area.
TabbedArea * mTabbedArea
Holds the tabbed area the tab is a part of.
TabbedArea * getTabbedArea()
Gets the tabbed are the tab is a part of.
void draw(Graphics *graphics) override
Draws the widget.
A container organizing content into selectable tabs.