mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-17 10:55:32 +08:00
refs #335, preparation for new cockpit
* allow nested info areas * added cockpit info area * fixed several finder methods to excluded nested info areas from child elements * using QScopedPointer for ui * placeholder GUI components for new cockpit
This commit is contained in:
committed by
Roland Winklmeier
parent
b0f01a3ec6
commit
9452ff10c9
38
src/blackgui/components/cockpitcomcomponent.cpp
Normal file
38
src/blackgui/components/cockpitcomcomponent.cpp
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
/* Copyright (C) 2013
|
||||||
|
* swift project Community / Contributors
|
||||||
|
*
|
||||||
|
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
|
||||||
|
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
|
||||||
|
* including this file, may be copied, modified, propagated, or distributed except according to the terms
|
||||||
|
* contained in the LICENSE file.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "cockpitcomcomponent.h"
|
||||||
|
#include "ui_cockpitcomcomponent.h"
|
||||||
|
#include "../stylesheetutility.h"
|
||||||
|
|
||||||
|
using namespace BlackGui;
|
||||||
|
|
||||||
|
namespace BlackGui
|
||||||
|
{
|
||||||
|
namespace Components
|
||||||
|
{
|
||||||
|
CCockpitComComponent::CCockpitComComponent(QWidget *parent) :
|
||||||
|
QFrame(parent),
|
||||||
|
CDockWidgetInfoAreaComponent(this),
|
||||||
|
ui(new Ui::CCockpitMainComponent)
|
||||||
|
{
|
||||||
|
ui->setupUi(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
CCockpitComComponent::~CCockpitComComponent()
|
||||||
|
{ }
|
||||||
|
|
||||||
|
void CCockpitComComponent::paintEvent(QPaintEvent *event)
|
||||||
|
{
|
||||||
|
Q_UNUSED(event);
|
||||||
|
CStyleSheetUtility::useStyleSheetInDerivedWidget(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace
|
||||||
|
} // namespace
|
||||||
47
src/blackgui/components/cockpitcomcomponent.h
Normal file
47
src/blackgui/components/cockpitcomcomponent.h
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
/* Copyright (C) 2013
|
||||||
|
* swift project Community / Contributors
|
||||||
|
*
|
||||||
|
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
|
||||||
|
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
|
||||||
|
* including this file, may be copied, modified, propagated, or distributed except according to the terms
|
||||||
|
* contained in the LICENSE file.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef BLACKGUI_COCKPITCOMCOMPONENT_H
|
||||||
|
#define BLACKGUI_COCKPITCOMCOMPONENT_H
|
||||||
|
|
||||||
|
#include "dockwidgetinfoareacomponent.h"
|
||||||
|
#include <QFrame>
|
||||||
|
#include <QScopedPointer>
|
||||||
|
|
||||||
|
namespace Ui { class CCockpitMainComponent; }
|
||||||
|
|
||||||
|
namespace BlackGui
|
||||||
|
{
|
||||||
|
namespace Components
|
||||||
|
{
|
||||||
|
//! The main cockpit area
|
||||||
|
class CCockpitComComponent :
|
||||||
|
public QFrame,
|
||||||
|
public CDockWidgetInfoAreaComponent
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
//! Constructor
|
||||||
|
explicit CCockpitComComponent(QWidget *parent = nullptr);
|
||||||
|
|
||||||
|
//! Destructor
|
||||||
|
~CCockpitComComponent();
|
||||||
|
|
||||||
|
//! \copydoc QWidget::paintEvent
|
||||||
|
virtual void paintEvent(QPaintEvent *event) override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
QScopedPointer<Ui::CCockpitMainComponent> ui;
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace
|
||||||
|
} // namespace
|
||||||
|
|
||||||
|
#endif // guard
|
||||||
618
src/blackgui/components/cockpitcomcomponent.ui
Normal file
618
src/blackgui/components/cockpitcomcomponent.ui
Normal file
@@ -0,0 +1,618 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>CCockpitMainComponent</class>
|
||||||
|
<widget class="QFrame" name="CCockpitMainComponent">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>363</width>
|
||||||
|
<height>99</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>Frame</string>
|
||||||
|
</property>
|
||||||
|
<property name="frameShape">
|
||||||
|
<enum>QFrame::StyledPanel</enum>
|
||||||
|
</property>
|
||||||
|
<property name="frameShadow">
|
||||||
|
<enum>QFrame::Raised</enum>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="vl_CockpitMainCockpit">
|
||||||
|
<property name="spacing">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<layout class="QGridLayout" name="gl_ComPanel">
|
||||||
|
<property name="sizeConstraint">
|
||||||
|
<enum>QLayout::SetDefaultConstraint</enum>
|
||||||
|
</property>
|
||||||
|
<property name="horizontalSpacing">
|
||||||
|
<number>4</number>
|
||||||
|
</property>
|
||||||
|
<property name="verticalSpacing">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
|
<item row="0" column="1">
|
||||||
|
<widget class="QWidget" name="qw_ComPanelCom2Active" native="true">
|
||||||
|
<layout class="QGridLayout" name="gl_ComPanelCom2Active">
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="spacing">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item row="0" column="1">
|
||||||
|
<widget class="QFrame" name="qf_ComPanelCom2ActiveValid">
|
||||||
|
<property name="frameShape">
|
||||||
|
<enum>QFrame::StyledPanel</enum>
|
||||||
|
</property>
|
||||||
|
<property name="frameShadow">
|
||||||
|
<enum>QFrame::Raised</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QLabel" name="lbl_ComAndTransponderCom2Active">
|
||||||
|
<property name="text">
|
||||||
|
<string>COM2:</string>
|
||||||
|
</property>
|
||||||
|
<property name="buddy">
|
||||||
|
<cstring>qw_ComPanelCom2Active</cstring>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0" colspan="2">
|
||||||
|
<widget class="QLineEdit" name="le_ComPanelCom2Active">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="inputMask">
|
||||||
|
<string>DDD.990</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>128.800</string>
|
||||||
|
</property>
|
||||||
|
<property name="maxLength">
|
||||||
|
<number>7</number>
|
||||||
|
</property>
|
||||||
|
<property name="frame">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QWidget" name="qw_ComPanelCom1Active" native="true">
|
||||||
|
<layout class="QGridLayout" name="gl_ComPanelCom1Active">
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="spacing">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QLabel" name="lbl_ComAndTransponderCom1Active">
|
||||||
|
<property name="text">
|
||||||
|
<string>COM1:</string>
|
||||||
|
</property>
|
||||||
|
<property name="buddy">
|
||||||
|
<cstring>qw_ComPanelCom1Active</cstring>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0" colspan="2">
|
||||||
|
<widget class="QLineEdit" name="le_ComPanelCom1Active">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="inputMask">
|
||||||
|
<string>DDD.990</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>123.750</string>
|
||||||
|
</property>
|
||||||
|
<property name="maxLength">
|
||||||
|
<number>7</number>
|
||||||
|
</property>
|
||||||
|
<property name="frame">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="1">
|
||||||
|
<widget class="QFrame" name="qf_ComPanelCom1ActiveValid">
|
||||||
|
<property name="frameShape">
|
||||||
|
<enum>QFrame::StyledPanel</enum>
|
||||||
|
</property>
|
||||||
|
<property name="frameShadow">
|
||||||
|
<enum>QFrame::Raised</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<widget class="QWidget" name="qw_ComPanelCom1Standby" native="true">
|
||||||
|
<layout class="QGridLayout" name="gl_ComPanelCom1Standby">
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="spacing">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QLabel" name="lbl_ComPanelCom1Standby">
|
||||||
|
<property name="text">
|
||||||
|
<string>standby:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0" colspan="3">
|
||||||
|
<widget class="QLineEdit" name="le_ComPanelCom1Standby">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="inputMask">
|
||||||
|
<string>DDD.990</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>123.750</string>
|
||||||
|
</property>
|
||||||
|
<property name="maxLength">
|
||||||
|
<number>7</number>
|
||||||
|
</property>
|
||||||
|
<property name="frame">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="2">
|
||||||
|
<widget class="QPushButton" name="pb_ComPanelCom1Toggle">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>16777215</width>
|
||||||
|
<height>16777215</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Toggle COM 1 standby/active</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="../../blackmisc/blackmisc.qrc">
|
||||||
|
<normaloff>:/diagona/icons/diagona/icons/arrow-circle-double-135.png</normaloff>:/diagona/icons/diagona/icons/arrow-circle-double-135.png</iconset>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="1">
|
||||||
|
<widget class="QWidget" name="qw_ComPanelCom2Standby" native="true">
|
||||||
|
<layout class="QGridLayout" name="gl_ComPanelCom2Standby">
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="spacing">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QLabel" name="lbl_ComAndTransponderCom2Standby">
|
||||||
|
<property name="text">
|
||||||
|
<string>standby:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0" colspan="3">
|
||||||
|
<widget class="QLineEdit" name="le_ComPanelCom2Standby">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="inputMask">
|
||||||
|
<string>DDD.990</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>123.750</string>
|
||||||
|
</property>
|
||||||
|
<property name="maxLength">
|
||||||
|
<number>7</number>
|
||||||
|
</property>
|
||||||
|
<property name="frame">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="2">
|
||||||
|
<widget class="QPushButton" name="pb_ComPanelCom2Toggle">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>16777215</width>
|
||||||
|
<height>16777215</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Toggle COM 2 standby/active</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="../../blackmisc/blackmisc.qrc">
|
||||||
|
<normaloff>:/diagona/icons/diagona/icons/arrow-circle-double-135.png</normaloff>:/diagona/icons/diagona/icons/arrow-circle-double-135.png</iconset>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="2">
|
||||||
|
<widget class="QWidget" name="qw_ComPanelTransponder" native="true">
|
||||||
|
<layout class="QGridLayout" name="gl_ComPanelTransponderTop">
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="spacing">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QLabel" name="lbl_ComPanelTransponder">
|
||||||
|
<property name="frameShape">
|
||||||
|
<enum>QFrame::NoFrame</enum>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>XPDR:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<widget class="QFrame" name="fr_ComPanelTransponder">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="frameShape">
|
||||||
|
<enum>QFrame::StyledPanel</enum>
|
||||||
|
</property>
|
||||||
|
<property name="frameShadow">
|
||||||
|
<enum>QFrame::Raised</enum>
|
||||||
|
</property>
|
||||||
|
<layout class="QHBoxLayout" name="hl_ComPanelTransponder">
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="QLineEdit" name="le_ComPanelTransponderCode">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="inputMask">
|
||||||
|
<string>9999</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>7000</string>
|
||||||
|
</property>
|
||||||
|
<property name="maxLength">
|
||||||
|
<number>4</number>
|
||||||
|
</property>
|
||||||
|
<property name="frame">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="BlackGui::CTransponderModeSelector" name="cbp_ComPanelTransponderMode">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="2">
|
||||||
|
<widget class="QWidget" name="qw_ComPanelSelcal" native="true">
|
||||||
|
<layout class="QGridLayout" name="gl_ComPanelSelect">
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="verticalSpacing">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item row="1" column="0" colspan="2">
|
||||||
|
<widget class="QFrame" name="fr_ComPanelSelcalBottom">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="frameShape">
|
||||||
|
<enum>QFrame::StyledPanel</enum>
|
||||||
|
</property>
|
||||||
|
<property name="frameShadow">
|
||||||
|
<enum>QFrame::Raised</enum>
|
||||||
|
</property>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
|
<property name="spacing">
|
||||||
|
<number>3</number>
|
||||||
|
</property>
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="QComboBox" name="cb_ComPanelSelcalSelector1">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QComboBox" name="cb_ComPanelSelcalSelector2">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="0" colspan="2">
|
||||||
|
<widget class="QFrame" name="fr_ComPanelSelcalTop">
|
||||||
|
<property name="frameShape">
|
||||||
|
<enum>QFrame::StyledPanel</enum>
|
||||||
|
</property>
|
||||||
|
<property name="frameShadow">
|
||||||
|
<enum>QFrame::Raised</enum>
|
||||||
|
</property>
|
||||||
|
<layout class="QHBoxLayout" name="hl_ComPanelSelcalTop">
|
||||||
|
<property name="spacing">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="lbl_ComSelcalSelcal">
|
||||||
|
<property name="text">
|
||||||
|
<string>SELCAL:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="pb_ComPanelSelcalTest">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>test SELCAL</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Test</string>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="../../blackmisc/blackmisc.qrc">
|
||||||
|
<normaloff>:/diagona/icons/diagona/icons/speaker-volume.png</normaloff>:/diagona/icons/diagona/icons/speaker-volume.png</iconset>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QWidget" name="wi_CockpitComPanelBottomSpacer" native="true">
|
||||||
|
<layout class="QHBoxLayout" name="hl_CockpitComPanelBottomSpacer">
|
||||||
|
<property name="spacing">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<spacer name="vs_CockpitComPanelBottomSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>40</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<customwidgets>
|
||||||
|
<customwidget>
|
||||||
|
<class>BlackGui::CTransponderModeSelector</class>
|
||||||
|
<extends>QComboBox</extends>
|
||||||
|
<header>blackgui/transpondermodeselector.h</header>
|
||||||
|
</customwidget>
|
||||||
|
</customwidgets>
|
||||||
|
<resources>
|
||||||
|
<include location="../../blackmisc/blackmisc.qrc"/>
|
||||||
|
</resources>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
||||||
54
src/blackgui/components/cockpitinfoareacomponent.cpp
Normal file
54
src/blackgui/components/cockpitinfoareacomponent.cpp
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
/* Copyright (C) 2013
|
||||||
|
* swift project Community / Contributors
|
||||||
|
*
|
||||||
|
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
|
||||||
|
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
|
||||||
|
* including this file, may be copied, modified, propagated, or distributed except according to the terms
|
||||||
|
* contained in the LICENSE file.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "cockpitinfoareacomponent.h"
|
||||||
|
#include "ui_cockpitinfoareacomponent.h"
|
||||||
|
#include "blackmisc/icons.h"
|
||||||
|
|
||||||
|
using namespace BlackMisc;
|
||||||
|
|
||||||
|
namespace BlackGui
|
||||||
|
{
|
||||||
|
namespace Components
|
||||||
|
{
|
||||||
|
|
||||||
|
CCockpitInfoAreaComponent::CCockpitInfoAreaComponent(QWidget *parent) :
|
||||||
|
CInfoArea(parent),
|
||||||
|
ui(new Ui::CCockpitInfoAreaComponent)
|
||||||
|
{
|
||||||
|
ui->setupUi(this);
|
||||||
|
initInfoArea();
|
||||||
|
if (this->statusBar())
|
||||||
|
{
|
||||||
|
this->statusBar()->hide();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
CCockpitInfoAreaComponent::~CCockpitInfoAreaComponent()
|
||||||
|
{ }
|
||||||
|
|
||||||
|
void CCockpitInfoAreaComponent::toggleFloating()
|
||||||
|
{
|
||||||
|
CInfoArea::toggleFloating();
|
||||||
|
}
|
||||||
|
|
||||||
|
QSize CCockpitInfoAreaComponent::getPreferredSizeWhenFloating(int areaIndex) const
|
||||||
|
{
|
||||||
|
Q_UNUSED(areaIndex);
|
||||||
|
return QSize(600, 400);
|
||||||
|
}
|
||||||
|
|
||||||
|
const QPixmap &CCockpitInfoAreaComponent::indexToPixmap(int areaIndex) const
|
||||||
|
{
|
||||||
|
Q_UNUSED(areaIndex);
|
||||||
|
return CIcons::empty16();
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace
|
||||||
|
} // namespace
|
||||||
54
src/blackgui/components/cockpitinfoareacomponent.h
Normal file
54
src/blackgui/components/cockpitinfoareacomponent.h
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
/* Copyright (C) 2013
|
||||||
|
* swift project Community / Contributors
|
||||||
|
*
|
||||||
|
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
|
||||||
|
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
|
||||||
|
* including this file, may be copied, modified, propagated, or distributed except according to the terms
|
||||||
|
* contained in the LICENSE file.
|
||||||
|
*/
|
||||||
|
|
||||||
|
//! \file
|
||||||
|
|
||||||
|
#ifndef BLACKGUI_COCKPITINFOAREACOMPONENT_H
|
||||||
|
#define BLACKGUI_COCKPITINFOAREACOMPONENT_H
|
||||||
|
|
||||||
|
#include "../infoarea.h"
|
||||||
|
#include <QMainWindow>
|
||||||
|
#include <QScopedPointer>
|
||||||
|
|
||||||
|
namespace Ui { class CCockpitInfoAreaComponent; }
|
||||||
|
namespace BlackGui
|
||||||
|
{
|
||||||
|
namespace Components
|
||||||
|
{
|
||||||
|
//! The cockpit itself is part of the main info area, but itself also an info area.
|
||||||
|
//! hence windows can be docked in the cockpit too.
|
||||||
|
class CCockpitInfoAreaComponent : public CInfoArea
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
//! Destructor
|
||||||
|
explicit CCockpitInfoAreaComponent(QWidget *parent = nullptr);
|
||||||
|
|
||||||
|
//! Destructor
|
||||||
|
~CCockpitInfoAreaComponent();
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
//! CInfoArea::toggleFloating
|
||||||
|
virtual void toggleFloating() override;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
//! \copydoc CInfoArea::getPreferredSizeWhenFloating
|
||||||
|
virtual QSize getPreferredSizeWhenFloating(int areaIndex) const override;
|
||||||
|
|
||||||
|
//! \copydoc CInfoArea::indexToPixmap
|
||||||
|
virtual const QPixmap &indexToPixmap(int areaIndex) const override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
QScopedPointer<Ui::CCockpitInfoAreaComponent> ui;
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace
|
||||||
|
} // namespace
|
||||||
|
#endif // guard
|
||||||
109
src/blackgui/components/cockpitinfoareacomponent.ui
Normal file
109
src/blackgui/components/cockpitinfoareacomponent.ui
Normal file
@@ -0,0 +1,109 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>CCockpitInfoAreaComponent</class>
|
||||||
|
<widget class="QMainWindow" name="CCockpitInfoAreaComponent">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>80</width>
|
||||||
|
<height>75</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>MainWindow</string>
|
||||||
|
</property>
|
||||||
|
<widget class="QWidget" name="qw_CockpitInfoAreaComComponent">
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
|
<property name="spacing">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="BlackGui::Components::CCockpitComComponent" name="comp_CockpitComComponent">
|
||||||
|
<property name="frameShape">
|
||||||
|
<enum>QFrame::StyledPanel</enum>
|
||||||
|
</property>
|
||||||
|
<property name="frameShadow">
|
||||||
|
<enum>QFrame::Raised</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<widget class="QStatusBar" name="sb_CockpitInfoAreaStatusBar"/>
|
||||||
|
<widget class="BlackGui::CDockWidgetInfoArea" name="dw_CockpitVoiceRooms">
|
||||||
|
<property name="allowedAreas">
|
||||||
|
<set>Qt::TopDockWidgetArea</set>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>Voice rooms</string>
|
||||||
|
</property>
|
||||||
|
<attribute name="dockWidgetArea">
|
||||||
|
<number>8</number>
|
||||||
|
</attribute>
|
||||||
|
<widget class="QWidget" name="qw_CockpitVoiceRooms">
|
||||||
|
<layout class="QVBoxLayout" name="vl_CockpitMainArea">
|
||||||
|
<property name="spacing">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="BlackGui::Components::CVoiceRoomsComponent" name="comp_VoiceRooms">
|
||||||
|
<property name="frameShape">
|
||||||
|
<enum>QFrame::StyledPanel</enum>
|
||||||
|
</property>
|
||||||
|
<property name="frameShadow">
|
||||||
|
<enum>QFrame::Raised</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
<customwidgets>
|
||||||
|
<customwidget>
|
||||||
|
<class>BlackGui::CDockWidgetInfoArea</class>
|
||||||
|
<extends>QDockWidget</extends>
|
||||||
|
<header>blackgui/dockwidgetinfoarea.h</header>
|
||||||
|
<container>1</container>
|
||||||
|
</customwidget>
|
||||||
|
<customwidget>
|
||||||
|
<class>BlackGui::Components::CCockpitComComponent</class>
|
||||||
|
<extends>QFrame</extends>
|
||||||
|
<header>blackgui/components/cockpitcomcomponent.h</header>
|
||||||
|
<container>1</container>
|
||||||
|
</customwidget>
|
||||||
|
<customwidget>
|
||||||
|
<class>BlackGui::Components::CVoiceRoomsComponent</class>
|
||||||
|
<extends>QFrame</extends>
|
||||||
|
<header>blackgui/components/voiceroomscomponent.h</header>
|
||||||
|
<container>1</container>
|
||||||
|
</customwidget>
|
||||||
|
</customwidgets>
|
||||||
|
<resources/>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
||||||
@@ -17,6 +17,7 @@ namespace BlackGui
|
|||||||
CDockWidgetInfoAreaComponent::CDockWidgetInfoAreaComponent(QWidget *parent)
|
CDockWidgetInfoAreaComponent::CDockWidgetInfoAreaComponent(QWidget *parent)
|
||||||
{
|
{
|
||||||
// it the parent is already an info area at this time, we keep it
|
// it the parent is already an info area at this time, we keep it
|
||||||
|
// otherwise we expect the info area to set it later
|
||||||
CDockWidgetInfoArea *ia = dynamic_cast<CDockWidgetInfoArea *>(parent);
|
CDockWidgetInfoArea *ia = dynamic_cast<CDockWidgetInfoArea *>(parent);
|
||||||
if (ia)
|
if (ia)
|
||||||
{
|
{
|
||||||
@@ -24,6 +25,21 @@ namespace BlackGui
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool CDockWidgetInfoAreaComponent::setParentDockWidgetInfoArea(CDockWidgetInfoArea *parentDockableWidget)
|
||||||
|
{
|
||||||
|
// sanity check
|
||||||
|
if (this->m_parentDockableInfoArea)
|
||||||
|
{
|
||||||
|
// we already have a value
|
||||||
|
// changes should not happen
|
||||||
|
Q_ASSERT(this->m_parentDockableInfoArea == parentDockableWidget);
|
||||||
|
return this->m_parentDockableInfoArea == parentDockableWidget;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_parentDockableInfoArea = parentDockableWidget;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
const CInfoArea *CDockWidgetInfoAreaComponent::getParentInfoArea() const
|
const CInfoArea *CDockWidgetInfoAreaComponent::getParentInfoArea() const
|
||||||
{
|
{
|
||||||
Q_ASSERT(this->m_parentDockableInfoArea);
|
Q_ASSERT(this->m_parentDockableInfoArea);
|
||||||
|
|||||||
@@ -33,7 +33,8 @@ namespace BlackGui
|
|||||||
const BlackGui::CDockWidgetInfoArea *getDockWidget() const { return m_parentDockableInfoArea; }
|
const BlackGui::CDockWidgetInfoArea *getDockWidget() const { return m_parentDockableInfoArea; }
|
||||||
|
|
||||||
//! Corresponding dockable widget in info area
|
//! Corresponding dockable widget in info area
|
||||||
void setParentDockableWidget(BlackGui::CDockWidgetInfoArea *parentDockableWidget) { m_parentDockableInfoArea = parentDockableWidget; }
|
//! \remarks Usually set from CDockWidgetInfoArea when it is fully initialized
|
||||||
|
bool setParentDockWidgetInfoArea(BlackGui::CDockWidgetInfoArea *parentDockableWidget);
|
||||||
|
|
||||||
//! The parent info area
|
//! The parent info area
|
||||||
const CInfoArea *getParentInfoArea() const;
|
const CInfoArea *getParentInfoArea() const;
|
||||||
|
|||||||
@@ -33,9 +33,7 @@ namespace BlackGui
|
|||||||
}
|
}
|
||||||
|
|
||||||
CMainInfoAreaComponent::~CMainInfoAreaComponent()
|
CMainInfoAreaComponent::~CMainInfoAreaComponent()
|
||||||
{
|
{ }
|
||||||
delete ui;
|
|
||||||
}
|
|
||||||
|
|
||||||
CAtcStationComponent *CMainInfoAreaComponent::getAtcStationComponent()
|
CAtcStationComponent *CMainInfoAreaComponent::getAtcStationComponent()
|
||||||
{
|
{
|
||||||
@@ -82,6 +80,7 @@ namespace BlackGui
|
|||||||
InfoArea area = static_cast<InfoArea>(areaIndex);
|
InfoArea area = static_cast<InfoArea>(areaIndex);
|
||||||
switch (area)
|
switch (area)
|
||||||
{
|
{
|
||||||
|
case InfoAreaCockpit:
|
||||||
case InfoAreaAircrafts:
|
case InfoAreaAircrafts:
|
||||||
case InfoAreaAtc:
|
case InfoAreaAtc:
|
||||||
case InfoAreaUsers:
|
case InfoAreaUsers:
|
||||||
@@ -112,6 +111,8 @@ namespace BlackGui
|
|||||||
InfoArea area = static_cast<InfoArea>(areaIndex);
|
InfoArea area = static_cast<InfoArea>(areaIndex);
|
||||||
switch (area)
|
switch (area)
|
||||||
{
|
{
|
||||||
|
case InfoAreaCockpit:
|
||||||
|
return CIcons::appCockpit16();
|
||||||
case InfoAreaUsers:
|
case InfoAreaUsers:
|
||||||
return CIcons::appUsers16();
|
return CIcons::appUsers16();
|
||||||
case InfoAreaWeather:
|
case InfoAreaWeather:
|
||||||
@@ -136,5 +137,5 @@ namespace BlackGui
|
|||||||
return CIcons::empty();
|
return CIcons::empty();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} // namespace
|
||||||
}
|
} // namespace
|
||||||
|
|||||||
@@ -23,9 +23,9 @@
|
|||||||
#include "logcomponent.h"
|
#include "logcomponent.h"
|
||||||
#include <QTabBar>
|
#include <QTabBar>
|
||||||
#include <QPixmap>
|
#include <QPixmap>
|
||||||
|
#include <QScopedPointer>
|
||||||
|
|
||||||
namespace Ui { class CMainInfoAreaComponent; }
|
namespace Ui { class CMainInfoAreaComponent; }
|
||||||
|
|
||||||
namespace BlackGui
|
namespace BlackGui
|
||||||
{
|
{
|
||||||
namespace Components
|
namespace Components
|
||||||
@@ -47,16 +47,17 @@ namespace BlackGui
|
|||||||
enum InfoArea
|
enum InfoArea
|
||||||
{
|
{
|
||||||
// index must match tab index!
|
// index must match tab index!
|
||||||
InfoAreaAircrafts = 0,
|
InfoAreaCockpit = 0,
|
||||||
InfoAreaAtc = 1,
|
InfoAreaAircrafts = 1,
|
||||||
InfoAreaUsers = 2,
|
InfoAreaAtc = 2,
|
||||||
InfoAreaTextMessages = 3,
|
InfoAreaUsers = 3,
|
||||||
InfoAreaSimulator = 4,
|
InfoAreaTextMessages = 4,
|
||||||
InfoAreaFlightPlan = 5,
|
InfoAreaSimulator = 5,
|
||||||
InfoAreaWeather = 6,
|
InfoAreaFlightPlan = 6,
|
||||||
InfoAreaMappings = 7,
|
InfoAreaWeather = 7,
|
||||||
InfoAreaLog = 8,
|
InfoAreaMappings = 8,
|
||||||
InfoAreaSettings = 9,
|
InfoAreaLog = 9,
|
||||||
|
InfoAreaSettings = 10,
|
||||||
InfoAreaNone = -1
|
InfoAreaNone = -1
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -105,8 +106,7 @@ namespace BlackGui
|
|||||||
virtual const QPixmap &indexToPixmap(int areaIndex) const override;
|
virtual const QPixmap &indexToPixmap(int areaIndex) const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::CMainInfoAreaComponent *ui = nullptr;
|
QScopedPointer<Ui::CMainInfoAreaComponent> ui;
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,8 +6,8 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>1207</width>
|
<width>1266</width>
|
||||||
<height>97</height>
|
<height>55</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
@@ -39,11 +39,44 @@
|
|||||||
<set>QMainWindow::AllowTabbedDocks|QMainWindow::AnimatedDocks|QMainWindow::ForceTabbedDocks</set>
|
<set>QMainWindow::AllowTabbedDocks|QMainWindow::AnimatedDocks|QMainWindow::ForceTabbedDocks</set>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="qw_centralWidgetEmpty"/>
|
<widget class="QWidget" name="qw_centralWidgetEmpty"/>
|
||||||
|
<widget class="BlackGui::CDockWidgetInfoArea" name="dw_Cockpit">
|
||||||
|
<property name="allowedAreas">
|
||||||
|
<set>Qt::TopDockWidgetArea</set>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>Cockpit</string>
|
||||||
|
</property>
|
||||||
|
<attribute name="dockWidgetArea">
|
||||||
|
<number>4</number>
|
||||||
|
</attribute>
|
||||||
|
<widget class="QWidget" name="dw_CockpitInner">
|
||||||
|
<layout class="QVBoxLayout" name="vl_Cockpit">
|
||||||
|
<property name="spacing">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="BlackGui::Components::CCockpitInfoAreaComponent" name="comp_CockpitInfoArea" native="true"/>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
<widget class="BlackGui::CDockWidgetInfoArea" name="dw_Aircrafts">
|
<widget class="BlackGui::CDockWidgetInfoArea" name="dw_Aircrafts">
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>0</width>
|
<width>127</width>
|
||||||
<height>0</height>
|
<height>38</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="features">
|
<property name="features">
|
||||||
@@ -103,8 +136,8 @@
|
|||||||
<widget class="BlackGui::CDockWidgetInfoArea" name="dw_AtcStations">
|
<widget class="BlackGui::CDockWidgetInfoArea" name="dw_AtcStations">
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>0</width>
|
<width>127</width>
|
||||||
<height>0</height>
|
<height>38</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="floating">
|
<property name="floating">
|
||||||
@@ -164,8 +197,8 @@
|
|||||||
<widget class="BlackGui::CDockWidgetInfoArea" name="dw_Users">
|
<widget class="BlackGui::CDockWidgetInfoArea" name="dw_Users">
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>0</width>
|
<width>127</width>
|
||||||
<height>0</height>
|
<height>38</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="allowedAreas">
|
<property name="allowedAreas">
|
||||||
@@ -210,8 +243,8 @@
|
|||||||
<widget class="BlackGui::CDockWidgetInfoArea" name="dw_TextMessages">
|
<widget class="BlackGui::CDockWidgetInfoArea" name="dw_TextMessages">
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>0</width>
|
<width>127</width>
|
||||||
<height>0</height>
|
<height>38</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="allowedAreas">
|
<property name="allowedAreas">
|
||||||
@@ -256,8 +289,8 @@
|
|||||||
<widget class="BlackGui::CDockWidgetInfoArea" name="dw_Simulator">
|
<widget class="BlackGui::CDockWidgetInfoArea" name="dw_Simulator">
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>0</width>
|
<width>127</width>
|
||||||
<height>0</height>
|
<height>38</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="allowedAreas">
|
<property name="allowedAreas">
|
||||||
@@ -302,8 +335,8 @@
|
|||||||
<widget class="BlackGui::CDockWidgetInfoArea" name="dw_FlightPlan">
|
<widget class="BlackGui::CDockWidgetInfoArea" name="dw_FlightPlan">
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>0</width>
|
<width>127</width>
|
||||||
<height>0</height>
|
<height>38</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="allowedAreas">
|
<property name="allowedAreas">
|
||||||
@@ -348,8 +381,8 @@
|
|||||||
<widget class="BlackGui::CDockWidgetInfoArea" name="dw_Weather">
|
<widget class="BlackGui::CDockWidgetInfoArea" name="dw_Weather">
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>0</width>
|
<width>80</width>
|
||||||
<height>0</height>
|
<height>38</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="allowedAreas">
|
<property name="allowedAreas">
|
||||||
@@ -397,8 +430,8 @@
|
|||||||
<widget class="BlackGui::CDockWidgetInfoArea" name="dw_Mappings">
|
<widget class="BlackGui::CDockWidgetInfoArea" name="dw_Mappings">
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>0</width>
|
<width>127</width>
|
||||||
<height>0</height>
|
<height>38</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="allowedAreas">
|
<property name="allowedAreas">
|
||||||
@@ -443,8 +476,8 @@
|
|||||||
<widget class="BlackGui::CDockWidgetInfoArea" name="dw_Log">
|
<widget class="BlackGui::CDockWidgetInfoArea" name="dw_Log">
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>0</width>
|
<width>80</width>
|
||||||
<height>0</height>
|
<height>38</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="allowedAreas">
|
<property name="allowedAreas">
|
||||||
@@ -489,8 +522,8 @@
|
|||||||
<widget class="BlackGui::CDockWidgetInfoArea" name="dw_Settings">
|
<widget class="BlackGui::CDockWidgetInfoArea" name="dw_Settings">
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>0</width>
|
<width>127</width>
|
||||||
<height>0</height>
|
<height>38</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="allowedAreas">
|
<property name="allowedAreas">
|
||||||
@@ -534,6 +567,18 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
<customwidgets>
|
<customwidgets>
|
||||||
|
<customwidget>
|
||||||
|
<class>BlackGui::CDockWidgetInfoArea</class>
|
||||||
|
<extends>QDockWidget</extends>
|
||||||
|
<header>blackgui/dockwidgetinfoarea.h</header>
|
||||||
|
<container>1</container>
|
||||||
|
</customwidget>
|
||||||
|
<customwidget>
|
||||||
|
<class>BlackGui::Components::CCockpitInfoAreaComponent</class>
|
||||||
|
<extends>QWidget</extends>
|
||||||
|
<header>blackgui/components/cockpitinfoareacomponent.h</header>
|
||||||
|
<container>1</container>
|
||||||
|
</customwidget>
|
||||||
<customwidget>
|
<customwidget>
|
||||||
<class>BlackGui::Components::CAtcStationComponent</class>
|
<class>BlackGui::Components::CAtcStationComponent</class>
|
||||||
<extends>QTabWidget</extends>
|
<extends>QTabWidget</extends>
|
||||||
@@ -570,12 +615,6 @@
|
|||||||
<header>blackgui/components/settingscomponent.h</header>
|
<header>blackgui/components/settingscomponent.h</header>
|
||||||
<container>1</container>
|
<container>1</container>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
<customwidget>
|
|
||||||
<class>BlackGui::CDockWidgetInfoArea</class>
|
|
||||||
<extends>QDockWidget</extends>
|
|
||||||
<header>blackgui/dockwidgetinfoarea.h</header>
|
|
||||||
<container>1</container>
|
|
||||||
</customwidget>
|
|
||||||
<customwidget>
|
<customwidget>
|
||||||
<class>BlackGui::Components::CLogComponent</class>
|
<class>BlackGui::Components::CLogComponent</class>
|
||||||
<extends>QFrame</extends>
|
<extends>QFrame</extends>
|
||||||
|
|||||||
@@ -76,15 +76,18 @@ namespace BlackGui
|
|||||||
|
|
||||||
void CDockWidgetInfoArea::initalFloating()
|
void CDockWidgetInfoArea::initalFloating()
|
||||||
{
|
{
|
||||||
CDockWidget::initalFloating();
|
CDockWidget::initalFloating(); // initial floating to init position & size
|
||||||
QList<CDockWidgetInfoAreaComponent *> infoAreaDockWidgets = this->findEmbeddedDockWidgetInfoAreaComponents();
|
QList<CDockWidgetInfoAreaComponent *> infoAreaDockWidgets = this->findEmbeddedDockWidgetInfoAreaComponents();
|
||||||
foreach(CDockWidgetInfoAreaComponent * dwia, infoAreaDockWidgets)
|
foreach(CDockWidgetInfoAreaComponent * dwia, infoAreaDockWidgets)
|
||||||
{
|
{
|
||||||
dwia->setParentDockableWidget(this);
|
// KWB: potentially a risk when this object is deleted
|
||||||
|
// put under normal situations the child object will be deleted as well, and we have
|
||||||
|
// no multi-threaded GUI
|
||||||
|
dwia->setParentDockWidgetInfoArea(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<CDockWidgetInfoAreaComponent *> CDockWidgetInfoArea::findEmbeddedDockWidgetInfoAreaComponents() const
|
QList<CDockWidgetInfoAreaComponent *> CDockWidgetInfoArea::findEmbeddedDockWidgetInfoAreaComponents()
|
||||||
{
|
{
|
||||||
QList<QWidget *> widgets = this->findChildren<QWidget *>();
|
QList<QWidget *> widgets = this->findChildren<QWidget *>();
|
||||||
QList<CDockWidgetInfoAreaComponent *> widgetsWithDockWidgetInfoAreaComponent;
|
QList<CDockWidgetInfoAreaComponent *> widgetsWithDockWidgetInfoAreaComponent;
|
||||||
@@ -96,6 +99,27 @@ namespace BlackGui
|
|||||||
widgetsWithDockWidgetInfoAreaComponent.append(dwc);
|
widgetsWithDockWidgetInfoAreaComponent.append(dwc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
QList<CDockWidgetInfoArea *> nestedInfoAreas = this->findNestedInfoAreas();
|
||||||
|
if (nestedInfoAreas.isEmpty()) return widgetsWithDockWidgetInfoAreaComponent;
|
||||||
|
|
||||||
|
// we have to exclude the nested embedded areas
|
||||||
|
foreach(CDockWidgetInfoArea * ia, nestedInfoAreas)
|
||||||
|
{
|
||||||
|
QList<CDockWidgetInfoAreaComponent *> nestedInfoAreaComponents = ia->findEmbeddedDockWidgetInfoAreaComponents();
|
||||||
|
if (nestedInfoAreaComponents.isEmpty()) continue;
|
||||||
|
foreach(CDockWidgetInfoAreaComponent * iac, nestedInfoAreaComponents)
|
||||||
|
{
|
||||||
|
bool r = widgetsWithDockWidgetInfoAreaComponent.removeOne(iac);
|
||||||
|
Q_ASSERT(r); // why is the nested component not in the child list?
|
||||||
|
Q_UNUSED(r);
|
||||||
|
}
|
||||||
|
}
|
||||||
return widgetsWithDockWidgetInfoAreaComponent;
|
return widgetsWithDockWidgetInfoAreaComponent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QList<CDockWidgetInfoArea *> CDockWidgetInfoArea::findNestedInfoAreas()
|
||||||
|
{
|
||||||
|
QList<CDockWidgetInfoArea *> nestedInfoAreas = this->findChildren<CDockWidgetInfoArea *>();
|
||||||
|
return nestedInfoAreas;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,8 +51,13 @@ namespace BlackGui
|
|||||||
virtual void initalFloating() override;
|
virtual void initalFloating() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
//! Find all embedded runtime components
|
//! Find all embedded dock widget components. These are components marked as CDockWidgetInfoAreaComponent
|
||||||
QList<Components::CDockWidgetInfoAreaComponent *> findEmbeddedDockWidgetInfoAreaComponents() const;
|
//! \remarks Only directly embedded info area components, not those of nested info areas
|
||||||
|
QList<Components::CDockWidgetInfoAreaComponent *> findEmbeddedDockWidgetInfoAreaComponents();
|
||||||
|
|
||||||
|
//! Nested info areas
|
||||||
|
QList<CDockWidgetInfoArea *> findNestedInfoAreas();
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ namespace BlackGui
|
|||||||
// after(!) GUI is established
|
// after(!) GUI is established
|
||||||
if (this->m_dockableWidgets.isEmpty())
|
if (this->m_dockableWidgets.isEmpty())
|
||||||
{
|
{
|
||||||
this->m_dockableWidgets = this->findChildren<CDockWidgetInfoArea *>();
|
this->m_dockableWidgets = this->getOwnDockWidgetAreas();
|
||||||
Q_ASSERT(!this->m_dockableWidgets.isEmpty());
|
Q_ASSERT(!this->m_dockableWidgets.isEmpty());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -50,32 +50,40 @@ namespace BlackGui
|
|||||||
|
|
||||||
// initial style sheet setting
|
// initial style sheet setting
|
||||||
this->ps_onStyleSheetChanged();
|
this->ps_onStyleSheetChanged();
|
||||||
|
|
||||||
|
// status bar
|
||||||
|
if (this->statusBar())
|
||||||
|
{
|
||||||
|
this->statusBar()->hide();
|
||||||
|
this->statusBar()->setMaximumHeight(0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CInfoArea::addToContextMenu(QMenu *menu) const
|
void CInfoArea::addToContextMenu(QMenu *menu) const
|
||||||
{
|
{
|
||||||
if (!menu) return;
|
if (!menu) return;
|
||||||
menu->addAction(CIcons::dockTop16(), "Dock all", this, SLOT(dockAllWidgets()));
|
bool hasWidgets = this->countDockedWidgets() > 0;
|
||||||
menu->addAction(CIcons::floatAll16(), "Float all", this, SLOT(floatAllWidgets()));
|
|
||||||
menu->addAction(CIcons::floatOne16(), "Dock / float info area", this, SLOT(toggleFloating()));
|
|
||||||
QAction *lockTabBarMenuAction = new QAction(menu);
|
|
||||||
lockTabBarMenuAction->setObjectName(this->objectName().append("LockTabBar"));
|
|
||||||
lockTabBarMenuAction->setIconText("Lock tab bar");
|
|
||||||
lockTabBarMenuAction->setIcon(CIcons::lockClosed16());
|
|
||||||
lockTabBarMenuAction->setCheckable(true);
|
|
||||||
lockTabBarMenuAction->setChecked(this->m_lockTabBar);
|
|
||||||
menu->addAction(lockTabBarMenuAction);
|
|
||||||
connect(lockTabBarMenuAction, &QAction::toggled, this, &CInfoArea::ps_toggleTabBarLocked);
|
|
||||||
|
|
||||||
if (!this->m_dockableWidgets.isEmpty())
|
if (hasWidgets)
|
||||||
{
|
{
|
||||||
bool c = false;
|
menu->addAction(CIcons::dockTop16(), "Dock all", this, SLOT(dockAllWidgets()));
|
||||||
|
menu->addAction(CIcons::floatAll16(), "Float all", this, SLOT(floatAllWidgets()));
|
||||||
|
menu->addAction(CIcons::floatOne16(), "Dock / float info area", this, SLOT(toggleFloating()));
|
||||||
|
QAction *lockTabBarMenuAction = new QAction(menu);
|
||||||
|
lockTabBarMenuAction->setObjectName(this->objectName().append("LockTabBar"));
|
||||||
|
lockTabBarMenuAction->setIconText("Lock tab bar");
|
||||||
|
lockTabBarMenuAction->setIcon(CIcons::lockClosed16());
|
||||||
|
lockTabBarMenuAction->setCheckable(true);
|
||||||
|
lockTabBarMenuAction->setChecked(this->m_lockTabBar);
|
||||||
|
menu->addAction(lockTabBarMenuAction);
|
||||||
|
connect(lockTabBarMenuAction, &QAction::toggled, this, &CInfoArea::ps_toggleTabBarLocked);
|
||||||
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);
|
||||||
|
|
||||||
QSignalMapper *signalMapperToggleFloating = new QSignalMapper(menu);
|
QSignalMapper *signalMapperToggleFloating = new QSignalMapper(menu);
|
||||||
QSignalMapper *signalMapperDisplay = new QSignalMapper(menu);
|
QSignalMapper *signalMapperDisplay = new QSignalMapper(menu);
|
||||||
|
bool c = false;
|
||||||
|
|
||||||
for (int i = 0; i < this->m_dockableWidgets.size(); i++)
|
for (int i = 0; i < this->m_dockableWidgets.size(); i++)
|
||||||
{
|
{
|
||||||
@@ -263,55 +271,62 @@ namespace BlackGui
|
|||||||
this->setTabPosition(Qt::LeftDockWidgetArea, QTabWidget::East);
|
this->setTabPosition(Qt::LeftDockWidgetArea, QTabWidget::East);
|
||||||
bool init = this->m_tabBar ? false : true;
|
bool init = this->m_tabBar ? false : true;
|
||||||
|
|
||||||
if (!this->m_dockableWidgets.isEmpty())
|
for (int i = 0; i < this->m_dockableWidgets.size(); i++)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < this->m_dockableWidgets.size(); i++)
|
CDockWidgetInfoArea *first = i > 0 ? this->m_dockableWidgets.at(i - 1) : nullptr;
|
||||||
{
|
CDockWidgetInfoArea *after = this->m_dockableWidgets.at(i);
|
||||||
CDockWidgetInfoArea *first = i > 0 ? this->m_dockableWidgets.at(i - 1) : nullptr;
|
Q_ASSERT(after);
|
||||||
CDockWidgetInfoArea *after = this->m_dockableWidgets.at(i);
|
|
||||||
Q_ASSERT(after);
|
|
||||||
|
|
||||||
// trick, init widget as floating
|
// trick, init widget as floating
|
||||||
// this completely initializes the tab bar and all docked widgets
|
// this completely initializes the tab bar and all docked widgets
|
||||||
if (init)
|
if (init)
|
||||||
{
|
{
|
||||||
QPoint offset(i * 25, i * 20);
|
QPoint offset(i * 25, i * 20);
|
||||||
after->setVisible(false);
|
after->setVisible(false);
|
||||||
after->setFloating(true);
|
after->setFloating(true);
|
||||||
after->setOffsetWhenFloating(offset);
|
after->setOffsetWhenFloating(offset);
|
||||||
after->setPreferredSizeWhenFloating(getPreferredSizeWhenFloating(i));
|
after->setPreferredSizeWhenFloating(getPreferredSizeWhenFloating(i));
|
||||||
after->setFloating(false);
|
after->setFloating(false);
|
||||||
after->setVisible(true);
|
after->setVisible(true);
|
||||||
after->resetWasAlreadyFLoating();
|
after->resetWasAlreadyFLoating();
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
after->setFloating(false);
|
|
||||||
}
|
|
||||||
if (!first) { continue; }
|
|
||||||
this->tabifyDockWidget(first, after);
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
after->setFloating(false);
|
||||||
|
}
|
||||||
|
if (!first) { continue; }
|
||||||
|
this->tabifyDockWidget(first, after);
|
||||||
}
|
}
|
||||||
|
|
||||||
// as now tabified, now set tab
|
// as now tabified, now set tab
|
||||||
if (!this->m_tabBar)
|
if (!this->m_tabBar)
|
||||||
{
|
{
|
||||||
this->m_tabBar = this->findChild<QTabBar *>();
|
this->m_tabBar = this->findChild<QTabBar *>();
|
||||||
Q_ASSERT(m_tabBar);
|
|
||||||
QString qss = CStyleSheetUtility::instance().style(CStyleSheetUtility::fileNameDockWidgetTab());
|
|
||||||
this->m_tabBar->setStyleSheet(qss);
|
|
||||||
this->m_tabBar->setObjectName("comp_MainInfoAreaDockWidgetTab");
|
|
||||||
this->m_tabBar->setMovable(false);
|
|
||||||
this->m_tabBar->setElideMode(Qt::ElideNone);
|
|
||||||
this->setTabPixmaps();
|
|
||||||
|
|
||||||
// East / West does not work (shown, but area itself empty)
|
// if we have > 1 docked widgets, we have a tab bar
|
||||||
// South does not have any effect
|
if (this->m_tabBar)
|
||||||
this->m_tabBar->setShape(QTabBar::TriangularSouth);
|
{
|
||||||
|
QString qss = CStyleSheetUtility::instance().style(CStyleSheetUtility::fileNameDockWidgetTab());
|
||||||
|
this->m_tabBar->setStyleSheet(qss);
|
||||||
|
this->m_tabBar->setObjectName("comp_MainInfoAreaDockWidgetTab");
|
||||||
|
this->m_tabBar->setMovable(false);
|
||||||
|
this->m_tabBar->setElideMode(Qt::ElideNone);
|
||||||
|
this->setTabPixmaps();
|
||||||
|
|
||||||
// signals
|
// East / West does not work (shown, but area itself empty)
|
||||||
connect(this->m_tabBar, &QTabBar::tabBarDoubleClicked, this, &CInfoArea::ps_tabBarDoubleClicked);
|
// South does not have any effect
|
||||||
connect(this->m_tabBar, &QTabBar::currentChanged, this, &CInfoArea::tabBarCurrentChanged);
|
this->m_tabBar->setShape(QTabBar::TriangularSouth);
|
||||||
|
|
||||||
|
// signals
|
||||||
|
connect(this->m_tabBar, &QTabBar::tabBarDoubleClicked, this, &CInfoArea::ps_tabBarDoubleClicked);
|
||||||
|
connect(this->m_tabBar, &QTabBar::currentChanged, this, &CInfoArea::tabBarCurrentChanged);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// <= 1 dock widget
|
||||||
|
this->m_tabBar = new QTabBar(this);
|
||||||
|
this->m_tabBar->hide();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this->countDockedWidgets() > 0)
|
if (this->countDockedWidgets() > 0)
|
||||||
@@ -358,6 +373,30 @@ namespace BlackGui
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QList<CDockWidgetInfoArea *> CInfoArea::getOwnDockWidgetAreas()
|
||||||
|
{
|
||||||
|
QList<CDockWidgetInfoArea *> infoAreas = this->findChildren<CDockWidgetInfoArea *>();
|
||||||
|
if (infoAreas.isEmpty()) { return infoAreas; }
|
||||||
|
|
||||||
|
// nested info areas?
|
||||||
|
QList<CInfoArea *> childInfoAreas = this->getChildInfoAreas();
|
||||||
|
if (childInfoAreas.isEmpty()) { return infoAreas; }
|
||||||
|
|
||||||
|
// we have child info areas (nested), we need to remove those from the list
|
||||||
|
for (CInfoArea *ia : childInfoAreas)
|
||||||
|
{
|
||||||
|
QList<CDockWidgetInfoArea *> nestedDockWidgets = ia->getOwnDockWidgetAreas();
|
||||||
|
if (nestedDockWidgets.isEmpty()) { continue; }
|
||||||
|
for (CDockWidgetInfoArea *ndw : nestedDockWidgets)
|
||||||
|
{
|
||||||
|
bool r = infoAreas.removeOne(ndw);
|
||||||
|
Q_ASSERT(r);
|
||||||
|
Q_UNUSED(r);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return infoAreas;
|
||||||
|
}
|
||||||
|
|
||||||
int CInfoArea::countDockedWidgets() const
|
int CInfoArea::countDockedWidgets() const
|
||||||
{
|
{
|
||||||
if (!this->m_tabBar) return 0;
|
if (!this->m_tabBar) return 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user