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
2da77d40
Commit
2da77d40
authored
May 17, 2021
by
Swapnil Tripathi
Committed by
Aleix Pol Gonzalez
May 17, 2021
Browse files
Use drawers in place of overlay sheet in graphs
parent
70366f34
Changes
5
Hide whitespace changes
Inline
Side-by-side
mobile/content/ui/Plot2D.qml
100644 → 100755
View file @
2da77d40
...
...
@@ -67,6 +67,12 @@ KAlgebraPage {
}
//custom viewport?
]
actions.main
:
Kirigami.Action
{
icon.name
:
'
list-add
'
text
:
i18n
(
'
Add Plot
'
)
onTriggered
:
plotDialog
.
open
()
}
Rectangle
{
anchors.fill
:
parent
...
...
@@ -77,50 +83,9 @@ KAlgebraPage {
id
:
view
anchors.fill
:
parent
model
:
App
.
functionsModel
()
Kirigami.OverlaySheet
{
id
:
dialog
header
:
RowLayout
{
width
:
parent
.
width
ExpressionInput
{
id
:
input
Layout.fillWidth
:
true
text
:
"
sin x
"
focus
:
true
Component.onCompleted
:
selectAll
()
onAccepted
:
{
input
.
selectAll
()
view
.
addFunction
(
input
.
text
,
App
.
variables
)
}
}
Button
{
icon.name
:
"
list-add
"
onClicked
:
{
input
.
selectAll
()
view
.
addFunction
(
input
.
text
,
App
.
variables
)
}
}
}
contentItem
:
Kirigami.CardsListView
{
delegate
:
Kirigami.Card
{
contentItem
:
Label
{
text
:
model
.
description
}
}
model
:
App
.
functionsModel
()
footer
:
Button
{
text
:
i18n
(
"
Clear All
"
)
onClicked
:
{
App
.
functionsModel
().
clear
();
view
.
resetViewport
();
}
}
}
}
AddButton
{
onClicked
:
{
dialog
.
open
();
}
Add2DDialog
{
id
:
plotDialog
}
}
}
}
}
\ No newline at end of file
mobile/content/ui/Plot3D.qml
100644 → 100755
View file @
2da77d40
...
...
@@ -41,7 +41,7 @@ KAlgebraPage {
}
contextualActions
:
[
Action
{
Kirigami.
Action
{
text
:
i18n
(
"
Save
"
)
onTriggered
:
{
fileDialog
.
title
=
text
...
...
@@ -54,68 +54,24 @@ KAlgebraPage {
fileDialog
.
open
()
}
},
Action
{
Kirigami.
Action
{
text
:
i18n
(
"
Reset Viewport
"
)
onTriggered
:
view
.
resetViewport
()
}
]
Graph3D
{
actions.main
:
Kirigami.Action
{
icon.name
:
'
list-add
'
text
:
i18n
(
'
Add Plot
'
)
onTriggered
:
plotDialog
.
open
()
}
Graph3D
{
id
:
view
anchors.fill
:
parent
model
:
App
.
functionsModel
()
Kirigami.OverlaySheet
{
id
:
dialog
header
:
RowLayout
{
width
:
parent
.
width
ExpressionInput
{
id
:
input
Layout.fillWidth
:
true
text
:
"
sin x*sin y
"
focus
:
true
Component.onCompleted
:
selectAll
()
onAccepted
:
{
input
.
selectAll
()
var
err
=
App
.
functionsModel
().
addFunction
(
input
.
text
,
4
,
App
.
variables
)
if
(
err
.
length
>
0
)
console
.
warn
(
"
errors:
"
,
err
)
}
}
Button
{
icon.name
:
"
list-add
"
onClicked
:
{
input
.
selectAll
()
var
err
=
view
.
addFunction
(
input
.
text
,
App
.
variables
)
if
(
err
.
length
>
0
)
console
.
warn
(
"
errors:
"
,
err
)
}
}
}
contentItem
:
Kirigami.CardsListView
{
id
:
list
delegate
:
Kirigami.Card
{
contentItem
:
Label
{
text
:
model
.
description
}
}
model
:
view
.
model
footer
:
Button
{
text
:
i18n
(
"
Clear All
"
)
onClicked
:
{
view
.
model
.
clear
()
view
.
resetView
()
}
}
}
}
AddButton
{
onClicked
:
{
dialog
.
open
();
}
Add3DDialog
{
id
:
plotDialog
}
}
}
mobile/content/ui/controls/Add2DDialog.qml
0 → 100755
View file @
2da77d40
// SPDX-FileCopyrightText: 2021 Swapnil Tripathi <swapnil06.st@gmail.com>
// SPDX-License-Identifier: GPL-2.0-or-later
import
QtQuick
2.0
import
QtQuick
.
Controls
2.2
import
QtQuick
.
Layouts
1.15
import
org
.
kde
.
kirigami
2.8
as
Kirigami
import
org
.
kde
.
analitza
1.0
import
org
.
kde
.
kalgebra
.
mobile
1.0
Kirigami.OverlayDrawer
{
id
:
drawer
parent
:
page
height
:
parent
.
height
/
2
edge
:
Qt
.
BottomEdge
z
:
-
1
Behavior
on
height
{
NumberAnimation
{
duration
:
Kirigami
.
Units
.
shortDuration
}
}
contentItem
:
ColumnLayout
{
anchors.fill
:
parent
ToolBar
{
Layout.fillWidth
:
true
RowLayout
{
anchors.fill
:
parent
ExpressionInput
{
id
:
input
Layout.fillWidth
:
true
text
:
"
sin x
"
focus
:
true
Component.onCompleted
:
selectAll
()
Keys.onReturnPressed
:
{
input
.
selectAll
()
view
.
addFunction
(
input
.
text
,
App
.
variables
)
}
}
Button
{
icon.name
:
"
list-add
"
onClicked
:
{
input
.
selectAll
()
view
.
addFunction
(
input
.
text
,
App
.
variables
)
}
}
Button
{
text
:
i18n
(
"
Clear All
"
)
onClicked
:
{
App
.
functionsModel
().
clear
();
view
.
resetViewport
();
}
}
Button
{
icon.name
:
"
collapse
"
onClicked
:
{
drawer
.
close
()
}
}
}
}
ScrollView
{
Layout.fillWidth
:
true
Layout.fillHeight
:
true
ListView
{
model
:
App
.
functionsModel
()
delegate
:
Kirigami.SwipeListItem
{
contentItem
:
Label
{
text
:
model
.
description
}
}
}
}
}
}
mobile/content/ui/controls/Add3DDialog.qml
0 → 100755
View file @
2da77d40
// SPDX-FileCopyrightText: 2021 Swapnil Tripathi <swapnil06.st@gmail.com>
// SPDX-License-Identifier: GPL-2.0-or-later
import
QtQuick
2.0
import
QtQuick
.
Controls
2.2
import
QtQuick
.
Layouts
1.1
import
org
.
kde
.
kirigami
2.8
as
Kirigami
import
org
.
kde
.
analitza
1.0
import
org
.
kde
.
kalgebra
.
mobile
1.0
Kirigami.OverlayDrawer
{
id
:
drawer
parent
:
page
height
:
parent
.
height
/
2
edge
:
Qt
.
BottomEdge
z
:
-
1
Behavior
on
height
{
NumberAnimation
{
duration
:
Kirigami
.
Units
.
shortDuration
}
}
contentItem
:
ColumnLayout
{
anchors.fill
:
parent
ToolBar
{
Layout.fillWidth
:
true
RowLayout
{
anchors.fill
:
parent
ExpressionInput
{
id
:
input
Layout.fillWidth
:
true
text
:
"
sin x*sin y
"
focus
:
true
Component.onCompleted
:
selectAll
()
Keys.onReturnPressed
:
{
input
.
selectAll
()
var
err
=
App
.
functionsModel
().
addFunction
(
input
.
text
,
4
,
App
.
variables
)
if
(
err
.
length
>
0
)
console
.
warn
(
"
errors:
"
,
err
)
}
}
Button
{
icon.name
:
"
list-add
"
onClicked
:
{
input
.
selectAll
()
var
err
=
view
.
addFunction
(
input
.
text
,
App
.
variables
)
if
(
err
.
length
>
0
)
console
.
warn
(
"
errors:
"
,
err
)
}
}
Button
{
text
:
i18n
(
"
Clear All
"
)
onClicked
:
{
App
.
functionsModel
().
clear
();
view
.
resetViewport
();
}
}
Button
{
icon.name
:
"
collapse
"
onClicked
:
{
drawer
.
close
()
}
}
}
}
ScrollView
{
Layout.fillWidth
:
true
Layout.fillHeight
:
true
ListView
{
model
:
App
.
functionsModel
()
delegate
:
Kirigami.SwipeListItem
{
contentItem
:
Label
{
text
:
model
.
description
}
}
}
}
}
}
mobile/resources.qrc
View file @
2da77d40
...
...
@@ -17,5 +17,7 @@
<file alias="RealInput.qml">content/ui/controls/RealInput.qml</file>
<file alias="ExpressionInput.qml">content/ui/controls/ExpressionInput.qml</file>
<file alias="AddButton.qml">content/ui/controls/AddButton.qml</file>
<file alias="Add2DDialog.qml">content/ui/controls/Add2DDialog.qml</file>
<file alias="Add3DDialog.qml">content/ui/controls/Add3DDialog.qml</file>
</qresource>
</RCC>
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