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

@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>27</height>
<width>415</width>
<height>20</height>
</rect>
</property>
<property name="windowTitle">
@@ -18,10 +18,13 @@
<normaloff>:/own/icons/own/swift/swift24.png</normaloff>:/own/icons/own/swift/swift24.png</iconset>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
<enum>QFrame::Plain</enum>
</property>
<property name="lineWidth">
<number>0</number>
</property>
<layout class="QHBoxLayout" name="hl_InfoBarStatus">
<property name="spacing">

View File

@@ -0,0 +1,66 @@
/* Copyright (C) 2015
* 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 "invisibleinfoareacomponent.h"
#include "ui_invisibleinfoareacomponent.h"
#include "blackmisc/icons.h"
using namespace BlackGui;
using namespace BlackMisc;
namespace BlackGui
{
namespace Components
{
CInvisibleInfoAreaComponent::CInvisibleInfoAreaComponent(QWidget *parent) :
CInfoArea(parent),
ui(new Ui::CInvisibleInfoAreaComponent)
{
ui->setupUi(this);
this->ui->comp_Navigator->allowStatusBar(false);
this->initInfoArea();
}
CInvisibleInfoAreaComponent::~CInvisibleInfoAreaComponent()
{ }
QSize CInvisibleInfoAreaComponent::getPreferredSizeWhenFloating(int areaIndex) const
{
InfoArea area = static_cast<InfoArea>(areaIndex);
switch (area)
{
case InfoAreaHorizontalNavigator:
return QSize(400, 50);
case InfoAreaVerticalNavigator:
return QSize(50, 400);
default:
return QSize(0, 0);
}
}
const QPixmap &CInvisibleInfoAreaComponent::indexToPixmap(int areaIndex) const
{
InfoArea area = static_cast<InfoArea>(areaIndex);
switch (area)
{
case InfoAreaHorizontalNavigator:
case InfoAreaVerticalNavigator:
default:
return CIcons::empty();
}
}
void CInvisibleInfoAreaComponent::toggleNavigator()
{
this->ui->comp_Navigator->toggleFloating();
}
} // ns
} // ns

View File

@@ -0,0 +1,62 @@
/* Copyright (C) 2015
* 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_COMPONENTS_INVISIBLEINFOAREACOMPONENT_H
#define BLACKGUI_COMPONENTS_INVISIBLEINFOAREACOMPONENT_H
#include "blackgui/infoarea.h"
#include <QMainWindow>
namespace Ui { class CInvisibleInfoAreaComponent; }
namespace BlackGui
{
namespace Components
{
//! Info area to carry info areas on visibile when floating
class CInvisibleInfoAreaComponent : public BlackGui::CInfoArea
{
Q_OBJECT
public:
//! Info areas
enum InfoArea
{
// index must match tab index!
InfoAreaVerticalNavigator = 0,
InfoAreaHorizontalNavigator = 1
};
//! Consturctor
explicit CInvisibleInfoAreaComponent(QWidget *parent = nullptr);
//! Destructor
~CInvisibleInfoAreaComponent();
//! \copydoc CInfoArea::getPreferredSizeWhenFloating
virtual QSize getPreferredSizeWhenFloating(int areaIndex) const override;
//! \copydoc CInfoArea::indexToPixmap
const QPixmap &indexToPixmap(int areaIndex) const override;
public slots:
//! Navigator floating
void toggleNavigator();
private:
QScopedPointer<Ui::CInvisibleInfoAreaComponent> ui;
};
} // ns
} // ns
#endif // guard

View File

@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>CInvisibleInfoAreaComponent</class>
<widget class="QMainWindow" name="CInvisibleInfoAreaComponent">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>800</width>
<height>600</height>
</rect>
</property>
<property name="windowTitle">
<string>Invisible info area</string>
</property>
<widget class="QWidget" name="qw_InvisibleInfoArea"/>
<widget class="BlackGui::Components::CNavigatorDockWidget" name="comp_Navigator">
<property name="allowedAreas">
<set>Qt::LeftDockWidgetArea</set>
</property>
<property name="windowTitle">
<string>Navigator</string>
</property>
<attribute name="dockWidgetArea">
<number>1</number>
</attribute>
<widget class="QWidget" name="qw_Navigaor"/>
</widget>
</widget>
<customwidgets>
<customwidget>
<class>BlackGui::Components::CNavigatorDockWidget</class>
<extends>QDockWidget</extends>
<header>blackgui/components/navigatordockwidget.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>

View File

@@ -38,7 +38,17 @@
<property name="dockOptions">
<set>QMainWindow::AllowTabbedDocks|QMainWindow::ForceTabbedDocks</set>
</property>
<widget class="QWidget" name="qw_centralWidgetEmpty"/>
<widget class="QWidget" name="qw_centralWidgetEmpty">
<property name="enabled">
<bool>false</bool>
</property>
<property name="maximumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
</widget>
<widget class="BlackGui::CDockWidgetInfoArea" name="dwp_Cockpit">
<property name="maximumSize">
<size>
@@ -271,7 +281,7 @@
<number>0</number>
</property>
<property name="topMargin">
<number>2</number>
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
@@ -282,10 +292,13 @@
<item>
<widget class="BlackGui::Components::CTextMessageComponent" name="comp_TextMessages">
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
<enum>QFrame::Plain</enum>
</property>
<property name="lineWidth">
<number>0</number>
</property>
</widget>
</item>
@@ -309,7 +322,7 @@
<number>4</number>
</attribute>
<widget class="QWidget" name="qw_SimulatorInner">
<layout class="QVBoxLayout" name="verticalLayout">
<layout class="QVBoxLayout" name="vl_Simulator">
<property name="spacing">
<number>0</number>
</property>
@@ -363,7 +376,7 @@
<number>0</number>
</property>
<property name="topMargin">
<number>2</number>
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
@@ -408,11 +421,14 @@
</size>
</property>
<layout class="QVBoxLayout" name="vl_Weather">
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>2</number>
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
@@ -423,10 +439,13 @@
<item>
<widget class="QFrame" name="fr_WeatherDummy">
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
<enum>QFrame::Plain</enum>
</property>
<property name="lineWidth">
<number>0</number>
</property>
</widget>
</item>
@@ -504,7 +523,7 @@
<number>0</number>
</property>
<property name="topMargin">
<number>2</number>
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
@@ -515,10 +534,13 @@
<item>
<widget class="BlackGui::Components::CLogComponent" name="comp_Log">
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
<enum>QFrame::Plain</enum>
</property>
<property name="lineWidth">
<number>0</number>
</property>
</widget>
</item>
@@ -550,7 +572,7 @@
<number>0</number>
</property>
<property name="topMargin">
<number>2</number>
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>

View File

@@ -7,7 +7,6 @@
* contained in the LICENSE file.
*/
#include "navigatordockwidget.h"
#include "ui_navigatordockwidget.h"
@@ -18,7 +17,7 @@ namespace BlackGui
namespace Components
{
CNavigatorDockWidget::CNavigatorDockWidget(QWidget *parent) :
CDockWidget(parent),
CDockWidgetInfoArea(parent),
ui(new Ui::CNavigatorDockWidget)
{
ui->setupUi(this);

View File

@@ -12,7 +12,7 @@
#ifndef BLACKGUI_NAVIGATORDOCKWIDGET_H
#define BLACKGUI_NAVIGATORDOCKWIDGET_H
#include "blackgui/dockwidget.h"
#include "blackgui/dockwidgetinfoarea.h"
#include <QDockWidget>
#include <QScopedPointer>
@@ -24,7 +24,7 @@ namespace BlackGui
{
//! Dock widget for navigators
class CNavigatorDockWidget : public BlackGui::CDockWidget
class CNavigatorDockWidget : public BlackGui::CDockWidgetInfoArea
{
Q_OBJECT