Commit 4f7ed76f authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧
Browse files

Fix UI organization

Make the main UI a column of plot view and description, separately.
parent c491c955
......@@ -9,77 +9,72 @@ KAlgebraPage
id: page
anchors.margins: 0
Rectangle {
ColumnLayout {
id: descriptioncol
anchors.fill: parent
color: 'white'
id: informationrec
Graph2D {
id: view
anchors {
top: descriptioncol.bottom
left: parent.left
right: parent.right
bottom: parent.bottom
}
model: app.functionsModel()
Component.onCompleted: {
chosebox.updateGraph();
spacing: 10
Rectangle {
color: 'white'
Layout.fillWidth: true
Layout.fillHeight: true
Graph2D {
id: view
anchors {
fill: parent
}
model: app.functionsModel()
Component.onCompleted: {
chosebox.updateGraph();
}
}
}
ColumnLayout {
id: descriptioncol
OperatorsModel {
id: operators
}
Controls.ComboBox {
anchors {
top: parent.top
left: parent.left
right: parent.right
}
spacing: 10
OperatorsModel {
id: operators
}
Controls.ComboBox {
anchors {
left: parent.left
right: parent.right
}
id: chosebox
currentIndex: 29
activeFocusOnPress: true
id: chosebox
currentIndex: 29
activeFocusOnPress: true
model: ListModel {
id: cbItems
Component.onCompleted: {
for (var i=0; i<operators.rowCount(); i++)
cbItems.append( { text: operators.data(operators.index(i,0)) } );
}
}
function updateGraph() {
if(examplelabel!=null)
{
app.functionsModel().clear();
view.resetViewport();
view.addFunction(examplelabel.text,app.variables);
}
model: ListModel {
id: cbItems
Component.onCompleted: {
for (var i=0; i<operators.rowCount(); i++)
cbItems.append( { text: operators.data(operators.index(i,0)) } );
}
onCurrentIndexChanged: {
updateGraph();
}
function updateGraph() {
if(examplelabel!=null)
{
app.functionsModel().clear();
view.resetViewport();
view.addFunction(examplelabel.text,app.variables);
}
}
GridLayout {
id: descgrid
columns: 2
Layout.fillWidth: true
Label { text: operators.headerData(0,Qt.Horizontal) } Label { id: namelabel; text: operators.data(operators.index(chosebox.currentIndex,0)) }
Label { text: operators.headerData(1,Qt.Horizontal) } Label { id: desclabel; text: operators.data(operators.index(chosebox.currentIndex,1)) }
Label { text: operators.headerData(2,Qt.Horizontal) } Label { id: paramslabel; text: operators.data(operators.index(chosebox.currentIndex,2)) }
Label { text: operators.headerData(3,Qt.Horizontal) } Label { id: examplelabel; text: operators.data(operators.index(chosebox.currentIndex,3)) }
onCurrentIndexChanged: {
updateGraph();
}
}
GridLayout {
id: descgrid
columns: 2
Layout.fillWidth: true
Label { text: operators.headerData(0,Qt.Horizontal) } Label { id: namelabel; text: operators.data(operators.index(chosebox.currentIndex,0)) }
Label { text: operators.headerData(1,Qt.Horizontal) } Label { id: desclabel; text: operators.data(operators.index(chosebox.currentIndex,1)) }
Label { text: operators.headerData(2,Qt.Horizontal) } Label { id: paramslabel; text: operators.data(operators.index(chosebox.currentIndex,2)) }
Label { text: operators.headerData(3,Qt.Horizontal) } Label { id: examplelabel; text: operators.data(operators.index(chosebox.currentIndex,3)) }
}
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment