refs #312 navigation bars, contributes also to #347

* allow to set/unset frameless mode in CDockWidget
* adjusted context menus
* adjusted style sheets
* ini settings for margins
* hidden info area to host floating widgets only visible when floating (allows to CDockInfoArea widgets)
* made some private slots non-virtual
This commit is contained in:
Klaus Basan
2015-04-08 22:46:54 +02:00
parent 425e034b19
commit e7c8c28252
23 changed files with 556 additions and 175 deletions

View File

@@ -308,17 +308,6 @@ void SwiftGuiStd::ps_onChangedMainInfoAreaFloating(bool floating)
Q_UNUSED(floating);
}
void SwiftGuiStd::ps_toggleNavigatorHorizontal()
{
}
void SwiftGuiStd::ps_toggleNavigatorVertical()
{
bool v = ui->ndw_NavigatorVertical->isVisible();
ui->ndw_NavigatorVertical->setVisible(!v);
}
void SwiftGuiStd::playNotifcationSound(CNotificationSounds::Notification notification) const
{
if (!this->m_contextAudioAvailable) return;

View File

@@ -58,7 +58,8 @@ public:
{
MainPageInfoArea = 0,
MainPageLogin = 1,
MainPageInternals = 2
MainPageInternals = 2,
MainPageInvisible = 3
};
//! Constructor
@@ -121,9 +122,6 @@ private:
//! Init GUI signals
void initGuiSignals();
//! Init the navigstion bars
void initNavigationBars();
//! Init dynamic menus
void initDynamicMenus();
@@ -240,13 +238,6 @@ private slots:
//! Whole main info area floating
void ps_onChangedMainInfoAreaFloating(bool floating);
//! Toggle horizontal navigator
void ps_toggleNavigatorHorizontal();
//! Toggle vertical navigator
void ps_toggleNavigatorVertical();
};
#pragma pop_macro("interface")

View File

@@ -90,6 +90,9 @@
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="lineWidth">
<number>0</number>
</property>
<layout class="QVBoxLayout" name="vl_CentralFrameInside">
<property name="leftMargin">
<number>0</number>
@@ -125,7 +128,7 @@
<enum>QFrame::NoFrame</enum>
</property>
<property name="currentIndex">
<number>2</number>
<number>3</number>
</property>
<widget class="QWidget" name="pg_MainInfoArea">
<layout class="QVBoxLayout" name="vl_MainInfoArea">
@@ -193,6 +196,13 @@
</item>
</layout>
</widget>
<widget class="QWidget" name="pg_InvisibleAreas">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="BlackGui::Components::CInvisibleInfoAreaComponent" name="comp_InvisibleInfoArea" native="true"/>
</item>
</layout>
</widget>
</widget>
</item>
<item>
@@ -305,8 +315,7 @@
<addaction name="menu_WindowFont"/>
<addaction name="menu_WindowMinimize"/>
<addaction name="menu_WindowToggleOnTop"/>
<addaction name="menu_NavigatorVertical"/>
<addaction name="menu_NavigatorHorizontal"/>
<addaction name="menu_WindowToggleNavigator"/>
</widget>
<addaction name="menu_File"/>
<addaction name="menuWindow"/>
@@ -344,46 +353,34 @@
<property name="allowedAreas">
<set>Qt::TopDockWidgetArea</set>
</property>
<property name="windowTitle">
<string>Info status bar</string>
</property>
<attribute name="dockWidgetArea">
<number>4</number>
</attribute>
<widget class="BlackGui::Components::CInfoBarStatusComponent" name="comp_InfoBarStatus"/>
</widget>
<widget class="BlackGui::Components::CNavigatorDockWidget" name="ndw_NavigatorHorizontal">
<property name="floating">
<bool>false</bool>
</property>
<property name="features">
<set>QDockWidget::DockWidgetFloatable|QDockWidget::DockWidgetMovable</set>
</property>
<property name="allowedAreas">
<set>Qt::NoDockWidgetArea</set>
</property>
<property name="windowTitle">
<string>Horizontal navigator</string>
</property>
<attribute name="dockWidgetArea">
<number>1</number>
</attribute>
<widget class="QWidget" name="qw_NavigatorHorizontal"/>
</widget>
<widget class="BlackGui::Components::CNavigatorDockWidget" name="ndw_NavigatorVertical">
<property name="floating">
<bool>false</bool>
</property>
<property name="features">
<set>QDockWidget::DockWidgetFloatable|QDockWidget::DockWidgetMovable</set>
</property>
<property name="allowedAreas">
<set>Qt::NoDockWidgetArea</set>
</property>
<property name="windowTitle">
<string>Vertical navigator</string>
</property>
<attribute name="dockWidgetArea">
<number>1</number>
</attribute>
<widget class="QWidget" name="qw_NavigatorVertical"/>
<widget class="QWidget" name="qw_InfoBarStatusInner">
<layout class="QVBoxLayout" name="vl_InfoBarStatusOuter">
<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 alignment="Qt::AlignTop">
<widget class="BlackGui::Components::CInfoBarStatusComponent" name="comp_InfoBarStatus" native="true"/>
</item>
</layout>
</widget>
</widget>
<action name="menu_TestLocationsEDDF">
<property name="text">
@@ -466,9 +463,9 @@
<string>Ctrl+W, Ctrl+T</string>
</property>
</action>
<action name="menu_NavigatorVertical">
<action name="menu_WindowToggleNavigator">
<property name="text">
<string>Vertical navigator</string>
<string>Navigator</string>
</property>
</action>
<action name="menu_NavigatorHorizontal">
@@ -516,9 +513,9 @@
<container>1</container>
</customwidget>
<customwidget>
<class>BlackGui::Components::CNavigatorDockWidget</class>
<extends>QDockWidget</extends>
<header>blackgui/components/navigatordockwidget.h</header>
<class>BlackGui::Components::CInvisibleInfoAreaComponent</class>
<extends>QWidget</extends>
<header>blackgui/components/invisibleinfoareacomponent.h</header>
<container>1</container>
</customwidget>
</customwidgets>

