cecd34301d Delay load DPI-related functions bfc172f702 Added exception to some unimplemented functions 7c8d469bcb Added item modifications functions 847d0e6d9e Improved keyboard navigation 8c4270e0f8 Dropdown can now be closed by re-selecting it 91402c31ec Fix dropdown positioning in x11 and win32 git-subtree-dir: libraries/ZWidget git-subtree-split: cecd34301d369400227eb0f27bad2ab41ad756d2
31 lines
592 B
C++
31 lines
592 B
C++
|
|
#pragma once
|
|
|
|
#include "../../core/widget.h"
|
|
|
|
enum class ToolbarDirection
|
|
{
|
|
Horizontal,
|
|
Vertical
|
|
};
|
|
|
|
class ToolbarButton;
|
|
|
|
class Toolbar : public Widget
|
|
{
|
|
public:
|
|
Toolbar(Widget* parent);
|
|
~Toolbar();
|
|
|
|
void SetDirection(ToolbarDirection direction);
|
|
ToolbarDirection GetDirection(ToolbarDirection) const { return direction; }
|
|
|
|
ToolbarButton* AddButton(std::string icon, std::string text, std::function<void()> onClicked = {});
|
|
|
|
protected:
|
|
void OnGeometryChanged() override;
|
|
|
|
private:
|
|
ToolbarDirection direction = ToolbarDirection::Horizontal;
|
|
std::vector<ToolbarButton*> buttons;
|
|
};
|