Browse Source

Improved visual style of waypoint editing component, freed up space

QGC4.4
lm 14 years ago
parent
commit
ddefe97114
  1. 18
      src/ui/SerialConfigurationWindow.cc
  2. 3
      src/ui/WaypointEditableView.cc
  3. 3
      src/ui/WaypointList.cc
  4. 128
      src/ui/WaypointList.ui
  5. 44
      src/ui/WaypointViewOnlyView.cc
  6. 135
      src/ui/WaypointViewOnlyView.ui

18
src/ui/SerialConfigurationWindow.cc

@ -41,14 +41,13 @@ SerialConfigurationWindow::SerialConfigurationWindow(LinkInterface* link, QWidge @@ -41,14 +41,13 @@ SerialConfigurationWindow::SerialConfigurationWindow(LinkInterface* link, QWidge
{
SerialLinkInterface* serialLink = dynamic_cast<SerialLinkInterface*>(link);
if(serialLink != 0) {
if(serialLink != 0)
{
serialLink->loadSettings();
this->link = serialLink;
// Setup the user interface according to link type
ui.setupUi(this);
//this->setVisible(false);
//this->hide();
// Create action to open this menu
// Create configuration action for this link
@ -154,10 +153,10 @@ SerialConfigurationWindow::SerialConfigurationWindow(LinkInterface* link, QWidge @@ -154,10 +153,10 @@ SerialConfigurationWindow::SerialConfigurationWindow(LinkInterface* link, QWidge
// Display the widget
this->window()->setWindowTitle(tr("Serial Communication Settings"));
//this->show();
} else {
}
else
{
qDebug() << "Link is NOT a serial link, can't open configuration window";
}
}
@ -220,9 +219,12 @@ void SerialConfigurationWindow::setupPortList() @@ -220,9 +219,12 @@ void SerialConfigurationWindow::setupPortList()
void SerialConfigurationWindow::enableFlowControl(bool flow)
{
if(flow) {
if(flow)
{
link->setFlowType(1);
} else {
}
else
{
link->setFlowType(0);
}
}

3
src/ui/WaypointEditableView.cc

@ -63,7 +63,8 @@ WaypointEditableView::WaypointEditableView(Waypoint* wp, QWidget* parent) : @@ -63,7 +63,8 @@ WaypointEditableView::WaypointEditableView(Waypoint* wp, QWidget* parent) :
updateValues();
// Check for mission frame
if (wp->getFrame() == MAV_FRAME_MISSION) {
if (wp->getFrame() == MAV_FRAME_MISSION)
{
m_ui->comboBox_action->setCurrentIndex(m_ui->comboBox_action->count()-1);
}

3
src/ui/WaypointList.cc

@ -289,7 +289,10 @@ void WaypointList::addCurrentPositionWaypoint() @@ -289,7 +289,10 @@ void WaypointList::addCurrentPositionWaypoint()
void WaypointList::updateStatusLabel(const QString &string)
{
// Status label in write widget
m_ui->statusLabel->setText(string);
// Status label in read only widget
m_ui->viewStatusLabel->setText(string);
}
void WaypointList::changeCurrentWaypoint(quint16 seq)

128
src/ui/WaypointList.ui

@ -20,16 +20,46 @@ @@ -20,16 +20,46 @@
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>8</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>0</number>
<number>1</number>
</property>
<widget class="QWidget" name="editTab">
<attribute name="title">
<string>Tab 1</string>
<string>Edit Waypoints</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_2">
<property name="leftMargin">
<number>6</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>6</number>
</property>
<property name="bottomMargin">
<number>6</number>
</property>
<property name="horizontalSpacing">
<number>12</number>
</property>
<property name="verticalSpacing">
<number>6</number>
</property>
<item row="0" column="0" colspan="9">
<widget class="QScrollArea" name="scrollArea">
<property name="widgetResizable">
@ -40,15 +70,24 @@ @@ -40,15 +70,24 @@
<rect>
<x>0</x>
<y>0</y>
<width>812</width>
<height>271</height>
<width>834</width>
<height>325</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="spacing">
<number>0</number>
</property>
<property name="margin">
<property name="leftMargin">
<number>4</number>
</property>
<property name="topMargin">
<number>8</number>
</property>
<property name="rightMargin">
<number>4</number>
</property>
<property name="bottomMargin">
<number>4</number>
</property>
<item>
@ -213,14 +252,48 @@ @@ -213,14 +252,48 @@
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QLabel" name="statusLabel">
<property name="toolTip">
<string>The current waypoint transmission status</string>
</property>
<property name="statusTip">
<string>The current waypoint transmission status</string>
</property>
<property name="whatsThis">
<string>The current waypoint transmission status</string>
</property>
<property name="text">
<string>Please add first waypoint.</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="viewTab">
<attribute name="title">
<string>Tab 2</string>
<string>Onboard Waypoints</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0" colspan="2">
<property name="leftMargin">
<number>6</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>6</number>
</property>
<property name="bottomMargin">
<number>6</number>
</property>
<property name="horizontalSpacing">
<number>12</number>
</property>
<property name="verticalSpacing">
<number>6</number>
</property>
<item row="0" column="0" colspan="3">
<widget class="QScrollArea" name="readOnlyScrollArea">
<property name="widgetResizable">
<bool>true</bool>
@ -230,14 +303,26 @@ @@ -230,14 +303,26 @@
<rect>
<x>0</x>
<y>0</y>
<width>812</width>
<height>271</height>
<width>834</width>
<height>331</height>
</rect>
</property>
<property name="autoFillBackground">
<bool>true</bool>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<property name="leftMargin">
<number>4</number>
</property>
<property name="topMargin">
<number>8</number>
</property>
<property name="rightMargin">
<number>4</number>
</property>
<property name="bottomMargin">
<number>4</number>
</property>
<item>
<widget class="QWidget" name="viewOnlyListWidget" native="true">
<property name="enabled">
@ -249,7 +334,7 @@ @@ -249,7 +334,7 @@
</widget>
</widget>
</item>
<item row="1" column="0">
<item row="1" column="1">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
@ -262,7 +347,7 @@ @@ -262,7 +347,7 @@
</property>
</spacer>
</item>
<item row="1" column="1">
<item row="1" column="2">
<widget class="QPushButton" name="refreshButton">
<property name="toolTip">
<string>Read all waypoints from the MAV and display in View tab..</string>
@ -282,27 +367,18 @@ @@ -282,27 +367,18 @@
</property>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="statusLabel">
<property name="toolTip">
<string>The current waypoint transmission status</string>
</property>
<property name="statusTip">
<string>The current waypoint transmission status</string>
</property>
<property name="whatsThis">
<string>The current waypoint transmission status</string>
</property>
<widget class="QLabel" name="viewStatusLabel">
<property name="text">
<string>Please add first waypoint.</string>
<string>TextLabel</string>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
<action name="actionAddWaypoint">
<property name="icon">
<iconset resource="../../qgroundcontrol.qrc">

44
src/ui/WaypointViewOnlyView.cc

@ -87,19 +87,56 @@ void WaypointViewOnlyView::updateValues() @@ -87,19 +87,56 @@ void WaypointViewOnlyView::updateValues()
deleteLater();
return;
}
// Deactivate signals from the WP
wp->blockSignals(true);
// Update style
QColor backGroundColor = QGC::colorBackground;
static int lastId = -1;
int currId = wp->getId() % 2;
if (currId != lastId)
{
// qDebug() << "COLOR ID: " << currId;
if (currId == 1)
{
backGroundColor = QColor("#252528").lighter(150);
}
else
{
backGroundColor = QColor("#252528").lighter(250);
}
// Update color based on id
QString groupBoxStyle = QString("QGroupBox {padding: 0px; margin: 0px; border: 0px; background-color: %1; min-height: 12px; }").arg(backGroundColor.name());
QString labelStyle = QString("QWidget {background-color: %1; color: #DDDDDF; border-color: #EEEEEE; }").arg(backGroundColor.name());
QString displayBarStyle = QString("QWidget {background-color: %1; color: #DDDDDF; border: none; }").arg(backGroundColor.name());
QString checkBoxStyle = QString("QCheckBox {background-color: %1; color: #454545; border-color: #EEEEEE; }").arg(backGroundColor.name());
m_ui->autoContinue->setStyleSheet(checkBoxStyle);
m_ui->current->setStyleSheet(checkBoxStyle);
m_ui->idLabel->setStyleSheet(labelStyle);
m_ui->displayBar->setStyleSheet(displayBarStyle);
m_ui->groupBox->setStyleSheet(groupBoxStyle);
lastId = currId;
}
// update frame
m_ui->idLabel->setText(QString("%1").arg(wp->getId()));
if (m_ui->current->isChecked() != wp->getCurrent())
{
m_ui->current->blockSignals(true);
m_ui->current->setChecked(wp->getCurrent());
m_ui->current->blockSignals(false);
}
if (m_ui->autoContinue->isChecked() != wp->getAutoContinue())
{
m_ui->autoContinue->blockSignals(true);
m_ui->autoContinue->setChecked(wp->getAutoContinue());
m_ui->autoContinue->blockSignals(false);
}
switch (wp->getAction())
@ -164,9 +201,6 @@ default: @@ -164,9 +201,6 @@ default:
break;
}
}
wp->blockSignals(false);
}
WaypointViewOnlyView::~WaypointViewOnlyView()

135
src/ui/WaypointViewOnlyView.ui

@ -7,7 +7,7 @@ @@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>381</width>
<height>55</height>
<height>40</height>
</rect>
</property>
<property name="sizePolicy">
@ -20,124 +20,12 @@ @@ -20,124 +20,12 @@
<string>Form</string>
</property>
<property name="styleSheet">
<string notr="true">QWidget#colorIcon {}
QWidget {
background-color: #252528;
color: #DDDDDF;
border-color: #EEEEEE;
background-clip: border;
}
QCheckBox {
background-color: #252528;
color: #454545;
}
QGroupBox {
border: 1px solid #EEEEEE;
border-radius: 5px;
padding: 0px 0px 0px 0px;
margin-top: 1ex; /* leave space at the top for the title */
margin: 0px;
}
QGroupBox::title {
subcontrol-origin: margin;
subcontrol-position: top center; /* position at the top center */
margin: 0 3px 0px 3px;
padding: 0 3px 0px 0px;
font: bold 8px;
}
QGroupBox#heartbeatIcon {
background-color: red;
}
QDockWidget {
font: bold;
border: 1px solid #32345E;
}
QPushButton {
font-weight: bold;
font-size: 12px;
border: 1px solid #999999;
border-radius: 10px;
min-width:22px;
max-width: 36px;
min-height: 16px;
max-height: 16px;
padding: 2px;
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #777777, stop: 1 #555555);
}
QPushButton:pressed {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #444444, stop: 1 #555555);
}
QPushButton#landButton {
color: #000000;
background: qlineargradient(x1:0, y1:0, x2:0, y2:1,
stop:0 #ffee01, stop:1 #ae8f00) url(&quot;ICONDIR/control/emergency-button.png&quot;);
}
QPushButton:pressed#landButton {
color: #000000;
background: qlineargradient(x1:0, y1:0, x2:0, y2:1,
stop:0 #bbaa00, stop:1 #a05b00) url(&quot;ICONDIR/control/emergency-button.png&quot;);
}
QPushButton#killButton {
color: #000000;
background: qlineargradient(x1:0, y1:0, x2:0, y2:1,
stop:0 #ffb917, stop:1 #b37300) url(&quot;ICONDIR/control/emergency-button.png&quot;);
}
QPushButton:pressed#killButton {
color: #000000;
background: qlineargradient(x1:0, y1:0, x2:0, y2:1,
stop:0 #bb8500, stop:1 #903000) url(&quot;ICONDIR/control/emergency-button.png&quot;);
}
QProgressBar {
border: 1px solid white;
border-radius: 4px;
text-align: center;
padding: 2px;
color: white;
background-color: #111111;
}
QProgressBar:horizontal {
height: 12px;
}
QProgressBar QLabel {
font-size: 8px;
}
QProgressBar:vertical {
width: 12px;
}
QProgressBar::chunk {
background-color: #656565;
}
QProgressBar::chunk#batteryBar {
background-color: green;
}
QProgressBar::chunk#speedBar {
background-color: yellow;
}
QProgressBar::chunk#thrustBar {
background-color: orange;
}</string>
<string notr="true"/>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>2</number>
</property>
@ -167,13 +55,22 @@ QProgressBar::chunk#thrustBar { @@ -167,13 +55,22 @@ QProgressBar::chunk#thrustBar {
<property name="checkable">
<bool>false</bool>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<layout class="QHBoxLayout" name="horizontalLayout" stretch="1,1,100,1">
<property name="spacing">
<number>6</number>
</property>
<property name="leftMargin">
<number>2</number>
</property>
<property name="margin">
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>2</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QCheckBox" name="current">
<property name="toolTip">

Loading…
Cancel
Save