mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 17:35:34 +08:00
[UI] Default sizes for dock widgets plus some smaller fixes:
* renamings * reset all to defaults * sizes
This commit is contained in:
committed by
Mat Sutcliffe
parent
465c8fd81d
commit
df69ef47a0
@@ -75,7 +75,7 @@ namespace BlackGui
|
|||||||
if (!this->isParentDockWidgetFloating()) { return; }
|
if (!this->isParentDockWidgetFloating()) { return; }
|
||||||
|
|
||||||
// manually setting size, all other approaches failed
|
// manually setting size, all other approaches failed
|
||||||
static const QSize defaultSizeShown(300, 400);
|
static const QSize defaultSizeShown(500, 600);
|
||||||
static const QSize defaultSizeHidden(300, 150);
|
static const QSize defaultSizeHidden(300, 150);
|
||||||
|
|
||||||
// keep old size
|
// keep old size
|
||||||
|
|||||||
@@ -35,13 +35,14 @@ namespace BlackGui
|
|||||||
|
|
||||||
QSize CCockpitInfoAreaComponent::getPreferredSizeWhenFloating(int areaIndex) const
|
QSize CCockpitInfoAreaComponent::getPreferredSizeWhenFloating(int areaIndex) const
|
||||||
{
|
{
|
||||||
|
// see also CMainInfoAreaComponent::getPreferredSizeWhenFloating
|
||||||
Q_UNUSED(areaIndex)
|
Q_UNUSED(areaIndex)
|
||||||
return QSize(600, 400);
|
return QSize(600, 400);
|
||||||
}
|
}
|
||||||
|
|
||||||
const QPixmap &CCockpitInfoAreaComponent::indexToPixmap(int areaIndex) const
|
const QPixmap &CCockpitInfoAreaComponent::indexToPixmap(int areaIndex) const
|
||||||
{
|
{
|
||||||
InfoArea area = static_cast<InfoArea>(areaIndex);
|
const InfoArea area = static_cast<InfoArea>(areaIndex);
|
||||||
switch (area)
|
switch (area)
|
||||||
{
|
{
|
||||||
case InfoAreaAudio: return CIcons::appAudio16();
|
case InfoAreaAudio: return CIcons::appAudio16();
|
||||||
|
|||||||
@@ -156,7 +156,6 @@ namespace BlackGui
|
|||||||
case InfoAreaUsers:
|
case InfoAreaUsers:
|
||||||
case InfoAreaLog:
|
case InfoAreaLog:
|
||||||
case InfoAreaSimulator:
|
case InfoAreaSimulator:
|
||||||
return QSize(400, 300);
|
|
||||||
case InfoAreaMapping:
|
case InfoAreaMapping:
|
||||||
case InfoAreaInterpolation:
|
case InfoAreaInterpolation:
|
||||||
case InfoAreaSettings:
|
case InfoAreaSettings:
|
||||||
@@ -165,9 +164,9 @@ namespace BlackGui
|
|||||||
case InfoAreaRadar:
|
case InfoAreaRadar:
|
||||||
return QSize(600, 400);
|
return QSize(600, 400);
|
||||||
case InfoAreaFlightPlan:
|
case InfoAreaFlightPlan:
|
||||||
return QSize(625, 500);
|
return QSize(800, 600);
|
||||||
default:
|
default:
|
||||||
return QSize(400, 300);
|
return QSize(600, 400);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -133,7 +133,7 @@ namespace BlackGui
|
|||||||
{
|
{
|
||||||
const bool r = widgetsWithDockWidgetInfoAreaComponent.removeOne(iac);
|
const bool r = widgetsWithDockWidgetInfoAreaComponent.removeOne(iac);
|
||||||
Q_ASSERT(r); // why is the nested component not in the child list?
|
Q_ASSERT(r); // why is the nested component not in the child list?
|
||||||
Q_UNUSED(r);
|
Q_UNUSED(r)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return widgetsWithDockWidgetInfoAreaComponent;
|
return widgetsWithDockWidgetInfoAreaComponent;
|
||||||
|
|||||||
@@ -94,7 +94,8 @@ namespace BlackGui
|
|||||||
{
|
{
|
||||||
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::refresh16(), "Reset all floating to defaults", this, &CInfoArea::resetAllFloatingWidgetSettings);
|
||||||
|
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);
|
||||||
@@ -354,11 +355,20 @@ namespace BlackGui
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CInfoArea::resetAllFloatingWidgetSettings()
|
||||||
|
{
|
||||||
|
for (CDockWidgetInfoArea *dw : as_const(m_dockWidgetInfoAreas))
|
||||||
|
{
|
||||||
|
if (!dw || !dw->isFloating()) { continue; }
|
||||||
|
dw->resetSettings();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void CInfoArea::resetAllWidgetSettings()
|
void CInfoArea::resetAllWidgetSettings()
|
||||||
{
|
{
|
||||||
for (CDockWidgetInfoArea *dw : as_const(m_dockWidgetInfoAreas))
|
for (CDockWidgetInfoArea *dw : as_const(m_dockWidgetInfoAreas))
|
||||||
{
|
{
|
||||||
if (!dw->isFloating()) { continue; }
|
if (!dw || !dw->isFloating()) { continue; }
|
||||||
dw->resetSettings();
|
dw->resetSettings();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -573,7 +583,7 @@ namespace BlackGui
|
|||||||
{
|
{
|
||||||
if (!sGui || sGui->isShuttingDown()) { return; }
|
if (!sGui || sGui->isShuttingDown()) { return; }
|
||||||
this->setTabPosition(Qt::LeftDockWidgetArea, QTabWidget::East);
|
this->setTabPosition(Qt::LeftDockWidgetArea, QTabWidget::East);
|
||||||
bool init = m_tabBar ? false : true;
|
const bool init = m_tabBar ? false : true;
|
||||||
|
|
||||||
for (int i = 0; i < m_dockWidgetInfoAreas.size(); i++)
|
for (int i = 0; i < m_dockWidgetInfoAreas.size(); i++)
|
||||||
{
|
{
|
||||||
@@ -605,7 +615,10 @@ namespace BlackGui
|
|||||||
{
|
{
|
||||||
after->setFloating(false);
|
after->setFloating(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// we can not tabify first
|
||||||
if (!first) { continue; }
|
if (!first) { continue; }
|
||||||
|
|
||||||
this->tabifyDockWidget(first, after);
|
this->tabifyDockWidget(first, after);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -834,6 +847,7 @@ namespace BlackGui
|
|||||||
QPointer<CInfoArea> myself(this);
|
QPointer<CInfoArea> myself(this);
|
||||||
QTimer::singleShot(1000, this, [ = ]
|
QTimer::singleShot(1000, this, [ = ]
|
||||||
{
|
{
|
||||||
|
if (!myself) { return; }
|
||||||
myself->emitInfoAreaStatus();
|
myself->emitInfoAreaStatus();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -104,7 +104,10 @@ namespace BlackGui
|
|||||||
//! All floating info areas on top
|
//! All floating info areas on top
|
||||||
void allFloatingOnTop();
|
void allFloatingOnTop();
|
||||||
|
|
||||||
//! Reset all widgets
|
//! Reset all floating widget settings
|
||||||
|
void resetAllFloatingWidgetSettings();
|
||||||
|
|
||||||
|
//! Reset all widget settings
|
||||||
void resetAllWidgetSettings();
|
void resetAllWidgetSettings();
|
||||||
|
|
||||||
//! Toggle dock / floating of the whole info area
|
//! Toggle dock / floating of the whole info area
|
||||||
|
|||||||
Reference in New Issue
Block a user