mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
the shortcut
This commit is contained in:
parent
635e512142
commit
30a38035e2
35 changed files with 90 additions and 84 deletions
35
src/graphics/ui/elements/Button.hpp
Normal file
35
src/graphics/ui/elements/Button.hpp
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
#ifndef GRAPHICS_UI_ELEMENTS_BUTTON_HPP_
|
||||
#define GRAPHICS_UI_ELEMENTS_BUTTON_HPP_
|
||||
|
||||
#include "Panel.hpp"
|
||||
|
||||
namespace gui {
|
||||
class Label;
|
||||
|
||||
class Button : public Panel {
|
||||
protected:
|
||||
std::shared_ptr<Label> label = nullptr;
|
||||
public:
|
||||
Button(std::shared_ptr<UINode> content,
|
||||
glm::vec4 padding=glm::vec4(2.0f));
|
||||
|
||||
Button(std::wstring text,
|
||||
glm::vec4 padding,
|
||||
onaction action,
|
||||
glm::vec2 size=glm::vec2(-1));
|
||||
|
||||
virtual void drawBackground(const GfxContext* pctx, Assets* assets) override;
|
||||
|
||||
virtual Align getTextAlign() const;
|
||||
virtual void setTextAlign(Align align);
|
||||
|
||||
virtual void setText(std::wstring text);
|
||||
virtual std::wstring getText() const;
|
||||
|
||||
virtual Button* textSupplier(wstringsupplier supplier);
|
||||
|
||||
virtual void refresh() override;
|
||||
};
|
||||
}
|
||||
|
||||
#endif // GRAPHICS_UI_ELEMENTS_BUTTON_HPP_
|
||||
Loading…
Add table
Add a link
Reference in a new issue