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