mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-02 06:35:52 +08:00
Ref T447, utility function to set on top flag
Also a signal when "always on top" was triggered
This commit is contained in:
@@ -272,12 +272,21 @@ namespace BlackGui
|
||||
this->setFrameless(!frameless);
|
||||
}
|
||||
|
||||
void CDockWidget::toggleAlwaysOnTop()
|
||||
void CDockWidget::windowAlwaysOnTop()
|
||||
{
|
||||
m_alwaysOnTop = !m_alwaysOnTop;
|
||||
if (this->isFloating())
|
||||
{
|
||||
this->setAlwaysOnTopFlag(m_alwaysOnTop);
|
||||
this->setAlwaysOnTopFlag(true);
|
||||
m_alwaysOnTop = true;
|
||||
}
|
||||
}
|
||||
|
||||
void CDockWidget::windowNotAlwaysOnTop()
|
||||
{
|
||||
if (this->isFloating())
|
||||
{
|
||||
this->setAlwaysOnTopFlag(false);
|
||||
m_alwaysOnTop = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -353,11 +362,11 @@ namespace BlackGui
|
||||
if (this->isFloating())
|
||||
{
|
||||
const bool frameless = this->isFrameless();
|
||||
const bool onTop = this->windowFlags() | Qt::WindowStaysOnTopHint;
|
||||
|
||||
contextMenu->addAction(CIcons::dockTop16(), "Dock", this, &CDockWidget::toggleFloating);
|
||||
contextMenu->addAction(CIcons::tableSheet16(), frameless ? "Normal window" : "Frameless", this, &CDockWidget::toggleFrameless);
|
||||
contextMenu->addAction(CIcons::dockTop16(), onTop ? "Not on top" : "Always on top", this, &CDockWidget::toggleAlwaysOnTop);
|
||||
contextMenu->addAction(CIcons::dockTop16(), "Always on top", this, &CDockWidget::windowAlwaysOnTop);
|
||||
contextMenu->addAction(CIcons::dockTop16(), "Not on top", this, &CDockWidget::windowNotAlwaysOnTop);
|
||||
contextMenu->addAction(CIcons::refresh16(), "Redraw", this, QOverload<>::of(&CDockWidget::update));
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user