mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 02:51:49 +00:00
refactor: add GUI instance reference to UI nodes
This commit is contained in:
parent
74a94f869c
commit
4c48afbb90
70 changed files with 1133 additions and 832 deletions
|
|
@ -7,10 +7,10 @@
|
|||
|
||||
using namespace gui;
|
||||
|
||||
InputBindBox::InputBindBox(Binding& binding, glm::vec4 padding)
|
||||
: Panel(glm::vec2(100,32), padding, 0),
|
||||
InputBindBox::InputBindBox(GUI& gui, Binding& binding, glm::vec4 padding)
|
||||
: Panel(gui, glm::vec2(100,32), padding, 0),
|
||||
binding(binding),
|
||||
label(std::make_shared<Label>(L"")) {
|
||||
label(std::make_shared<Label>(gui, L"")) {
|
||||
add(label);
|
||||
setScrollable(false);
|
||||
hoverColor = glm::vec4(0.05f, 0.1f, 0.2f, 0.75f);
|
||||
|
|
@ -25,7 +25,7 @@ void InputBindBox::drawBackground(const DrawContext& pctx, const Assets&) {
|
|||
label->setText(util::str2wstr_utf8(binding.text()));
|
||||
}
|
||||
|
||||
void InputBindBox::clicked(GUI*, mousecode button) {
|
||||
void InputBindBox::clicked(mousecode button) {
|
||||
if (isFocused()) {
|
||||
binding.reset(button);
|
||||
defocus();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue