mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-02 23:25:53 +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:
@@ -394,6 +394,24 @@ namespace BlackGui
|
||||
return Qt::WindowStaysOnTopHint & flags;
|
||||
}
|
||||
|
||||
bool CGuiUtility::stayOnTop(bool onTop, QWidget *widget)
|
||||
{
|
||||
if (!widget) { return false; }
|
||||
Qt::WindowFlags flags = widget->windowFlags();
|
||||
if (onTop)
|
||||
{
|
||||
flags &= ~Qt::WindowStaysOnBottomHint;
|
||||
flags |= Qt::WindowStaysOnTopHint;
|
||||
}
|
||||
else
|
||||
{
|
||||
flags &= ~Qt::WindowStaysOnTopHint;
|
||||
// flags |= Qt::WindowStaysOnBottomHint;
|
||||
}
|
||||
widget->setWindowFlags(flags);
|
||||
return onTop;
|
||||
}
|
||||
|
||||
QString CGuiUtility::marginsToString(const QMargins &margins)
|
||||
{
|
||||
const QString s("%1:%2:%3:%4");
|
||||
|
||||
Reference in New Issue
Block a user