mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-11-28 05:11:04 -07:00
Update Printer application to the new style GUI
This commit is contained in:
parent
8e1e37e2eb
commit
1c1371489b
5 changed files with 571 additions and 13 deletions
76
FilePane.qml
Normal file
76
FilePane.qml
Normal file
|
|
@ -0,0 +1,76 @@
|
|||
import QtQuick 2.2
|
||||
import QtQuick.Controls 1.1
|
||||
import QtQuick.Layouts 1.1
|
||||
|
||||
import UM 1.0 as UM
|
||||
|
||||
Rectangle {
|
||||
id: base;
|
||||
|
||||
signal requestOpenFile();
|
||||
signal openFile(url file);
|
||||
|
||||
function setDirectory(file)
|
||||
{
|
||||
UM.Models.directoryListModel.directory = file
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
anchors.fill: parent;
|
||||
anchors.margins: UM.Theme.defaultMargin;
|
||||
|
||||
Button { text: "Open File"; iconSource: UM.Resources.getIcon("open.png"); Layout.fillWidth: true; onClicked: base.requestOpenFile(); }
|
||||
|
||||
Rectangle {
|
||||
Layout.fillWidth: true;
|
||||
Layout.fillHeight: true;
|
||||
border.width: 1;
|
||||
border.color: "#aaa";
|
||||
|
||||
ScrollView {
|
||||
anchors.fill: parent;
|
||||
anchors.margins: 1;
|
||||
|
||||
ListView {
|
||||
id: listView;
|
||||
model: UM.Models.directoryListModel;
|
||||
delegate: listDelegate;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ToolButton {
|
||||
anchors.horizontalCenter: parent.horizontalCenter;
|
||||
iconSource: UM.Resources.getIcon('expand.png');
|
||||
}
|
||||
}
|
||||
|
||||
Component {
|
||||
id: listDelegate;
|
||||
Rectangle {
|
||||
id: item;
|
||||
|
||||
anchors.left: parent.left;
|
||||
anchors.right: parent.right;
|
||||
|
||||
height: 40;
|
||||
|
||||
color: mouseArea.pressed ? "#f00" : index % 2 ? "#eee" : "#fff";
|
||||
|
||||
Label {
|
||||
anchors.verticalCenter: parent.verticalCenter;
|
||||
anchors.left: parent.left;
|
||||
anchors.leftMargin: UM.Theme.defaultMargin;
|
||||
|
||||
text: model.name;
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
id: mouseArea;
|
||||
anchors.fill: parent;
|
||||
|
||||
onClicked: base.openFile(model.url);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue