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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const LayerWidget *LayerManager::topShownLayer() const {
|
||||||
|
return _layer ? _layer->topShownLayer() : nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
void LayerManager::ensureLayerCreated() {
|
void LayerManager::ensureLayerCreated() {
|
||||||
if (_layer) {
|
if (_layer) {
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,8 @@ public:
|
||||||
void raise();
|
void raise();
|
||||||
bool setFocus();
|
bool setFocus();
|
||||||
|
|
||||||
|
const LayerWidget *topShownLayer() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void ensureLayerCreated();
|
void ensureLayerCreated();
|
||||||
void destroyLayer();
|
void destroyLayer();
|
||||||
|
|
|
||||||
|
|
@ -458,6 +458,17 @@ bool LayerStackWidget::layerShown() const {
|
||||||
return _specialLayer || currentLayer() || _mainMenu;
|
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(
|
void LayerStackWidget::setStyleOverrides(
|
||||||
const style::Box *boxSt,
|
const style::Box *boxSt,
|
||||||
const style::Box *layerSt) {
|
const style::Box *layerSt) {
|
||||||
|
|
|
||||||
|
|
@ -144,6 +144,7 @@ public:
|
||||||
const ::Window::SectionShow ¶ms);
|
const ::Window::SectionShow ¶ms);
|
||||||
|
|
||||||
bool layerShown() const;
|
bool layerShown() const;
|
||||||
|
const LayerWidget *topShownLayer() const;
|
||||||
|
|
||||||
~LayerStackWidget();
|
~LayerStackWidget();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue