mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-26 02:35:38 +08:00
Menu item to reset all dock widgets' settings
This commit is contained in:
committed by
Mat Sutcliffe
parent
1d5bbb6747
commit
7efebad51a
@@ -92,8 +92,10 @@ namespace BlackGui
|
|||||||
bool hasDockedWidgets = this->countDockedWidgetInfoAreas() > 0;
|
bool hasDockedWidgets = this->countDockedWidgetInfoAreas() > 0;
|
||||||
if (hasDockedWidgets)
|
if (hasDockedWidgets)
|
||||||
{
|
{
|
||||||
menu->addAction(CIcons::dockTop16(), "Dock all", this, &CInfoArea::dockAllWidgets);
|
menu->addAction(CIcons::dockTop16(), "Dock all", this, &CInfoArea::dockAllWidgets);
|
||||||
menu->addAction(CIcons::floatAll16(), "Float all", this, &CInfoArea::floatAllWidgets);
|
menu->addAction(CIcons::floatAll16(), "Float all", this, &CInfoArea::floatAllWidgets);
|
||||||
|
menu->addAction(CIcons::refresh16(), "Reset all to defaults", this, &CInfoArea::resetAllWidgetSettings);
|
||||||
|
|
||||||
menu->addAction(CIcons::floatOne16(), QStringLiteral("Dock / float '%1'").arg(this->windowTitle()), this, &CInfoArea::toggleFloatingWholeInfoArea);
|
menu->addAction(CIcons::floatOne16(), QStringLiteral("Dock / float '%1'").arg(this->windowTitle()), this, &CInfoArea::toggleFloatingWholeInfoArea);
|
||||||
QAction *lockTabBarMenuAction = new QAction(menu);
|
QAction *lockTabBarMenuAction = new QAction(menu);
|
||||||
lockTabBarMenuAction->setObjectName(this->objectName().append("LockTabBar"));
|
lockTabBarMenuAction->setObjectName(this->objectName().append("LockTabBar"));
|
||||||
@@ -352,6 +354,15 @@ namespace BlackGui
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CInfoArea::resetAllWidgetSettings()
|
||||||
|
{
|
||||||
|
for (CDockWidgetInfoArea *dw : as_const(m_dockWidgetInfoAreas))
|
||||||
|
{
|
||||||
|
if (!dw->isFloating()) { continue; }
|
||||||
|
dw->resetSettings();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void CInfoArea::allFloatingOnTop()
|
void CInfoArea::allFloatingOnTop()
|
||||||
{
|
{
|
||||||
for (CDockWidgetInfoArea *dw : as_const(m_dockWidgetInfoAreas))
|
for (CDockWidgetInfoArea *dw : as_const(m_dockWidgetInfoAreas))
|
||||||
|
|||||||
@@ -104,6 +104,9 @@ namespace BlackGui
|
|||||||
//! All floating info areas on top
|
//! All floating info areas on top
|
||||||
void allFloatingOnTop();
|
void allFloatingOnTop();
|
||||||
|
|
||||||
|
//! Reset all widgets
|
||||||
|
void resetAllWidgetSettings();
|
||||||
|
|
||||||
//! Toggle dock / floating of the whole info area
|
//! Toggle dock / floating of the whole info area
|
||||||
virtual void toggleFloatingWholeInfoArea();
|
virtual void toggleFloatingWholeInfoArea();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user