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
eb1c4c8d
Commit
eb1c4c8d
authored
9 years ago
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Esc/Enter key support in QGCView dialogs
Total hack but it seems to work
parent
5399a291
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
60 additions
and
32 deletions
+60
-32
FactPanel.qml
src/FactSystem/FactControls/FactPanel.qml
+23
-18
ParameterEditorDialog.qml
src/QmlControls/ParameterEditorDialog.qml
+1
-10
QGCTextField.qml
src/QmlControls/QGCTextField.qml
+8
-0
QGCView.qml
src/QmlControls/QGCView.qml
+8
-0
QGCViewDialog.qml
src/QmlControls/QGCViewDialog.qml
+20
-4
No files found.
src/FactSystem/FactControls/FactPanel.qml
View file @
eb1c4c8d
...
...
@@ -31,14 +31,14 @@ import QGroundControl.FactSystem 1.0
import
QGroundControl
.
Controls
1.0
import
QGroundControl
.
Palette
1.0
Rectangle
{
color
:
qgcPal
.
window
QGCPalette
{
id
:
qgcPal
;
colorGroupEnabled
:
enabled
}
FocusScope
{
property
alias
color
:
rectangle
.
color
property
string
__missingParams
:
""
property
string
__errorMsg
:
""
QGCPalette
{
id
:
qgcPal
;
colorGroupEnabled
:
enabled
}
function
showMissingParameterOverlay
(
missingParamName
)
{
if
(
__missingParams
.
length
!=
0
)
{
__missingParams
=
__missingParams
.
concat
(
"
,
"
)
...
...
@@ -52,6 +52,10 @@ Rectangle {
__missingParamsOverlay
.
visible
=
true
}
Rectangle
{
id
:
rectangle
color
:
qgcPal
.
window
Rectangle
{
id
:
__missingParamsOverlay
anchors.fill
:
parent
...
...
@@ -66,4 +70,5 @@ Rectangle {
text
:
__errorMsg
.
length
?
__errorMsg
:
"
Parameters(s) missing:
"
+
__missingParams
}
}
}
}
This diff is collapsed.
Click to expand it.
src/QmlControls/ParameterEditorDialog.qml
View file @
eb1c4c8d
...
...
@@ -58,8 +58,7 @@ QGCViewDialog {
validationError
.
text
=
fact
.
validate
(
validateValue
,
false
/* convertOnly */
)
forceSave
.
visible
=
true
}
// This was causing problems where it would never give up focus even when hidden!
//valueField.forceActiveFocus()
valueField
.
forceActiveFocus
()
}
Column
{
...
...
@@ -87,14 +86,6 @@ QGCViewDialog {
// At this point all Facts are numeric
inputMethodHints
:
Qt
.
ImhFormattedNumbersOnly
onAccepted
:
accept
()
Keys.onReleased
:
{
if
(
event
.
key
==
Qt
.
Key_Escape
)
{
reject
()
}
}
}
QGCLabel
{
text
:
fact
.
name
}
...
...
This diff is collapsed.
Click to expand it.
src/QmlControls/QGCTextField.qml
View file @
eb1c4c8d
...
...
@@ -6,9 +6,17 @@ import QGroundControl.Palette 1.0
import
QGroundControl
.
ScreenTools
1.0
TextField
{
id
:
root
property
bool
showUnits
:
false
property
string
unitsLabel
:
""
Component.onCompleted
:
{
if
(
typeof
qgcTextFieldforwardKeysTo
!==
'
undefined
'
)
{
root
.
Keys
.
forwardTo
=
[
qgcTextFieldforwardKeysTo
]
}
}
property
var
__qgcPal
:
QGCPalette
{
colorGroupEnabled
:
enabled
}
textColor
:
__qgcPal
.
textFieldText
...
...
This diff is collapsed.
Click to expand it.
src/QmlControls/QGCView.qml
View file @
eb1c4c8d
...
...
@@ -146,6 +146,8 @@ FactPanel {
viewPanel
.
enabled
=
false
__dialogOverlay
.
visible
=
true
__dialogComponentLoader
.
item
.
forceActiveFocus
()
__animateShowDialog
.
start
()
}
...
...
@@ -166,10 +168,13 @@ FactPanel {
viewPanel
.
enabled
=
false
__dialogOverlay
.
visible
=
true
__dialogComponentLoader
.
item
.
forceActiveFocus
()
__animateShowDialog
.
start
()
}
function
hideDialog
()
{
__dialogComponentLoader
.
item
.
focus
=
false
viewPanel
.
enabled
=
true
__animateHideDialog
.
start
()
}
...
...
@@ -336,6 +341,9 @@ FactPanel {
anchors.top
:
__spacer
.
bottom
anchors.bottom
:
parent
.
bottom
sourceComponent
:
__dialogComponent
property
bool
acceptAllowed
:
__acceptButton
.
visible
property
bool
rejectAllowed
:
__rejectButton
.
visible
}
}
// Rectangle - Dialog panel
}
// Item - Dialog overlay
...
...
This diff is collapsed.
Click to expand it.
src/QmlControls/QGCViewDialog.qml
View file @
eb1c4c8d
...
...
@@ -34,19 +34,35 @@ import QGroundControl.FactSystem 1.0
import
QGroundControl
.
FactControls
1.0
FactPanel
{
property
var
qgcTextFieldforwardKeysTo
:
this
///< Causes all QGCTextFields to forward keys here if they have focus
QGCPalette
{
id
:
__qgcPal
;
colorGroupEnabled
:
enabled
}
signal
hideDialog
Keys.onReleased
:
{
if
(
event
.
key
==
Qt
.
Key_Escape
)
{
reject
()
event
.
accepted
=
true
}
else
if
(
event
.
key
==
Qt
.
Key_Return
)
{
accept
()
event
.
accepted
=
true
}
}
function
accept
()
{
if
(
acceptAllowed
)
{
Qt
.
inputMethod
.
hide
()
hideDialog
()
}
}
function
reject
()
{
if
(
rejectAllowed
)
{
Qt
.
inputMethod
.
hide
()
hideDialog
()
}
}
color
:
__qgcPal
.
windowShadeDark
}
This diff is collapsed.
Click to expand it.
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