mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-04 16:56:53 +08:00
refs #335 show / hide bar
This commit is contained in:
committed by
Roland Winklmeier
parent
7028bcf66a
commit
7c5729ff44
31
src/blackgui/showhidebar.cpp
Normal file
31
src/blackgui/showhidebar.cpp
Normal file
@@ -0,0 +1,31 @@
|
||||
/* 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 "showhidebar.h"
|
||||
#include "ui_showhidebar.h"
|
||||
|
||||
namespace BlackGui
|
||||
{
|
||||
|
||||
CShowHideBar::CShowHideBar(QWidget *parent) :
|
||||
QFrame(parent),
|
||||
ui(new Ui::CShowHideBar)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
connect(this->ui->pb_ShowHidePushButton, &QPushButton::clicked, this, &CShowHideBar::toggleShowHide);
|
||||
}
|
||||
|
||||
CShowHideBar::~CShowHideBar()
|
||||
{ }
|
||||
|
||||
bool CShowHideBar::isShown() const
|
||||
{
|
||||
return this->ui->pb_ShowHidePushButton->isChecked();
|
||||
}
|
||||
} // namespacee
|
||||
45
src/blackgui/showhidebar.h
Normal file
45
src/blackgui/showhidebar.h
Normal file
@@ -0,0 +1,45 @@
|
||||
/* 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_SHOWHIDEBAR_H
|
||||
#define BLACKGUI_SHOWHIDEBAR_H
|
||||
|
||||
#include <QFrame>
|
||||
|
||||
namespace Ui { class CShowHideBar; }
|
||||
|
||||
namespace BlackGui
|
||||
{
|
||||
//! Show or hide another section
|
||||
class CShowHideBar : public QFrame
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
//! Constructor
|
||||
explicit CShowHideBar(QWidget *parent = nullptr);
|
||||
|
||||
//! Destructor
|
||||
~CShowHideBar();
|
||||
|
||||
//! Is shown?
|
||||
bool isShown() const;
|
||||
|
||||
signals:
|
||||
//! Show or hide cockpit details
|
||||
void toggleShowHide(bool show);
|
||||
|
||||
private:
|
||||
QScopedPointer<Ui::CShowHideBar> ui;
|
||||
};
|
||||
|
||||
} // namespace
|
||||
#endif // guard
|
||||
89
src/blackgui/showhidebar.ui
Normal file
89
src/blackgui/showhidebar.ui
Normal file
@@ -0,0 +1,89 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>CShowHideBar</class>
|
||||
<widget class="QFrame" name="CShowHideBar">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>314</width>
|
||||
<height>12</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>show / hide</string>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="vl_ShowHideBar">
|
||||
<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="QPushButton" name="pb_ShowHidePushButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>10</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>show / hide</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../blackmisc/blackmisc.qrc">
|
||||
<normaloff>:/own/icons/own/arrowWide300x10down.png</normaloff>
|
||||
<normalon>:/own/icons/own/arrowWide300x10up.png</normalon>:/own/icons/own/arrowWide300x10down.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>300</width>
|
||||
<height>10</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="../blackmisc/blackmisc.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
Reference in New Issue
Block a user