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
629094b8
Commit
629094b8
authored
Apr 14, 2020
by
DoinLakeFlyer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
parent
eac7e5db
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
36 deletions
+43
-36
QGCPopupDialog.qml
src/QmlControls/QGCPopupDialog.qml
+5
-1
QGCPopupDialogContainer.qml
src/QmlControls/QGCPopupDialogContainer.qml
+34
-31
MainRootWindow.qml
src/ui/MainRootWindow.qml
+4
-4
No files found.
src/QmlControls/QGCPopupDialog.qml
View file @
629094b8
...
@@ -8,8 +8,12 @@
...
@@ -8,8 +8,12 @@
****************************************************************************/
****************************************************************************/
import
QtQuick
2.12
import
QtQuick
2.12
import
QtQuick
.
Dialogs
1.3
Item
{
Item
{
property
string
title
property
var
buttons
:
StandardButton
.
Ok
width
:
childrenRect
.
width
width
:
childrenRect
.
width
height
:
childrenRect
.
height
height
:
childrenRect
.
height
...
...
src/QmlControls/QGCPopupDialogContainer.qml
View file @
629094b8
...
@@ -18,7 +18,10 @@ import QGroundControl.Palette 1.0
...
@@ -18,7 +18,10 @@ import QGroundControl.Palette 1.0
import
QGroundControl
.
ScreenTools
1.0
import
QGroundControl
.
ScreenTools
1.0
Popup
{
Popup
{
id
:
root
property
var
dialogComponent
property
var
dialogProperties
id
:
popupRoot
anchors.centerIn
:
parent
anchors.centerIn
:
parent
width
:
mainFlickable
.
width
+
(
padding
*
2
)
width
:
mainFlickable
.
width
+
(
padding
*
2
)
height
:
mainFlickable
.
height
+
(
padding
*
2
)
height
:
mainFlickable
.
height
+
(
padding
*
2
)
...
@@ -26,68 +29,66 @@ Popup {
...
@@ -26,68 +29,66 @@ Popup {
modal
:
true
modal
:
true
focus
:
true
focus
:
true
property
var
pal
:
QGroundControl
.
globalPalette
property
var
_pal
:
QGroundControl
.
globalPalette
property
real
frameSize
:
ScreenTools
.
defaultFontPixelWidth
property
real
_frameSize
:
ScreenTools
.
defaultFontPixelWidth
property
string
_dialogTitle
property
real
_contentMargin
:
ScreenTools
.
defaultFontPixelHeight
/
2
property
real
_popupDoubleInset
:
ScreenTools
.
defaultFontPixelHeight
*
2
property
real
_maxAvailableWidth
:
parent
.
width
-
_popupDoubleInset
property
real
_maxAvailableHeight
:
parent
.
height
-
_popupDoubleInset
background
:
Item
{
background
:
Item
{
Rectangle
{
Rectangle
{
anchors.left
:
parent
.
left
anchors.left
:
parent
.
left
anchors.top
:
parent
.
top
anchors.top
:
parent
.
top
width
:
frameSize
width
:
_
frameSize
height
:
frameSize
height
:
_
frameSize
color
:
pal
.
text
color
:
_
pal
.
text
visible
:
enabled
visible
:
enabled
}
}
Rectangle
{
Rectangle
{
anchors.right
:
parent
.
right
anchors.right
:
parent
.
right
anchors.top
:
parent
.
top
anchors.top
:
parent
.
top
width
:
frameSize
width
:
_
frameSize
height
:
frameSize
height
:
_
frameSize
color
:
pal
.
text
color
:
_
pal
.
text
visible
:
enabled
visible
:
enabled
}
}
Rectangle
{
Rectangle
{
anchors.left
:
parent
.
left
anchors.left
:
parent
.
left
anchors.bottom
:
parent
.
bottom
anchors.bottom
:
parent
.
bottom
width
:
frameSize
width
:
_
frameSize
height
:
frameSize
height
:
_
frameSize
color
:
pal
.
text
color
:
_
pal
.
text
visible
:
enabled
visible
:
enabled
}
}
Rectangle
{
Rectangle
{
anchors.right
:
parent
.
right
anchors.right
:
parent
.
right
anchors.bottom
:
parent
.
bottom
anchors.bottom
:
parent
.
bottom
width
:
frameSize
width
:
_
frameSize
height
:
frameSize
height
:
_
frameSize
color
:
pal
.
text
color
:
_
pal
.
text
visible
:
enabled
visible
:
enabled
}
}
Rectangle
{
Rectangle
{
anchors.margins
:
r
oot
.
padding
anchors.margins
:
popupR
oot
.
padding
anchors.fill
:
parent
anchors.fill
:
parent
color
:
pal
.
window
color
:
_
pal
.
window
}
}
}
}
property
string
title
Component.onCompleted
:
{
property
var
buttons
_dialogTitle
=
dialogComponentLoader
.
item
.
title
property
var
dialogComponent
setupDialogButtons
(
dialogComponentLoader
.
item
.
buttons
)
}
property
real
_contentMargin
:
ScreenTools
.
defaultFontPixelHeight
/
2
property
real
_popupDoubleInset
:
ScreenTools
.
defaultFontPixelHeight
*
2
property
real
_maxAvailableWidth
:
parent
.
width
-
_popupDoubleInset
property
real
_maxAvailableHeight
:
parent
.
height
-
_popupDoubleInset
Component.onCompleted
:
setupDialogButtons
()
QGCPalette
{
id
:
qgcPal
;
colorGroupEnabled
:
parent
.
enabled
}
QGCPalette
{
id
:
qgcPal
;
colorGroupEnabled
:
parent
.
enabled
}
function
setupDialogButtons
()
{
function
setupDialogButtons
(
buttons
)
{
acceptButton
.
visible
=
false
acceptButton
.
visible
=
false
rejectButton
.
visible
=
false
rejectButton
.
visible
=
false
// Accept role buttons
// Accept role buttons
...
@@ -210,6 +211,8 @@ Popup {
...
@@ -210,6 +211,8 @@ Popup {
x
:
_contentMargin
x
:
_contentMargin
sourceComponent
:
dialogComponent
sourceComponent
:
dialogComponent
focus
:
true
focus
:
true
property
var
dialogProperties
:
popupRoot
.
dialogProperties
property
bool
acceptAllowed
:
acceptButton
.
visible
property
bool
acceptAllowed
:
acceptButton
.
visible
property
bool
rejectAllowed
:
rejectButton
.
visible
property
bool
rejectAllowed
:
rejectButton
.
visible
}
}
...
...
src/ui/MainRootWindow.qml
View file @
629094b8
...
@@ -229,13 +229,13 @@ ApplicationWindow {
...
@@ -229,13 +229,13 @@ ApplicationWindow {
}
}
}
}
function
showPopupDialog
(
component
,
title
,
button
s
)
{
function
showPopupDialog
(
component
,
propertie
s
)
{
var
popup
=
popupDialogContainterComponent
.
createObject
(
mainWindow
,
{
"
title
"
:
title
,
"
buttons
"
:
buttons
,
"
dialogComponent
"
:
component
})
var
dialog
=
popupDialogContainerComponent
.
createObject
(
mainWindow
,
{
dialogComponent
:
component
,
dialogProperties
:
properties
})
popup
.
open
()
dialog
.
open
()
}
}
Component
{
Component
{
id
:
popupDialogContain
t
erComponent
id
:
popupDialogContainerComponent
QGCPopupDialogContainer
{
}
QGCPopupDialogContainer
{
}
}
}
...
...
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