Expose topShownLayer from LayerStackWidget/LaayerManager.
This commit is contained in:
parent
024f6fc1a9
commit
1b590f9e16
4 changed files with 18 additions and 0 deletions
|
|
@ -59,6 +59,10 @@ bool LayerManager::setFocus() {
|
|||
return true;
|
||||
}
|
||||
|
||||
const LayerWidget *LayerManager::topShownLayer() const {
|
||||
return _layer ? _layer->topShownLayer() : nullptr;
|
||||
}
|
||||
|
||||
void LayerManager::ensureLayerCreated() {
|
||||
if (_layer) {
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -36,6 +36,8 @@ public:
|
|||
void raise();
|
||||
bool setFocus();
|
||||
|
||||
const LayerWidget *topShownLayer() const;
|
||||
|
||||
private:
|
||||
void ensureLayerCreated();
|
||||
void destroyLayer();
|
||||
|
|
|
|||
|
|
@ -458,6 +458,17 @@ bool LayerStackWidget::layerShown() const {
|
|||
return _specialLayer || currentLayer() || _mainMenu;
|
||||
}
|
||||
|
||||
const LayerWidget *LayerStackWidget::topShownLayer() const {
|
||||
if (const auto result = currentLayer()) {
|
||||
return result;
|
||||
} else if (const auto special = _specialLayer.data()) {
|
||||
return special;
|
||||
} else if (const auto menu = _mainMenu.data()) {
|
||||
return menu;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void LayerStackWidget::setStyleOverrides(
|
||||
const style::Box *boxSt,
|
||||
const style::Box *layerSt) {
|
||||
|
|
|
|||
|
|
@ -144,6 +144,7 @@ public:
|
|||
const ::Window::SectionShow ¶ms);
|
||||
|
||||
bool layerShown() const;
|
||||
const LayerWidget *topShownLayer() const;
|
||||
|
||||
~LayerStackWidget();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue