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 { ...@@ -259,29 +259,27 @@ QPushButton#controlButton {
min-height: 25px; 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); 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 { QPushButton:checked, QToolButton:checked {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #09A2B2, stop: 1 #414B52); background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #09A2B2, stop: 1 #414B52);
} }
QPushButton:checked#connectButton, QPushButton:checked#controlButton { 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; 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 { QPushButton:disabled, QToolButton:disabled {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #232228, stop: 1 #020208); 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 { ...@@ -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); 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); 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 { ...@@ -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); 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); 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 { QScrollBar {
border: 1px solid #333; border: 1px solid #333;
} }
...@@ -472,6 +460,25 @@ UASQuickViewItem QLabel#value { ...@@ -472,6 +460,25 @@ UASQuickViewItem QLabel#value {
font-size: 20pt; 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 { WaypointEditableView, WaypointViewOnlyView {
border: 1px solid #777; border: 1px solid #777;
border-radius: 5px; border-radius: 5px;
......
...@@ -258,30 +258,28 @@ QPushButton#controlButton { ...@@ -258,30 +258,28 @@ QPushButton#controlButton {
min-height: 25px; 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); 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 { QPushButton:checked, QToolButton:checked {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #444, stop: 1 #888); background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #444, stop: 1 #888);
color: #FFF; color: #FFF;
} }
QPushButton:checked#connectButton, QPushButton:checked#controlButton { 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; 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 { QPushButton:disabled, QToolButton:disabled {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #EEE, stop: 1 #CCC); background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #EEE, stop: 1 #CCC);
color: #AAA; color: #AAA;
...@@ -295,7 +293,7 @@ QPushButton:hover#connectButton, QPushButton:hover#controlButton { ...@@ -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); 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); 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 { ...@@ -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); 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); 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 { QScrollBar {
border: 1px solid #333; border: 1px solid #333;
} }
QSeparator { QSeparator {
color: #EEE; color: #000;
} }
QSlider { QSlider {
...@@ -473,6 +461,25 @@ UASQuickViewItem QLabel#value { ...@@ -473,6 +461,25 @@ UASQuickViewItem QLabel#value {
font-size: 20pt; 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 { WaypointEditableView, WaypointViewOnlyView {
border: 1px solid #333; border: 1px solid #333;
border-radius: 5px; border-radius: 5px;
......
...@@ -19,6 +19,14 @@ ...@@ -19,6 +19,14 @@
<property name="windowTitle"> <property name="windowTitle">
<string>Form</string> <string>Form</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="spacing">
<number>6</number>
</property>
<property name="margin">
<number>3</number>
</property>
</layout>
</widget> </widget>
<resources/> <resources/>
<connections/> <connections/>
......
This diff is collapsed.
...@@ -6,20 +6,38 @@ ...@@ -6,20 +6,38 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>372</width> <width>174</width>
<height>309</height> <height>174</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="windowTitle"> <property name="windowTitle">
<string>Form</string> <string>Form</string>
</property> </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"> <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"> <property name="minimumSize">
<size> <size>
<width>150</width> <width>174</width>
<height>150</height> <height>174</height>
</size> </size>
</property> </property>
<property name="sizeIncrement"> <property name="sizeIncrement">
...@@ -35,28 +53,7 @@ ...@@ -35,28 +53,7 @@
</size> </size>
</property> </property>
<property name="styleSheet"> <property name="styleSheet">
<string notr="true"> <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>
</property> </property>
<property name="text"> <property name="text">
<string/> <string/>
...@@ -71,24 +68,8 @@ border-color: #D1892A; ...@@ -71,24 +68,8 @@ border-color: #D1892A;
<height>140</height> <height>140</height>
</size> </size>
</property> </property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonIconOnly</enum>
</property>
</widget> </widget>
</item> </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> </layout>
</widget> </widget>
<resources> <resources>
......
...@@ -48,19 +48,11 @@ This file is part of the PIXHAWK project ...@@ -48,19 +48,11 @@ This file is part of the PIXHAWK project
UASListWidget::UASListWidget(QWidget *parent) : QWidget(parent), m_ui(new Ui::UASList) UASListWidget::UASListWidget(QWidget *parent) : QWidget(parent), m_ui(new Ui::UASList)
{ {
m_ui->setupUi(this); m_ui->setupUi(this);
m_ui->verticalLayout->setAlignment(Qt::AlignTop);
listLayout = new QVBoxLayout(this);
listLayout->setMargin(0);
listLayout->setSpacing(3);
listLayout->setAlignment(Qt::AlignTop);
this->setLayout(listLayout);
setObjectName("UNMANNED_SYSTEMS_LIST");
// Construct initial widget // Construct initial widget
uWidget = new QGCUnconnectedInfoWidget(this); uWidget = new QGCUnconnectedInfoWidget(this);
listLayout->addWidget(uWidget); m_ui->verticalLayout->addWidget(uWidget);
this->setMinimumWidth(262);
uasViews = QMap<UASInterface*, UASView*>(); uasViews = QMap<UASInterface*, UASView*>();
...@@ -98,7 +90,7 @@ void UASListWidget::addUAS(UASInterface* uas) ...@@ -98,7 +90,7 @@ void UASListWidget::addUAS(UASInterface* uas)
{ {
if (uasViews.isEmpty()) if (uasViews.isEmpty())
{ {
listLayout->removeWidget(uWidget); m_ui->verticalLayout->removeWidget(uWidget);
delete uWidget; delete uWidget;
uWidget = NULL; uWidget = NULL;
} }
...@@ -106,7 +98,7 @@ void UASListWidget::addUAS(UASInterface* uas) ...@@ -106,7 +98,7 @@ void UASListWidget::addUAS(UASInterface* uas)
if (!uasViews.contains(uas)) if (!uasViews.contains(uas))
{ {
uasViews.insert(uas, new UASView(uas, this)); 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*))); //connect(uas, SIGNAL(destroyed(QObject*)), this, SLOT(removeUAS(QObject*)));
} }
} }
...@@ -126,4 +118,3 @@ void UASListWidget::removeUAS(UASInterface* uas) ...@@ -126,4 +118,3 @@ void UASListWidget::removeUAS(UASInterface* uas)
// listLayout->removeWidget(uasViews.value(uas)); // listLayout->removeWidget(uasViews.value(uas));
// uasViews.value(uas)->deleteLater(); // uasViews.value(uas)->deleteLater();
} }
...@@ -54,7 +54,6 @@ public slots: ...@@ -54,7 +54,6 @@ public slots:
protected: protected:
QMap<UASInterface*, UASView*> uasViews; QMap<UASInterface*, UASView*> uasViews;
QVBoxLayout* listLayout;
QGCUnconnectedInfoWidget* uWidget; QGCUnconnectedInfoWidget* uWidget;
void changeEvent(QEvent *e); void changeEvent(QEvent *e);
......
This diff is collapsed.
...@@ -80,8 +80,6 @@ public slots: ...@@ -80,8 +80,6 @@ public slots:
void updateActiveUAS(UASInterface* uas, bool active); void updateActiveUAS(UASInterface* uas, bool active);
/** @brief Set the widget into critical mode */ /** @brief Set the widget into critical mode */
void heartbeatTimeout(bool timeout, unsigned int ms); 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 */ /** @brief Bring up the dialog to rename the system */
void rename(); void rename();
/** @brief Select airframe for this vehicle */ /** @brief Select airframe for this vehicle */
...@@ -100,6 +98,7 @@ protected: ...@@ -100,6 +98,7 @@ protected:
quint64 startTime; quint64 startTime;
bool timeout; bool timeout;
bool iconIsRed; bool iconIsRed;
bool disconnected;
int timeRemaining; int timeRemaining;
float chargeLevel; float chargeLevel;
UASInterface* uas; UASInterface* uas;
...@@ -146,6 +145,7 @@ protected: ...@@ -146,6 +145,7 @@ protected:
private: private:
Ui::UASView *m_ui; Ui::UASView *m_ui;
virtual void paintEvent(QPaintEvent *);
signals: signals:
void uasInFocus(UASInterface* uas); 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