1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-12-01 09:24:10 +01:00

OP-1683 - update tooltips, small UI changes

This commit is contained in:
Alessio Morale 2015-02-01 21:27:25 +01:00
parent a5f601593d
commit a7caee7bc4
4 changed files with 188 additions and 141 deletions

View File

@ -252,9 +252,11 @@ void ConfigOutputWidget::sendChannelTest(int index, int value)
void ConfigOutputWidget::setColor(QWidget *widget, const QColor color)
{
QPalette p(palette());
QColor color2 = QColor(color);
p.setColor(QPalette::Background, color2);
p.setColor(QPalette::Background, color);
p.setColor(QPalette::Base, color);
p.setColor(QPalette::Active, QPalette::Button, color);
p.setColor(QPalette::Inactive, QPalette::Button, color);
widget->setAutoFillBackground(true);
widget->setPalette(p);
}
@ -283,7 +285,13 @@ void ConfigOutputWidget::refreshWidgetsValues(UAVObject *obj)
QList<int> ChannelBanks;
QList<QColor> bankColors;
bankColors << Qt::magenta << Qt::yellow << Qt::green << Qt::cyan << Qt::red << Qt::darkCyan;
bankColors
<< QColor("#C6ECAE")
<< QColor("#91E5D3")
<< QColor("#FCEC52")
<< QColor("#C3A8FF")
<< QColor("#F7F7F2")
<< QColor("#FF9F51");
// Initialize output forms
QList<OutputChannelForm *> outputChannelForms = findChildren<OutputChannelForm *>();
foreach(OutputChannelForm * outputChannelForm, outputChannelForms) {
@ -390,7 +398,7 @@ void ConfigOutputWidget::refreshWidgetsValues(UAVObject *obj)
outputChannelForm->setRange(minValue, maxValue);
if (ChannelBanks.count() > i) {
outputChannelForm->setBank(QString("%1:").arg(ChannelBanks.at(i)));
outputChannelForm->setBank(QString("%1").arg(ChannelBanks.at(i)));
outputChannelForm->setColor(bankColors[ChannelBanks.at(i++) - 1]);
}
int neutral = actuatorSettingsData.ChannelNeutral[outputChannelForm->index()];

View File

@ -282,9 +282,15 @@
</size>
</property>
<property name="toolTip">
<string>Setup &quot;RapidESC&quot; here: usual value is 490 Hz for multirotor airframes.
<string>Setup PWM rate here: usual value is 490 Hz for multirotor airframes. OneShot and OneShot125 does not use this value
</string>
</property>
<property name="autoFillBackground">
<bool>false</bool>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<item>
<property name="text">
<string>50</string>
@ -345,8 +351,10 @@
</size>
</property>
<property name="toolTip">
<string>Setup &quot;RapidESC&quot; here: usual value is 490 Hz for multirotor airframes.
</string>
<string>Setup PWM rate here: usual value is 490 Hz for multirotor airframes. OneShot and OneShot125 does not use this value</string>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<item>
<property name="text">
@ -430,8 +438,10 @@
</size>
</property>
<property name="toolTip">
<string>Setup &quot;RapidESC&quot; here: usual value is 490 Hz for multirotor airframes.
</string>
<string>Setup PWM rate here: usual value is 490 Hz for multirotor airframes. OneShot and OneShot125 does not use this value</string>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<item>
<property name="text">
@ -493,8 +503,10 @@
</size>
</property>
<property name="toolTip">
<string>Setup &quot;RapidESC&quot; here: usual value is 490 Hz for multirotor airframes.
</string>
<string>Setup PWM rate here: usual value is 490 Hz for multirotor airframes. OneShot and OneShot125 does not use this value</string>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<item>
<property name="text">
@ -566,8 +578,10 @@
</size>
</property>
<property name="toolTip">
<string>Setup &quot;RapidESC&quot; here: usual value is 490 Hz for multirotor airframes.
</string>
<string>Setup PWM rate here: usual value is 490 Hz for multirotor airframes. OneShot and OneShot125 does not use this value</string>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<item>
<property name="text">
@ -629,8 +643,10 @@
</size>
</property>
<property name="toolTip">
<string>Setup &quot;RapidESC&quot; here: usual value is 490 Hz for multirotor airframes.
</string>
<string>Setup PWM rate here: usual value is 490 Hz for multirotor airframes. OneShot and OneShot125 does not use this value</string>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<item>
<property name="text">
@ -742,7 +758,9 @@
</size>
</property>
<property name="toolTip">
<string>Setup output mode. standard ESCs uses PWM.</string>
<string>Setup output mode. Use PWM or OneShot with Standard ESCs.
Several other ESCs like BLHeli 13+ can use the more advanced OneShot125.
When using OneShot125 all values set in min/max and idle are divided by eight before being sent to esc (i.e. 1000 = 125, 2000 = 250).</string>
</property>
</widget>
</item>
@ -764,7 +782,7 @@
</size>
</property>
<property name="toolTip">
<string>Setup output mode. standard ESCs uses PWM.</string>
<string>Setup output mode. Use PWM or OneShot with Standard ESCs.\nSeveral other ESCs like BLHeli 13+ can use the more advanced OneShot125.\nWhen using OneShot125 all values set in min/max and idle are divided by eight before being sent to esc (i.e. 1000 = 125, 2000 = 250).</string>
</property>
</widget>
</item>
@ -786,7 +804,7 @@
</size>
</property>
<property name="toolTip">
<string>Setup output mode. standard ESCs uses PWM.</string>
<string>Setup output mode. Use PWM or OneShot with Standard ESCs.\nSeveral other ESCs like BLHeli 13+ can use the more advanced OneShot125.\nWhen using OneShot125 all values set in min/max and idle are divided by eight before being sent to esc (i.e. 1000 = 125, 2000 = 250).</string>
</property>
</widget>
</item>
@ -808,7 +826,7 @@
</size>
</property>
<property name="toolTip">
<string>Setup output mode. standard ESCs uses PWM.</string>
<string>Setup output mode. Use PWM or OneShot with Standard ESCs.\nSeveral other ESCs like BLHeli 13+ can use the more advanced OneShot125.\nWhen using OneShot125 all values set in min/max and idle are divided by eight before being sent to esc (i.e. 1000 = 125, 2000 = 250).</string>
</property>
</widget>
</item>
@ -830,7 +848,7 @@
</size>
</property>
<property name="toolTip">
<string>Setup output mode. standard ESCs uses PWM.</string>
<string>Setup output mode. Use PWM or OneShot with Standard ESCs.\nSeveral other ESCs like BLHeli 13+ can use the more advanced OneShot125.\nWhen using OneShot125 all values set in min/max and idle are divided by eight before being sent to esc (i.e. 1000 = 125, 2000 = 250).</string>
</property>
</widget>
</item>
@ -852,7 +870,7 @@
</size>
</property>
<property name="toolTip">
<string>Setup output mode. standard ESCs uses PWM.</string>
<string>Setup output mode. Use PWM or OneShot with Standard ESCs.\nSeveral other ESCs like BLHeli 13+ can use the more advanced OneShot125.\nWhen using OneShot125 all values set in min/max and idle are divided by eight before being sent to esc (i.e. 1000 = 125, 2000 = 250).</string>
</property>
</widget>
</item>

View File

@ -33,7 +33,7 @@ OutputChannelForm::OutputChannelForm(const int index, QWidget *parent) :
ui.setupUi(this);
// The convention for OP is Channel 1 to Channel 10.
ui.actuatorNumber->setText(QString("%1:").arg(index + 1));
ui.actuatorNumber->setText(QString("%1").arg(index + 1));
setBank("-");
// Register for ActuatorSettings changes:
connect(ui.actuatorMin, SIGNAL(editingFinished()), this, SLOT(setChannelRange()));
@ -73,15 +73,13 @@ void OutputChannelForm::setName(const QString &name)
void OutputChannelForm::setColor(const QColor &color)
{
QPalette p(palette());
QString stylesheet = ui.actuatorNumberFrame->styleSheet();
p.setColor(QPalette::Background, color);
p.setColor(QPalette::Base, color);
p.setBrush(QPalette::Base, Qt::transparent);
ui.actuatorBankNumber->setAutoFillBackground(true);
ui.actuatorNumber->setAutoFillBackground(true);
ui.actuatorBankNumber->setPalette(p);
ui.actuatorNumber->setPalette(p);
stylesheet = stylesheet.split("background-color").first();
stylesheet.append(
QString("background-color: rgb(%1, %2, %3)")
.arg(color.red()).arg(color.green()).arg(color.blue()));
ui.actuatorNumberFrame->setStyleSheet(stylesheet);
}
/**

View File

@ -168,7 +168,7 @@ margin:1px;</string>
</property>
</spacer>
</item>
<item row="0" column="0">
<item row="0" column="0" colspan="2">
<widget class="QLabel" name="legend6">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
@ -207,7 +207,7 @@ font: bold 12px;
margin:1px;</string>
</property>
<property name="text">
<string>#</string>
<string> # - Bank</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
@ -289,7 +289,8 @@ margin:1px;</string>
<enum>Qt::StrongFocus</enum>
</property>
<property name="toolTip">
<string>Minimum PWM value, beware of not overdriving your servo.</string>
<string>Minimum PWM value, beware of not overdriving your servo.
Using OneShot125 a value of 1000(uS) here will produce a pulse of 125(uS).</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
@ -302,44 +303,148 @@ margin:1px;</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="actuatorNumber">
<item row="1" column="0" colspan="2">
<widget class="QFrame" name="actuatorNumberFrame">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>20</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
<width>100</width>
<height>22</height>
</size>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="toolTip">
<string>Channel Number</string>
</property>
<property name="styleSheet">
<string notr="true">border-radius: 5;\nfont: bold 12px;\nmargin:1px;</string>
<string notr="true">border-radius: 5; margin:1px;</string>
</property>
<property name="text">
<string>0:</string>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QHBoxLayout">
<property name="leftMargin">
<number>2</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>2</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="actuatorNumber">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>20</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="toolTip">
<string>Channel Number</string>
</property>
<property name="styleSheet">
<string notr="true">border-radius: 5;\nfont: bold 12px;\nmargin:1px;</string>
</property>
<property name="text">
<string>0</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">border-radius: 5;\nfont: 12px;\nmargin:1px;</string>
</property>
<property name="text">
<string/>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="actuatorBankNumber">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>20</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Bank number</string>
</property>
<property name="styleSheet">
<string notr="true">border-radius: 5;\nfont: 12px;\nmargin:1px;</string>
</property>
<property name="text">
<string> 0</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="0" column="7">
@ -523,7 +628,8 @@ margin:1px;</string>
<enum>Qt::StrongFocus</enum>
</property>
<property name="toolTip">
<string>Maximum PWM value, beware of not overdriving your servo.</string>
<string>Maximum value, beware of not overdriving your servo.
Using OneShot125 a value of 2000(uS) here will produce a pulse of 250(uS).</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
@ -735,89 +841,6 @@ margin:1px;</string>
</layout>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="label">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="font">
<font>
<pointsize>-1</pointsize>
<weight>75</weight>
<italic>false</italic>
<bold>true</bold>
</font>
</property>
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
<property name="styleSheet">
<string notr="true">background-color: qlineargradient(spread:reflect, x1:0.507, y1:0, x2:0.507, y2:0.772, stop:0.208955 rgba(74, 74, 74, 255), stop:0.78607 rgba(36, 36, 36, 255));
color: rgb(255, 255, 255);
border-radius: 5;
font: bold 12px;
margin:1px;</string>
</property>
<property name="text">
<string>Bank</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="margin">
<number>0</number>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="actuatorBankNumber">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>20</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Bank number</string>
</property>
<property name="styleSheet">
<string notr="true">border-radius: 5;\nfont: 12px;\nmargin:1px;</string>
</property>
<property name="text">
<string>0</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>