mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-17 10:55:32 +08:00
Minor dock widget related tweaks
This commit is contained in:
committed by
Mat Sutcliffe
parent
a85ff063aa
commit
28d9e98e38
@@ -382,7 +382,7 @@ namespace BlackGui
|
|||||||
}
|
}
|
||||||
|
|
||||||
// State actions (windows state)
|
// State actions (windows state)
|
||||||
contextMenu->addAction(CIcons::load16(), "Restore", this, &CDockWidget::restoreFromSettings);
|
contextMenu->addAction(CIcons::load16(), "Restore from settings", this, &CDockWidget::restoreFromSettings);
|
||||||
contextMenu->addAction(CIcons::save16(), "Save state", this, &CDockWidget::saveCurrentStateToSettings);
|
contextMenu->addAction(CIcons::save16(), "Save state", this, &CDockWidget::saveCurrentStateToSettings);
|
||||||
contextMenu->addAction(CIcons::refresh16(), "Reset to defaults", this, &CDockWidget::resetSettings);
|
contextMenu->addAction(CIcons::refresh16(), "Reset to defaults", this, &CDockWidget::resetSettings);
|
||||||
contextMenu->addAction(CIcons::refresh16(), "Reset position", this, &CDockWidget::resetPosition);
|
contextMenu->addAction(CIcons::refresh16(), "Reset position", this, &CDockWidget::resetPosition);
|
||||||
|
|||||||
@@ -401,7 +401,6 @@ namespace BlackGui
|
|||||||
}
|
}
|
||||||
if (m_saveMainWidgetState && !this->isSet(m_cmdWindowSizeReset))
|
if (m_saveMainWidgetState && !this->isSet(m_cmdWindowSizeReset))
|
||||||
{
|
{
|
||||||
|
|
||||||
const Qt::KeyboardModifiers km = QGuiApplication::queryKeyboardModifiers();
|
const Qt::KeyboardModifiers km = QGuiApplication::queryKeyboardModifiers();
|
||||||
const bool shiftAlt = km.testFlag(Qt::ShiftModifier) && km.testFlag(Qt::AltModifier);
|
const bool shiftAlt = km.testFlag(Qt::ShiftModifier) && km.testFlag(Qt::AltModifier);
|
||||||
if (!shiftAlt) { this->restoreWindowGeometryAndState(); }
|
if (!shiftAlt) { this->restoreWindowGeometryAndState(); }
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ namespace BlackGui
|
|||||||
menu->addSeparator();
|
menu->addSeparator();
|
||||||
QMenu *subMenuToggleFloat = new QMenu("Toggle Float/Dock", menu);
|
QMenu *subMenuToggleFloat = new QMenu("Toggle Float/Dock", menu);
|
||||||
QMenu *subMenuDisplay = new QMenu("Display", menu);
|
QMenu *subMenuDisplay = new QMenu("Display", menu);
|
||||||
QMenu *subMenuRestore = new QMenu("Restore", menu);
|
QMenu *subMenuRestore = new QMenu("Restore from settings", menu);
|
||||||
QMenu *subMenuResetPositions = new QMenu("Reset position", menu);
|
QMenu *subMenuResetPositions = new QMenu("Reset position", menu);
|
||||||
subMenuRestore->setIcon(CIcons::load16());
|
subMenuRestore->setIcon(CIcons::load16());
|
||||||
subMenuResetPositions->setIcon(CIcons::refresh16());
|
subMenuResetPositions->setIcon(CIcons::refresh16());
|
||||||
@@ -404,8 +404,9 @@ namespace BlackGui
|
|||||||
{
|
{
|
||||||
const QObject *sender = QObject::sender();
|
const QObject *sender = QObject::sender();
|
||||||
const QAction *action = qobject_cast<const QAction *>(sender);
|
const QAction *action = qobject_cast<const QAction *>(sender);
|
||||||
Q_ASSERT(action);
|
BLACK_VERIFY(action);
|
||||||
int index = action->data().toInt();
|
if (!action) { return; }
|
||||||
|
const int index = action->data().toInt();
|
||||||
this->selectArea(index);
|
this->selectArea(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -413,8 +414,9 @@ namespace BlackGui
|
|||||||
{
|
{
|
||||||
const QObject *sender = QObject::sender();
|
const QObject *sender = QObject::sender();
|
||||||
const QAction *action = qobject_cast<const QAction *>(sender);
|
const QAction *action = qobject_cast<const QAction *>(sender);
|
||||||
Q_ASSERT(action);
|
BLACK_VERIFY(action);
|
||||||
int index = action->data().toInt();
|
if (!action) { return; }
|
||||||
|
const int index = action->data().toInt();
|
||||||
this->resetPosition(index);
|
this->resetPosition(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -422,18 +424,19 @@ namespace BlackGui
|
|||||||
{
|
{
|
||||||
const QObject *sender = QObject::sender();
|
const QObject *sender = QObject::sender();
|
||||||
const QAction *action = qobject_cast<const QAction *>(sender);
|
const QAction *action = qobject_cast<const QAction *>(sender);
|
||||||
Q_ASSERT(action);
|
BLACK_VERIFY(action);
|
||||||
int index = action->data().toInt();
|
if (!action) { return; }
|
||||||
|
const int index = action->data().toInt();
|
||||||
this->toggleFloatingByIndex(index);
|
this->toggleFloatingByIndex(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CInfoArea::restoreDockWidgetInfoArea()
|
void CInfoArea::restoreDockWidgetInfoArea()
|
||||||
{
|
{
|
||||||
const QObject *sender = QObject::sender();
|
const QObject *sender = QObject::sender();
|
||||||
Q_ASSERT(sender);
|
|
||||||
const QAction *action = qobject_cast<const QAction *>(sender);
|
const QAction *action = qobject_cast<const QAction *>(sender);
|
||||||
Q_ASSERT(action);
|
BLACK_VERIFY(action);
|
||||||
int index = action->data().toInt();
|
if (!action) { return; }
|
||||||
|
const int index = action->data().toInt();
|
||||||
this->restoreDockWidgetInfoAreaByIndex(index);
|
this->restoreDockWidgetInfoAreaByIndex(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -442,7 +445,7 @@ namespace BlackGui
|
|||||||
if (!this->isValidAreaIndex(areaIndex)) { return; }
|
if (!this->isValidAreaIndex(areaIndex)) { return; }
|
||||||
CDockWidgetInfoArea *dw = m_dockWidgetInfoAreas.at(areaIndex);
|
CDockWidgetInfoArea *dw = m_dockWidgetInfoAreas.at(areaIndex);
|
||||||
Q_ASSERT(dw);
|
Q_ASSERT(dw);
|
||||||
if (!dw) return;
|
if (!dw) { return; }
|
||||||
dw->restoreFromSettings();
|
dw->restoreFromSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user