mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 04:25:35 +08:00
Restore dock widget from settings, fixed frameless widget restore
https://discordapp.com/channels/539048679160676382/539486309882789888/593835010566521033
This commit is contained in:
committed by
Mat Sutcliffe
parent
66f19b29be
commit
49d1bcbd39
@@ -280,6 +280,15 @@ namespace BlackGui
|
||||
this->setFrameless(!frameless);
|
||||
}
|
||||
|
||||
void CDockWidget::toggleFramelessDeferred(int delayMs)
|
||||
{
|
||||
QPointer<CDockWidget> myself(this);
|
||||
QTimer::singleShot(delayMs, this, [ = ]
|
||||
{
|
||||
if (myself) { myself->toggleFrameless(); }
|
||||
});
|
||||
}
|
||||
|
||||
void CDockWidget::windowAlwaysOnTop()
|
||||
{
|
||||
if (this->isFloating())
|
||||
@@ -317,16 +326,17 @@ namespace BlackGui
|
||||
{
|
||||
this->toggleFloating();
|
||||
}
|
||||
if (s.isFramless() != this->isFrameless())
|
||||
{
|
||||
this->toggleFrameless();
|
||||
}
|
||||
const QByteArray geo(s.getGeometry());
|
||||
if (!geo.isEmpty())
|
||||
{
|
||||
const bool ok = this->restoreGeometry(geo);
|
||||
if (ok) { this->rememberFloatingSizeAndPosition(); }
|
||||
}
|
||||
if (s.isFramless() != this->isFrameless())
|
||||
{
|
||||
// not working if directly called
|
||||
this->toggleFramelessDeferred();
|
||||
}
|
||||
this->setMargins();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -108,6 +108,9 @@ namespace BlackGui
|
||||
//! Toggle frameless mode
|
||||
void toggleFrameless();
|
||||
|
||||
//! Toggle frameless deferred
|
||||
void toggleFramelessDeferred(int delayMs = 1000);
|
||||
|
||||
//! Window always on top
|
||||
void windowAlwaysOnTop();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user