Commit d581a91b authored by Bryant's avatar Bryant

Reworked the UAS listing. It's organized differently and styled differently....

Reworked the UAS listing. It's organized differently and styled differently. Also the fading of the heartbeat status now works properly. Also fixed some theming issues with the connectButton when it was checked.
parent 2ef52b98
......@@ -259,29 +259,27 @@ QPushButton#controlButton {
min-height: 25px;
}
QPushButton#deleteButton {
QPushButton#deleteButton, QPushButton#killButton {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #D9002F, stop: 1 #AC0025);
}
QPushButton#killButton {
font-weight: bold;
min-height: 30px;
color: #000;
background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #ffb917, stop:1 #b37300);
background-clip: border;
border: 1px solid #555;
border-radius: 5px;
}
QPushButton:checked, QToolButton:checked {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #09A2B2, stop: 1 #414B52);
}
QPushButton:checked#connectButton, QPushButton:checked#controlButton {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #FF9000, stop: 1 #B37300);
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #E38000, stop: 1 #945F00);
color: #000;
}
QPushButton:checked:hover#connectButton, QPushButton:checked:hover#controlButton {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #FF9000, stop: 1 #B37300);
}
QPushButton:checked:pressed#connectButton, QPushButton:checked:pressed#controlButton {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #DB7C00, stop: 1 #825400);
}
QPushButton:disabled, QToolButton:disabled {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #232228, stop: 1 #020208);
}
......@@ -294,7 +292,7 @@ QPushButton:hover#connectButton, QPushButton:hover#controlButton {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #87FF6D, stop: 1 #1FD16D);
}
QPushButton:hover#deleteButton {
QPushButton:hover#deleteButton, QPushButton#killButton {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #F20034, stop: 1 #9E0022);
}
......@@ -306,20 +304,10 @@ QPushButton:pressed#connectButton, QPushButton:pressed#controlButton {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #62B84E, stop: 1 #148A47);
}
QPushButton:pressed#deleteButton {
QPushButton:pressed#deleteButton, QPushButton#killButton {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #C9002C, stop: 1 #9C0021);
}
QPushButton:pressed#killButton {
font-weight: bold;
min-height: 30px;
color: #000;
background: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #bb8500, stop:1 #903000);
background-clip: border;
border: 1px solid #555;
border-radius: 5px;
}
QScrollBar {
border: 1px solid #333;
}
......@@ -472,6 +460,25 @@ UASQuickViewItem QLabel#value {
font-size: 20pt;
}
UASView {
background: #444;
border: 1px solid #AAA;
border-radius: 12px;
}
UASView QLabel#heartBeatLabel, UASView QLabel#typeLabel {
border: 1px solid #333;
border-radius: 5px;
padding: 2px;
}
QGCUnconnectedInfoWidget QPushButton#connectButton {
min-height: 150px;
max-height: 275px;
margin: 15px;
padding: 20px;
}
WaypointEditableView, WaypointViewOnlyView {
border: 1px solid #777;
border-radius: 5px;
......
......@@ -258,30 +258,28 @@ QPushButton#controlButton {
min-height: 25px;
}
QPushButton#deleteButton {
QPushButton#deleteButton, QPushButton#killButton {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #D9002F, stop: 1 #AC0025);
}
QPushButton#killButton {
font-weight: bold;
min-height: 30px;
color: #000;
background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #FFb917, stop: 1 #B37300);
background-clip: border;
border: 1px solid #555;
border-radius: 5px;
}
QPushButton:checked, QToolButton:checked {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #444, stop: 1 #888);
color: #FFF;
}
QPushButton:checked#connectButton, QPushButton:checked#controlButton {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #FF9000, stop: 1 #B37300);
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #E38000, stop: 1 #945F00);
color: #000;
}
QPushButton:checked:hover#connectButton, QPushButton:checked:hover#controlButton {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #FF9000, stop: 1 #B37300);
}
QPushButton:checked:pressed#connectButton, QPushButton:checked:pressed#controlButton {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #DB7C00, stop: 1 #825400);
}
QPushButton:disabled, QToolButton:disabled {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #EEE, stop: 1 #CCC);
color: #AAA;
......@@ -295,7 +293,7 @@ QPushButton:hover#connectButton, QPushButton:hover#controlButton {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #87FF6D, stop: 1 #1FD16D);
}
QPushButton:hover#deleteButton {
QPushButton:hover#deleteButton, QPushButton#killButton {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #F20034, stop: 1 #9E0022);
}
......@@ -307,26 +305,16 @@ QPushButton:pressed#connectButton, QPushButton:pressed#controlButton {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #62B84E, stop: 1 #148A47);
}
QPushButton:pressed#deleteButton {
QPushButton:pressed#deleteButton, QPushButton#killButton {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #C9002C, stop: 1 #9C0021);
}
QPushButton:pressed#killButton {
font-weight: bold;
min-height: 30px;
color: #000;
background: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #bb8500, stop:1 #903000);
background-clip: border;
border: 1px solid #555;
border-radius: 5px;
}
QScrollBar {
border: 1px solid #333;
}
QSeparator {
color: #EEE;
color: #000;
}
QSlider {
......@@ -473,6 +461,25 @@ UASQuickViewItem QLabel#value {
font-size: 20pt;
}
UASView {
background: #D0D0D0;
border: 1px solid #666;
border-radius: 12px;
}
UASView QLabel#heartBeatLabel, UASView QLabel#typeLabel {
border: 1px solid #333;
border-radius: 5px;
padding: 2px;
}
QGCUnconnectedInfoWidget QPushButton#connectButton {
min-height: 150px;
max-height: 275px;
margin: 15px;
padding: 20px;
}
WaypointEditableView, WaypointViewOnlyView {
border: 1px solid #333;
border-radius: 5px;
......
......@@ -19,6 +19,14 @@
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="spacing">
<number>6</number>
</property>
<property name="margin">
<number>3</number>
</property>
</layout>
</widget>
<resources/>
<connections/>
......
This diff is collapsed.
......@@ -6,20 +6,38 @@
<rect>
<x>0</x>
<y>0</y>
<width>372</width>
<height>309</height>
<width>174</width>
<height>174</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout" rowstretch="90,30">
<layout class="QGridLayout" name="gridLayout" rowstretch="0">
<property name="margin">
<number>0</number>
</property>
<property name="spacing">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QToolButton" name="connectButton">
<widget class="QPushButton" name="connectButton">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>150</width>
<height>150</height>
<width>174</width>
<height>174</height>
</size>
</property>
<property name="sizeIncrement">
......@@ -35,28 +53,7 @@
</size>
</property>
<property name="styleSheet">
<string notr="true">
QToolButton {
color: #222222;
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #80B81D, stop: 1 #306807);
margin: 15px;
padding: 20px;
border-radius: 18px;
min-height: 100px;
border: 2px solid #085B35;
}
QToolButton:pressed {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #306807, stop: 1 #80B81D);
color: #222222;
border-color: #D1892A;
}
QToolButton:checked {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #306807, stop: 1 #80B81D);
color: #222222;
border-color: #D1892A;
}</string>
<string notr="true"/>
</property>
<property name="text">
<string/>
......@@ -71,24 +68,8 @@ border-color: #D1892A;
<height>140</height>
</size>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonIconOnly</enum>
</property>
</widget>
</item>
<item row="1" column="0">
<spacer name="verticalSpacer">
<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>
<resources>
......
......@@ -48,19 +48,11 @@ This file is part of the PIXHAWK project
UASListWidget::UASListWidget(QWidget *parent) : QWidget(parent), m_ui(new Ui::UASList)
{
m_ui->setupUi(this);
listLayout = new QVBoxLayout(this);
listLayout->setMargin(0);
listLayout->setSpacing(3);
listLayout->setAlignment(Qt::AlignTop);
this->setLayout(listLayout);
setObjectName("UNMANNED_SYSTEMS_LIST");
m_ui->verticalLayout->setAlignment(Qt::AlignTop);
// Construct initial widget
uWidget = new QGCUnconnectedInfoWidget(this);
listLayout->addWidget(uWidget);
this->setMinimumWidth(262);
m_ui->verticalLayout->addWidget(uWidget);
uasViews = QMap<UASInterface*, UASView*>();
......@@ -98,7 +90,7 @@ void UASListWidget::addUAS(UASInterface* uas)
{
if (uasViews.isEmpty())
{
listLayout->removeWidget(uWidget);
m_ui->verticalLayout->removeWidget(uWidget);
delete uWidget;
uWidget = NULL;
}
......@@ -106,7 +98,7 @@ void UASListWidget::addUAS(UASInterface* uas)
if (!uasViews.contains(uas))
{
uasViews.insert(uas, new UASView(uas, this));
listLayout->addWidget(uasViews.value(uas));
m_ui->verticalLayout->addWidget(uasViews.value(uas));
//connect(uas, SIGNAL(destroyed(QObject*)), this, SLOT(removeUAS(QObject*)));
}
}
......@@ -121,9 +113,8 @@ void UASListWidget::activeUAS(UASInterface* uas)
void UASListWidget::removeUAS(UASInterface* uas)
{
Q_UNUSED(uas);
Q_UNUSED(uas);
// uasViews.remove(uas);
// listLayout->removeWidget(uasViews.value(uas));
// uasViews.value(uas)->deleteLater();
}
......@@ -54,7 +54,6 @@ public slots:
protected:
QMap<UASInterface*, UASView*> uasViews;
QVBoxLayout* listLayout;
QGCUnconnectedInfoWidget* uWidget;
void changeEvent(QEvent *e);
......
This diff is collapsed.
......@@ -80,8 +80,6 @@ public slots:
void updateActiveUAS(UASInterface* uas, bool active);
/** @brief Set the widget into critical mode */
void heartbeatTimeout(bool timeout, unsigned int ms);
/** @brief Set the background color for the widget */
void setBackgroundColor();
/** @brief Bring up the dialog to rename the system */
void rename();
/** @brief Select airframe for this vehicle */
......@@ -100,6 +98,7 @@ protected:
quint64 startTime;
bool timeout;
bool iconIsRed;
bool disconnected;
int timeRemaining;
float chargeLevel;
UASInterface* uas;
......@@ -146,6 +145,7 @@ protected:
private:
Ui::UASView *m_ui;
virtual void paintEvent(QPaintEvent *);
signals:
void uasInFocus(UASInterface* uas);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment