Ref T592, minor tweaks

* style
* hide wip_CockpitComPanelShowHideBar initially
* sGui guarding
* function initialFloating() public so it can be explicitly called
This commit is contained in:
Klaus Basan
2019-04-05 02:54:36 +02:00
committed by Mat Sutcliffe
parent 9f0daa58ea
commit c45592f9b5
11 changed files with 42 additions and 51 deletions

View File

@@ -25,6 +25,7 @@ namespace BlackGui
ui(new Ui::CCockpitComponent)
{
ui->setupUi(this);
ui->wip_CockpitComPanelShowHideBar->setVisible(false);
m_minHeightInfoArea = ui->comp_CockpitInfoArea->minimumHeight();
connect(ui->wip_CockpitComPanelShowHideBar, &CShowHideBar::toggleShowHide, this, &CCockpitComponent::onToggleShowHideDetails, Qt::QueuedConnection);

View File

@@ -48,17 +48,11 @@
<item>
<widget class="BlackGui::CShowHideBar" name="wip_CockpitComPanelShowHideBar" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>25</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
@@ -70,7 +64,7 @@
<item>
<widget class="BlackGui::Components::CCockpitInfoAreaComponent" name="comp_CockpitInfoArea" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>

View File

@@ -2,16 +2,11 @@
<ui version="4.0">
<class>CMainInfoAreaComponent</class>
<widget class="QMainWindow" name="CMainInfoAreaComponent">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>1779</width>
<height>79</height>
</rect>
</property>
<property name="windowTitle">
<string>Main info area</string>
<string>Main info area of swift</string>
</property>
<property name="dockOptions">
<set>QMainWindow::AnimatedDocks</set>
</property>
<widget class="QWidget" name="qw_centralWidgetEmptyUsedAsPadding">
<property name="enabled">

View File

@@ -41,34 +41,34 @@ namespace BlackGui
// Info areas
// pressed collides, as this toggles button again
// using toggle collides, as checking/unchecking toggles again -> infinite loop
connect(ui->pb_MainAircrafts, &QPushButton::released, this, &CMainKeypadAreaComponent::buttonSelected);
connect(ui->pb_MainAtc, &QPushButton::released, this, &CMainKeypadAreaComponent::buttonSelected);
connect(ui->pb_MainCockpit, &QPushButton::released, this, &CMainKeypadAreaComponent::buttonSelected);
connect(ui->pb_MainFlightplan, &QPushButton::released, this, &CMainKeypadAreaComponent::buttonSelected);
connect(ui->pb_MainLog, &QPushButton::released, this, &CMainKeypadAreaComponent::buttonSelected);
connect(ui->pb_MainMappings, &QPushButton::released, this, &CMainKeypadAreaComponent::buttonSelected);
connect(ui->pb_MainAircrafts, &QPushButton::released, this, &CMainKeypadAreaComponent::buttonSelected);
connect(ui->pb_MainAtc, &QPushButton::released, this, &CMainKeypadAreaComponent::buttonSelected);
connect(ui->pb_MainCockpit, &QPushButton::released, this, &CMainKeypadAreaComponent::buttonSelected);
connect(ui->pb_MainFlightplan, &QPushButton::released, this, &CMainKeypadAreaComponent::buttonSelected);
connect(ui->pb_MainLog, &QPushButton::released, this, &CMainKeypadAreaComponent::buttonSelected);
connect(ui->pb_MainMappings, &QPushButton::released, this, &CMainKeypadAreaComponent::buttonSelected);
connect(ui->pb_MainInterpolation, &QPushButton::released, this, &CMainKeypadAreaComponent::buttonSelected);
connect(ui->pb_MainRadar, &QPushButton::released, this, &CMainKeypadAreaComponent::buttonSelected);
connect(ui->pb_MainSettings, &QPushButton::released, this, &CMainKeypadAreaComponent::buttonSelected);
connect(ui->pb_MainSimulator, &QPushButton::released, this, &CMainKeypadAreaComponent::buttonSelected);
connect(ui->pb_MainTextMessages, &QPushButton::released, this, &CMainKeypadAreaComponent::buttonSelected);
connect(ui->pb_MainUsers, &QPushButton::released, this, &CMainKeypadAreaComponent::buttonSelected);
connect(ui->pb_MainWeather, &QPushButton::released, this, &CMainKeypadAreaComponent::buttonSelected);
connect(ui->pb_MainRadar, &QPushButton::released, this, &CMainKeypadAreaComponent::buttonSelected);
connect(ui->pb_MainSettings, &QPushButton::released, this, &CMainKeypadAreaComponent::buttonSelected);
connect(ui->pb_MainSimulator, &QPushButton::released, this, &CMainKeypadAreaComponent::buttonSelected);
connect(ui->pb_MainTextMessages, &QPushButton::released, this, &CMainKeypadAreaComponent::buttonSelected);
connect(ui->pb_MainUsers, &QPushButton::released, this, &CMainKeypadAreaComponent::buttonSelected);
connect(ui->pb_MainWeather, &QPushButton::released, this, &CMainKeypadAreaComponent::buttonSelected);
// non info areas
connect(ui->pb_Connect, &QPushButton::pressed, this, &CMainKeypadAreaComponent::buttonSelected);
connect(ui->pb_Connect, &QPushButton::pressed, this, &CMainKeypadAreaComponent::disableButtonBriefly);
connect(ui->pb_CockpitIdent, &QPushButton::released, this, &CMainKeypadAreaComponent::buttonSelected);
connect(ui->pb_Opacity050, &QPushButton::pressed, this, &CMainKeypadAreaComponent::buttonSelected);
connect(ui->pb_Opacity100, &QPushButton::pressed, this, &CMainKeypadAreaComponent::buttonSelected);
connect(ui->pb_SoundMaxVolume, &QPushButton::pressed, this, &CMainKeypadAreaComponent::buttonSelected);
connect(ui->pb_SoundMute, &QPushButton::released, this, &CMainKeypadAreaComponent::buttonSelected);
connect(ui->pb_Audio, &QPushButton::released, this, &CMainKeypadAreaComponent::buttonSelected);
connect(ui->pb_Connect, &QPushButton::pressed, this, &CMainKeypadAreaComponent::buttonSelected);
connect(ui->pb_Connect, &QPushButton::pressed, this, &CMainKeypadAreaComponent::disableButtonBriefly);
connect(ui->pb_Opacity050, &QPushButton::pressed, this, &CMainKeypadAreaComponent::buttonSelected);
connect(ui->pb_Opacity100, &QPushButton::pressed, this, &CMainKeypadAreaComponent::buttonSelected);
connect(ui->pb_SoundMaxVolume, &QPushButton::pressed, this, &CMainKeypadAreaComponent::buttonSelected);
connect(ui->pb_CockpitIdent, &QPushButton::released, this, &CMainKeypadAreaComponent::buttonSelected);
connect(ui->pb_SoundMute, &QPushButton::released, this, &CMainKeypadAreaComponent::buttonSelected);
connect(ui->pb_Audio, &QPushButton::released, this, &CMainKeypadAreaComponent::buttonSelected);
// command line
ui->lep_CommandLineInput->setIdentifier(m_identifier);
connect(ui->lep_CommandLineInput, &CCommandInput::commandEntered, this, &CMainKeypadAreaComponent::commandEntered);
connect(ui->lep_CommandLineInput, &CCommandInput::textEntered, this, &CMainKeypadAreaComponent::textEntered);
connect(ui->lep_CommandLineInput, &CCommandInput::textEntered, this, &CMainKeypadAreaComponent::textEntered);
connect(sGui->getIContextNetwork(), &IContextNetwork::connectionStatusChanged, this, &CMainKeypadAreaComponent::connectionStatusChanged);
connect(sGui->getIContextOwnAircraft(), &IContextOwnAircraft::changedAircraftCockpit, this, &CMainKeypadAreaComponent::ownAircraftCockpitChanged);
@@ -99,6 +99,7 @@ namespace BlackGui
}
}
// check the floating
for (int floatingIndex : floatingIndexes)
{
QPushButton *pb = this->mainInfoAreaToButton(static_cast<CMainInfoAreaComponent::InfoArea>(floatingIndex));

View File

@@ -41,7 +41,7 @@ namespace BlackGui
explicit CMainKeypadAreaComponent(QWidget *parent = nullptr);
//! Destructor
virtual ~CMainKeypadAreaComponent();
virtual ~CMainKeypadAreaComponent() override;
//! Main info area changed
void onMainInfoAreaChanged(int currentTabIndex, QList<int> dockedIndexes, QList<int> floatingIndexes);

View File

@@ -94,7 +94,7 @@ namespace BlackGui
int r = 0;
int c = 0;
// remark:
// remark: the actions will be set from the main UI
for (QAction *action : this->actions())
{
if (!action) { continue; }
@@ -193,7 +193,7 @@ namespace BlackGui
void CNavigatorDialog::changeEvent(QEvent *evt)
{
QEvent::Type t = evt->type();
const QEvent::Type t = evt->type();
if (t == QEvent::WindowStateChange)
{
evt->ignore();

View File

@@ -442,7 +442,7 @@ namespace BlackGui
}
else
{
if (m_wasFrameless) { setFrameless(true); }
if (m_wasFrameless) { this->setFrameless(true); }
}
m_statusBar.show();
m_wasAlreadyFloating = true;

View File

@@ -52,7 +52,6 @@ namespace BlackGui
//! \remarks made public so other classes can nest this submenu
virtual void addToContextMenu(QMenu *contextMenu) const override;
protected:
//! \copydoc CDockWidget::initialFloating
virtual void initialFloating() override;

View File

@@ -537,7 +537,7 @@ namespace BlackGui
// RW: The line below is commented to prevent making this widget visible as a top window
// in case it is constructed without parent or anchestor widget. Contrary to the comment,
// it does not seem to be necessary https://dev.vatsim-germany.org/issues/738
// KB 2018-12 with T447 T452 re-eanled the line again, but wit parent condition
// KB 2018-12 with T447 T452 re-eanled the line again, but with parent condition
if (this->parentWidget()) // this line
{
this->setVisible(true); // after redocking this is required
@@ -549,6 +549,7 @@ namespace BlackGui
void CInfoArea::tabifyAllWidgets()
{
if (!sGui || sGui->isShuttingDown()) { return; }
this->setTabPosition(Qt::LeftDockWidgetArea, QTabWidget::East);
bool init = m_tabBar ? false : true;
@@ -585,13 +586,13 @@ namespace BlackGui
this->tabifyDockWidget(first, after);
}
// as now tabified, now set tab
// as now tabified, set tab
if (init)
{
m_tabBar = this->findChild<QTabBar *>();
// if we have > 1 docked widgets, we have a tab bar
if (m_tabBar)
if (m_tabBar && sGui)
{
const QString qss = sGui->getStyleSheetUtility().style(CStyleSheetUtility::fileNameDockWidgetTab());
m_tabBar->setStyleSheet(qss);

View File

@@ -102,7 +102,7 @@ namespace BlackGui
QString m_floatingFramelessMargins {"0:0:0:0"}; //!< margins, when floating and frameless
QString m_dockedMargins {"0:0:0:0"}; //!< margins, when docked
QString m_geometry; //!< geometry as HEX values
bool m_floating = false; //!< floating
bool m_floating = false; //!< floating
bool m_frameless = false; //!< frameless
BLACK_METACLASS(

View File

@@ -205,7 +205,7 @@ void SwiftGuiStd::initGuiSignals()
connect(ui->comp_MainKeypadArea, &CMainKeypadAreaComponent::identPressed, ui->comp_MainInfoArea->getCockpitComponent(), &CCockpitComponent::setSelectedTransponderModeStateIdent);
connect(ui->comp_MainKeypadArea, &CMainKeypadAreaComponent::textEntered, ui->comp_MainInfoArea->getTextMessageComponent(), &CTextMessageComponent::handleGlobalCommandLineText);
connect(ui->comp_MainKeypadArea, &CMainKeypadAreaComponent::audioPressed, ui->comp_MainInfoArea, &CMainInfoAreaComponent::selectAudioTab);
connect(ui->comp_MainInfoArea, &CMainInfoAreaComponent::changedInfoAreaStatus, ui->comp_MainKeypadArea, &CMainKeypadAreaComponent::onMainInfoAreaChanged);
connect(ui->comp_MainInfoArea, &CMainInfoAreaComponent::changedInfoAreaStatus, ui->comp_MainKeypadArea, &CMainKeypadAreaComponent::onMainInfoAreaChanged);
// audio
connect(ui->comp_MainInfoArea->getAtcStationComponent(), &CAtcStationComponent::requestAudioWidget, ui->comp_MainInfoArea, &CMainInfoAreaComponent::selectAudioTab);
@@ -217,12 +217,12 @@ void SwiftGuiStd::initGuiSignals()
connect(ui->menu_TestLocationsEDRY, &QAction::triggered, this, &SwiftGuiStd::onMenuClicked);
connect(ui->menu_TestLocationsLOWW, &QAction::triggered, this, &SwiftGuiStd::onMenuClicked);
connect(ui->menu_WindowFont, &QAction::triggered, this, &SwiftGuiStd::onMenuClicked);
connect(ui->menu_WindowMinimize, &QAction::triggered, this, &SwiftGuiStd::onMenuClicked);
connect(ui->menu_WindowFont, &QAction::triggered, this, &SwiftGuiStd::onMenuClicked);
connect(ui->menu_WindowMinimize, &QAction::triggered, this, &SwiftGuiStd::onMenuClicked);
connect(ui->menu_WindowToggleOnTop, &QAction::triggered, this, &SwiftGuiStd::onMenuClicked);
connect(ui->menu_WindowToggleNavigator, &QAction::triggered, m_navigator.data(), &CNavigatorDialog::toggleNavigatorVisibility);
connect(ui->menu_InternalsPage, &QAction::triggered, this, &SwiftGuiStd::onMenuClicked);
connect(ui->menu_MovingMap, &QAction::triggered, this, &SwiftGuiStd::onMenuClicked);
connect(ui->menu_MovingMap, &QAction::triggered, this, &SwiftGuiStd::onMenuClicked);
connect(m_navigator.data(), &CNavigatorDialog::navigatorClosed, this, &SwiftGuiStd::onNavigatorClosed);
// settings (GUI component), styles