Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Education
KAlgebra
Commits
39b87e42
Commit
39b87e42
authored
Dec 14, 2020
by
Carl Schwan
🚴
Browse files
Add a variable drawer on console page
parent
5509fae0
Changes
2
Hide whitespace changes
Inline
Side-by-side
mobile/content/ui/Console.qml
View file @
39b87e42
...
...
@@ -18,6 +18,7 @@
import
org
.
kde
.
kirigami
2.5
as
Kirigami
import
QtQuick
2.2
import
QtQuick
.
Layouts
1.2
import
QtQuick
.
Controls
2.5
as
QQC2
import
QtQml
.
Models
2.10
import
QtQuick
.
Dialogs
1.0
...
...
@@ -30,6 +31,37 @@ Kirigami.Page {
title
:
i18n
(
"
Calculator
"
)
ListModel
{
id
:
itemModel
}
// This content is only available in the desktop version of Kalgebra.
// Don't put any information here that can't be accessed by another
// part of Kalgebra.
readonly
property
Item
drawerContent
:
ColumnLayout
{
visible
:
true
width
:
300
Kirigami.AbstractApplicationHeader
{
Layout.fillWidth
:
true
topPadding
:
Kirigami
.
Units
.
smallSpacing
bottomPadding
:
Kirigami
.
Units
.
largeSpacing
leftPadding
:
Kirigami
.
Units
.
smallSpacing
rightPadding
:
Kirigami
.
Units
.
smallSpacing
Layout.preferredHeight
:
Kirigami
.
Units
.
gridUnit
*
2
Kirigami.Heading
{
level
:
1
text
:
i18n
(
"
Variables
"
)
Layout.fillWidth
:
true
}
}
QQC2.ScrollView
{
Layout.fillWidth
:
true
Layout.fillHeight
:
true
ListView
{
model
:
VariablesModel
{
variables
:
App
.
variables
}
delegate
:
Kirigami.BasicListItem
{
label
:
model
.
whatsThis
}
}
}
}
Clipboard
{
id
:
clipboard
}
...
...
mobile/content/ui/main.qml
View file @
39b87e42
...
...
@@ -42,9 +42,21 @@ Kirigami.ApplicationWindow
modal
:
!
rootItem
.
wideScreen
onModalChanged
:
drawerOpen
=
!
modal
handleVisible
:
modal
width
:
contentItem
?
columnWidth
:
0
header
:
Kirigami.AbstractApplicationHeader
{
topPadding
:
Kirigami
.
Units
.
smallSpacing
bottomPadding
:
Kirigami
.
Units
.
largeSpacing
leftPadding
:
Kirigami
.
Units
.
smallSpacing
rightPadding
:
Kirigami
.
Units
.
smallSpacing
implicitHeight
:
Kirigami
.
Units
.
gridUnit
*
2
Kirigami.Heading
{
level
:
1
text
:
i18n
(
"
KAlgebra
"
)
Layout.fillWidth
:
true
}
}
title
:
"
KAlgebra
"
titleIcon
:
"
qrc:/kalgebra.svgz
"
drawerOpen
:
true
actions
:
[
...
...
@@ -93,5 +105,32 @@ Kirigami.ApplicationWindow
]
}
readonly
property
Component
customDrawer
:
Kirigami.OverlayDrawer
{
leftPadding
:
0
rightPadding
:
0
topPadding
:
0
bottomPadding
:
0
edge
:
Qt
.
application
.
layoutDirection
==
Qt
.
RightToLeft
?
Qt
.
LeftEdge
:
Qt
.
RightEdge
modal
:
!
rootItem
.
wideScreen
onModalChanged
:
drawerOpen
=
!
modal
drawerOpen
:
true
onContentItemChanged
:
if
(
contentItem
)
{
contentItem
.
visible
=
true
;
}
width
:
contentItem
?
columnWidth
:
0
contentItem
:
mainPagePool
.
lastLoadedItem
.
drawerContent
??
null
handleVisible
:
mainPagePool
.
lastLoadedItem
.
drawerContent
!==
undefined
}
readonly
property
Component
normalDrawer
:
Kirigami.ContextDrawer
{}
Component.onCompleted
:
if
(
Kirigami
.
Settings
.
isMobile
)
{
contextDrawer
=
normalDrawer
.
createObject
(
rootItem
);
}
else
{
contextDrawer
=
customDrawer
.
createObject
(
rootItem
);
}
pageStack.initialPage
:
mainPagePool
.
loadPage
(
"
qrc:/Console.qml
"
)
}
Write
Preview
Supports
Markdown
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