View File

@@ -38,6 +38,8 @@ using namespace BlackGui::Components;
*/
void SwiftGuiStd::init(const CRuntimeConfig &runtimeConfig)
{
// POST(!) GUI init
if (this->m_init) { return; }
this->setVisible(false); // hide all, so no flashing windows during init
@@ -64,7 +66,7 @@ void SwiftGuiStd::init(const CRuntimeConfig &runtimeConfig)
this->ui->vl_CentralWidgetOutside->addWidget(this->ui->sb_MainStatusBar, 0);
// grip
this->addFramelessSizeGrip(this->ui->sb_MainStatusBar);
this->addFramelessSizeGripToStatusBar(this->ui->sb_MainStatusBar);
}
// timers
@@ -74,13 +76,14 @@ void SwiftGuiStd::init(const CRuntimeConfig &runtimeConfig)
this->createRuntime(runtimeConfig, this);
CEnableForRuntime::setRuntimeForComponents(this->getRuntime(), this);
// info bar and status bar
this->m_statusBar.initStatusBar(this->ui->sb_MainStatusBar);
this->ui->dw_InfoBarStatus->allowStatusBar(false);
this->ui->dw_InfoBarStatus->setPreferredSizeWhenFloating(this->ui->dw_InfoBarStatus->size()); // set floating size
// wire GUI signals
this->initGuiSignals();
// status bar
this->ui->dw_InfoBarStatus->allowStatusBar(false);
this->m_statusBar.initStatusBar(this->ui->sb_MainStatusBar);
// signal / slots contexts / timers
connect(this->getIContextNetwork(), &IContextNetwork::connectionTerminated, this, &SwiftGuiStd::ps_onConnectionTerminated);
connect(this->getIContextNetwork(), &IContextNetwork::connectionStatusChanged, this, &SwiftGuiStd::ps_onConnectionStatusChanged);
@@ -105,9 +108,6 @@ void SwiftGuiStd::init(const CRuntimeConfig &runtimeConfig)
this->ps_setMainPageToInfoArea();
this->initDynamicMenus();
// navigation bars
// this->initNavigationBars();
// starting
this->getIContextApplication()->notifyAboutComponentChange(IContextApplication::ApplicationGui, IContextApplication::ApplicationStarts);
@@ -128,15 +128,6 @@ void SwiftGuiStd::init(const CRuntimeConfig &runtimeConfig)
this->m_init = true;
}
/*
* Init navigation bars
*/
void SwiftGuiStd::initNavigationBars()
{
ui->ndw_NavigatorHorizontal->setVisible(false);
ui->ndw_NavigatorVertical->setVisible(false);
}
/*
* GUI signals
*/
@@ -170,9 +161,8 @@ void SwiftGuiStd::initGuiSignals()
connect(this->ui->menu_WindowFont, &QAction::triggered, this, &SwiftGuiStd::ps_onMenuClicked);
connect(this->ui->menu_WindowMinimize, &QAction::triggered, this, &SwiftGuiStd::ps_onMenuClicked);
connect(this->ui->menu_WindowToggleOnTop, &QAction::triggered, this, &SwiftGuiStd::ps_onMenuClicked);
connect(this->ui->menu_NavigatorHorizontal, &QAction::triggered, this, &SwiftGuiStd::ps_toggleNavigatorHorizontal);
connect(this->ui->menu_NavigatorVertical, &QAction::triggered, this, &SwiftGuiStd::ps_toggleNavigatorVertical);
connect(this->ui->menu_DebugMetaTypes, &QAction::triggered, this, &SwiftGuiStd::ps_toggleNavigatorHorizontal);
connect(this->ui->menu_WindowToggleNavigator, &QAction::triggered, this->ui->comp_InvisibleInfoArea, &CInvisibleInfoAreaComponent::toggleNavigator);
connect(this->ui->menu_DebugMetaTypes, &QAction::triggered, this, &SwiftGuiStd::ps_onMenuClicked);
// command line / text messages
connect(this->ui->comp_MainInfoArea->getTextMessageComponent(), &CTextMessageComponent::displayInInfoWindow, this->m_compInfoWindow, &CInfoWindowComponent::display);