mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-08-09 13:13:52 +00:00
Support for SeparatePanel parent in X11.
This commit is contained in:
@@ -104,7 +104,10 @@ void StandaloneLayerStack::showBox(
|
||||
} else if (!_entries.empty()) {
|
||||
_entries.back().panel->hideForStacking();
|
||||
}
|
||||
auto panel = base::make_unique_q<SeparatePanel>();
|
||||
auto panel = base::make_unique_q<SeparatePanel>(SeparatePanelArgs{
|
||||
.anchorGeometry = _anchorGeometry,
|
||||
.transientParent = _transientParent,
|
||||
});
|
||||
panel->setWindowFlag(Qt::WindowStaysOnTopHint, false);
|
||||
panel->setAttribute(Qt::WA_DeleteOnClose, false);
|
||||
panel->setTitleHeight(0);
|
||||
@@ -158,6 +161,13 @@ void StandaloneLayerStack::hideLayers(anim::type animated) {
|
||||
}
|
||||
}
|
||||
|
||||
void StandaloneLayerStack::setAnchor(
|
||||
std::optional<QRect> geometry,
|
||||
void *transientParent) {
|
||||
_anchorGeometry = std::move(geometry);
|
||||
_transientParent = transientParent;
|
||||
}
|
||||
|
||||
ShowFactory StandaloneLayerStack::showFactory() {
|
||||
const auto weak = base::make_weak(this);
|
||||
return [weak]() -> ShowPtr {
|
||||
@@ -166,6 +176,9 @@ ShowFactory StandaloneLayerStack::showFactory() {
|
||||
}
|
||||
|
||||
std::optional<QSize> StandaloneLayerStack::layerOuterSize() {
|
||||
if (_anchorGeometry) {
|
||||
return _anchorGeometry->size();
|
||||
}
|
||||
if (const auto screen = QGuiApplication::primaryScreen()) {
|
||||
return screen->availableGeometry().size();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user