mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-07 03:51:50 +00:00
add 'select' element (WIP)
This commit is contained in:
parent
f473df33fb
commit
3571d0c902
4 changed files with 91 additions and 3 deletions
26
src/graphics/ui/elements/SelectBox.hpp
Normal file
26
src/graphics/ui/elements/SelectBox.hpp
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
#pragma once
|
||||
|
||||
#include "Button.hpp"
|
||||
|
||||
namespace gui {
|
||||
class Label;
|
||||
|
||||
class SelectBox : public Button {
|
||||
public:
|
||||
struct Element {
|
||||
std::string value;
|
||||
std::wstring text;
|
||||
};
|
||||
private:
|
||||
std::vector<Element> elements;
|
||||
Element selected {};
|
||||
public:
|
||||
SelectBox(
|
||||
GUI& gui,
|
||||
std::vector<Element>&& elements,
|
||||
Element selected,
|
||||
int contentWidth,
|
||||
const glm::vec4& padding
|
||||
);
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue