mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 10:31:50 +00:00
fix: temporary focus fix
This commit is contained in:
parent
43acc3ae89
commit
9fa6070cce
2 changed files with 3 additions and 1 deletions
|
|
@ -260,7 +260,7 @@ void GUI::act(float delta, const glm::uvec2& vp) {
|
|||
hover = nullptr;
|
||||
}
|
||||
}
|
||||
if (focus) {
|
||||
if (focus && focusedOnStart == focus.get()) {
|
||||
actFocused();
|
||||
}
|
||||
if (focus && !focus->isFocused()) {
|
||||
|
|
@ -274,6 +274,7 @@ void GUI::postAct() {
|
|||
postRunnables.pop();
|
||||
callback();
|
||||
}
|
||||
focusedOnStart = focus.get();
|
||||
}
|
||||
|
||||
void GUI::draw(const DrawContext& pctx, Assets& assets) {
|
||||
|
|
|
|||
|
|
@ -72,6 +72,7 @@ namespace gui {
|
|||
std::shared_ptr<UINode> hover;
|
||||
std::shared_ptr<UINode> pressed;
|
||||
std::shared_ptr<UINode> focus;
|
||||
const UINode* focusedOnStart = nullptr;
|
||||
std::shared_ptr<UINode> tooltip;
|
||||
std::shared_ptr<UiDocument> rootDocument;
|
||||
std::unique_ptr<FontStylesScheme> syntaxColorScheme;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue