Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
5f20c3ac
Commit
5f20c3ac
authored
Feb 13, 2017
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rework for mobile usability
parent
8de7cfc2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
67 deletions
+52
-67
FactTextField.qml
src/FactSystem/FactControls/FactTextField.qml
+1
-1
ParameterEditorDialog.qml
src/QmlControls/ParameterEditorDialog.qml
+47
-63
QGCTextField.qml
src/QmlControls/QGCTextField.qml
+4
-3
No files found.
src/FactSystem/FactControls/FactTextField.qml
View file @
5f20c3ac
...
@@ -40,7 +40,7 @@ QGCTextField {
...
@@ -40,7 +40,7 @@ QGCTextField {
}
}
}
}
onHelpClicked
:
qgcView
.
showDialog
(
helpDialogComponent
,
qsTr
(
"
Value Details
"
),
qgcView
.
showDialogDefaultWidth
,
StandardButton
.
Save
)
onHelpClicked
:
qgcView
.
showDialog
(
helpDialogComponent
,
qsTr
(
"
Value Details
"
),
qgcView
.
showDialogDefaultWidth
,
StandardButton
.
Save
|
StandardButton
.
Cancel
)
Component
{
Component
{
...
...
src/QmlControls/ParameterEditorDialog.qml
View file @
5f20c3ac
...
@@ -7,12 +7,9 @@
...
@@ -7,12 +7,9 @@
*
*
****************************************************************************/
****************************************************************************/
/// @file
/// @author Don Gagne <don@thegagnes.com>
import
QtQuick
2.5
import
QtQuick
2.5
import
QtQuick
.
Controls
1.3
import
QtQuick
.
Controls
1.3
import
QtQuick
.
Layouts
1.2
import
QGroundControl
.
Controls
1.0
import
QGroundControl
.
Controls
1.0
import
QGroundControl
.
Palette
1.0
import
QGroundControl
.
Palette
1.0
...
@@ -29,7 +26,8 @@ QGCViewDialog {
...
@@ -29,7 +26,8 @@ QGCViewDialog {
property
bool
validate
:
false
property
bool
validate
:
false
property
string
validateValue
property
string
validateValue
property
real
_editFieldWidth
:
ScreenTools
.
defaultFontPixelWidth
*
20
property
real
_editFieldWidth
:
ScreenTools
.
defaultFontPixelWidth
*
20
property
bool
_longDescriptionAvailable
:
fact
.
longDescription
!=
""
ParameterEditorController
{
id
:
controller
;
factPanel
:
parent
}
ParameterEditorController
{
id
:
controller
;
factPanel
:
parent
}
...
@@ -68,7 +66,6 @@ QGCViewDialog {
...
@@ -68,7 +66,6 @@ QGCViewDialog {
validationError
.
text
=
fact
.
validate
(
validateValue
,
false
/* convertOnly */
)
validationError
.
text
=
fact
.
validate
(
validateValue
,
false
/* convertOnly */
)
forceSave
.
visible
=
true
forceSave
.
visible
=
true
}
}
//valueField.forceActiveFocus()
}
}
QGCFlickable
{
QGCFlickable
{
...
@@ -83,28 +80,24 @@ QGCViewDialog {
...
@@ -83,28 +80,24 @@ QGCViewDialog {
anchors.right
:
parent
.
right
anchors.right
:
parent
.
right
QGCLabel
{
QGCLabel
{
id
:
validationError
width
:
parent
.
width
width
:
parent
.
width
wrapMode
:
Text
.
WordWrap
wrapMode
:
Text
.
WordWrap
visible
:
fact
.
shortDescription
color
:
qgcPal
.
warningText
text
:
fact
.
shortDescription
}
QGCLabel
{
width
:
parent
.
width
wrapMode
:
Text
.
WordWrap
visible
:
fact
.
longDescription
text
:
fact
.
longDescription
}
}
Row
{
RowLayout
{
spacing
:
defaultTextWidth
spacing
:
defaultTextWidth
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
QGCTextField
{
QGCTextField
{
id
:
valueField
id
:
valueField
text
:
validate
?
validateValue
:
fact
.
valueString
text
:
validate
?
validateValue
:
fact
.
valueString
visible
:
fact
.
enumStrings
.
length
==
0
||
validate
visible
:
fact
.
enumStrings
.
length
==
0
||
validate
//focus: true
unitsLabel
:
fact
.
units
showUnits
:
fact
.
units
!=
""
Layout.fillWidth
:
true
inputMethodHints
:
ScreenTools
.
isiOS
?
inputMethodHints
:
ScreenTools
.
isiOS
?
Qt
.
ImhNone
:
// iOS numeric keyboard has not done button, we can't use it
Qt
.
ImhNone
:
// iOS numeric keyboard has not done button, we can't use it
Qt
.
ImhFormattedNumbersOnly
// Forces use of virtual numeric keyboard
Qt
.
ImhFormattedNumbersOnly
// Forces use of virtual numeric keyboard
...
@@ -113,7 +106,6 @@ QGCViewDialog {
...
@@ -113,7 +106,6 @@ QGCViewDialog {
QGCButton
{
QGCButton
{
anchors.baseline
:
valueField
.
baseline
anchors.baseline
:
valueField
.
baseline
visible
:
fact
.
defaultValueAvailable
visible
:
fact
.
defaultValueAvailable
width
:
_editFieldWidth
text
:
qsTr
(
"
Reset to default
"
)
text
:
qsTr
(
"
Reset to default
"
)
onClicked
:
{
onClicked
:
{
...
@@ -159,63 +151,55 @@ QGCViewDialog {
...
@@ -159,63 +151,55 @@ QGCViewDialog {
}
}
QGCLabel
{
QGCLabel
{
text
:
fact
.
name
width
:
parent
.
width
visible
:
fact
.
componentId
>
0
// > 0 means it's a parameter fact
wrapMode
:
Text
.
WordWrap
visible
:
!
longDescriptionLabel
.
visible
text
:
fact
.
shortDescription
}
}
Column
{
QGCLabel
{
spacing
:
defaultTextHeight
/
2
id
:
longDescriptionLabel
anchors.left
:
parent
.
left
width
:
parent
.
width
anchors.right
:
parent
.
right
wrapMode
:
Text
.
WordWrap
visible
:
fact
.
longDescription
!=
""
Row
{
text
:
fact
.
longDescription
spacing
:
defaultTextWidth
}
QGCLabel
{
text
:
qsTr
(
"
Units:
"
)
}
QGCLabel
{
text
:
fact
.
units
?
fact
.
units
:
qsTr
(
"
none
"
)
}
}
Row
{
spacing
:
defaultTextWidth
visible
:
!
fact
.
minIsDefaultForType
QGCLabel
{
text
:
qsTr
(
"
Minimum value:
"
)
}
QGCLabel
{
text
:
fact
.
minString
}
}
Row
{
Row
{
spacing
:
defaultTextWidth
spacing
:
defaultTextWidth
visible
:
!
fact
.
maxIsDefaultForType
QGCLabel
{
text
:
qsTr
(
"
Maximum value:
"
)
}
QGCLabel
{
QGCLabel
{
text
:
fact
.
maxString
}
id
:
minValueDisplay
text
:
qsTr
(
"
Min:
"
)
+
fact
.
minString
visible
:
!
fact
.
minIsDefaultForType
}
}
Row
{
QGCLabel
{
spacing
:
defaultTextWidth
text
:
qsTr
(
"
Max:
"
)
+
fact
.
maxString
visible
:
!
fact
.
maxIsDefaultForType
QGCLabel
{
text
:
qsTr
(
"
Default value:
"
)
}
QGCLabel
{
text
:
fact
.
defaultValueAvailable
?
fact
.
defaultValueString
:
qsTr
(
"
none
"
)
}
}
}
QGCLabel
{
QGCLabel
{
visible
:
fact
.
rebootRequired
text
:
qsTr
(
"
Default:
"
)
+
fact
.
defaultValueString
text
:
"
Reboot required after change
"
visible
:
fact
.
defaultValueAvailable
}
}
}
// Column
}
QGCLabel
{
QGCLabel
{
width
:
parent
.
width
text
:
qsTr
(
"
Parameter name:
"
)
+
fact
.
name
wrapMode
:
Text
.
WordWrap
visible
:
fact
.
componentId
>
0
// > 0 means it's a parameter fact
text
:
qsTr
(
"
Warning: Modifying values while vehicle is in flight can lead to vehicle instability and possible vehicle loss.
"
)
+
}
qsTr
(
"
Make sure you know what you are doing and double-check your values before Save!
"
)
QGCLabel
{
visible
:
fact
.
rebootRequired
text
:
"
Reboot required after change
"
}
}
QGCLabel
{
QGCLabel
{
id
:
validationError
width
:
parent
.
width
width
:
parent
.
width
wrapMode
:
Text
.
WordWrap
wrapMode
:
Text
.
WordWrap
color
:
qsTr
(
"
yellow
"
)
text
:
qsTr
(
"
Warning: Modifying values while vehicle is in flight can lead to vehicle instability and possible vehicle loss.
"
)
+
qsTr
(
"
Make sure you know what you are doing and double-check your values before Save!
"
)
}
}
QGCCheckBox
{
QGCCheckBox
{
...
...
src/QmlControls/QGCTextField.qml
View file @
5f20c3ac
...
@@ -97,9 +97,10 @@ TextField {
...
@@ -97,9 +97,10 @@ TextField {
}
}
MouseArea
{
MouseArea
{
anchors.fill
:
unitsHelpLayout
anchors.margins
:
ScreenTools
.
isMobile
?
-
(
ScreenTools
.
defaultFontPixelWidth
*
0.66
)
:
0
// Larger touch area for mobile
enabled
:
control
.
activeFocus
anchors.fill
:
unitsHelpLayout
onClicked
:
root
.
helpClicked
()
enabled
:
control
.
activeFocus
onClicked
:
root
.
helpClicked
()
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment