Skip to content
Snippets Groups Projects
Commit b9832c25 authored by Sebastian Hahta's avatar Sebastian Hahta
Browse files

fix occluded windows

parent 59249f66
Branches
No related tags found
1 merge request!316Resolves #343 GUI and Frame Refactor
...@@ -127,6 +127,10 @@ void Screen::setView(ftl::gui2::View *view) { ...@@ -127,6 +127,10 @@ void Screen::setView(ftl::gui2::View *view) {
view->setTheme(themes_["windowtheme"]); view->setTheme(themes_["windowtheme"]);
view->setVisible(true); view->setVisible(true);
if (childIndex(view) == -1) {
addChild(view);
}
if (active_view_) { if (active_view_) {
active_view_->setVisible(false); active_view_->setVisible(false);
...@@ -141,6 +145,10 @@ void Screen::setView(ftl::gui2::View *view) { ...@@ -141,6 +145,10 @@ void Screen::setView(ftl::gui2::View *view) {
removeChild(active_view_); removeChild(active_view_);
} }
// all windows should be in front of new view
mChildren.erase(std::remove(mChildren.begin(), mChildren.end(), view), mChildren.end());
mChildren.insert(mChildren.begin(), view);
active_view_ = view; active_view_ = view;
LOG(INFO) << "number of children (Screen): "<< mChildren.size(); LOG(INFO) << "number of children (Screen): "<< mChildren.size();
performLayout(); performLayout();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment