This commit is contained in:
Tim Kuipers 2015-06-16 14:43:57 +02:00
commit a321bd588b
16 changed files with 543 additions and 146 deletions

View file

@ -3,7 +3,6 @@
import QtQuick 2.2
import QtQuick.Controls 1.1
import QtQuick.Layouts 1.1
import QtQuick.Window 2.1
import UM 1.0 as UM
@ -12,48 +11,53 @@ UM.Dialog {
id: base
//: About dialog title
title: qsTr("About Cura");
title: qsTr("About Cura")
minimumWidth: 400
minimumHeight: 300
ColumnLayout {
anchors.fill: parent;
Image {
id: logo
width: parent.width * 0.75
height: width * (1/4.25)
Item {
Layout.fillWidth: true;
Layout.fillHeight: true;
}
source: UM.Theme.images.logo
Image {
Layout.alignment: Qt.AlignHCenter;
Layout.preferredWidth: parent.width * 0.75;
Layout.preferredHeight: width * (1/4.25);
sourceSize.width: width
sourceSize.height: height
anchors.centerIn: parent
anchors.verticalCenterOffset : -(height * 0.5)
}
source: UM.Theme.images.logo;
Label {
id: version
sourceSize.width: width;
sourceSize.height: height;
}
text: "Cura 15.06 Beta"
font: UM.Theme.fonts.large
anchors.horizontalCenter : logo.horizontalCenter
anchors.horizontalCenterOffset : (logo.width * 0.25)
anchors.top: logo.bottom
anchors.topMargin : 5
}
Label {
Layout.alignment: Qt.AlignHCenter;
Label {
id: description
width: parent.width
text: "Cura 15.06 Beta";
font: UM.Theme.fonts.large;
}
//: About dialog application description
text: qsTr("End-to-end solution for fused filament 3D printing.")
wrapMode: Text.WordWrap
anchors.top: version.bottom
anchors.topMargin : 10
}
Label {
//: About dialog application description
text: qsTr("End-to-end solution for fused filament 3D printing.")
}
Label {
id: author_note
width: parent.width
Label {
//: About dialog application author note
text: qsTr("Cura has been developed by Ultimaker B.V. in cooperation with the community.")
}
Item {
Layout.fillWidth: true;
Layout.fillHeight: true;
}
//: About dialog application author note
text: qsTr("Cura has been developed by Ultimaker B.V. in cooperation with the community.")
wrapMode: Text.WordWrap
anchors.top: description.bottom
}
rightButtons: Button {

View file

@ -25,6 +25,7 @@ UM.MainWindow {
window: base
Menu {
id: fileMenu
//: File menu
title: qsTr("&File");
@ -33,6 +34,19 @@ UM.MainWindow {
MenuSeparator { }
Instantiator {
model: Printer.recentFiles
MenuItem {
property url filePath: modelData;
text: (index + 1) + ". " + modelData.slice(modelData.lastIndexOf("/") + 1);
onTriggered: UM.MeshFileHandler.readLocalFile(filePath);
}
onObjectAdded: fileMenu.insertItem(index, object)
onObjectRemoved: fileMenu.removeItem(object)
}
MenuSeparator { }
MenuItem { action: actions.quit; }
}
@ -178,8 +192,8 @@ UM.MainWindow {
id: openFileButton;
iconSource: UM.Theme.icons.open;
style: UM.Theme.styles.tool_button;
style: UM.Backend.progress < 0 ? UM.Theme.styles.open_file_button : UM.Theme.styles.tool_button;
tooltip: '';
anchors {
top: parent.top;
topMargin: UM.Theme.sizes.window_margin.height;
@ -218,7 +232,7 @@ UM.MainWindow {
iconSource: UM.Theme.icons.viewmode;
style: UM.Theme.styles.tool_button;
tooltip: '';
menu: Menu {
id: viewMenu;
Instantiator {
@ -419,3 +433,4 @@ UM.MainWindow {
Component.onCompleted: UM.Theme.load(UM.Resources.getPath(UM.Resources.ThemesLocation, "cura"))
}

View file

@ -1,6 +1,13 @@
// Copyright (c) 2015 Ultimaker B.V.
// Cura is released under the terms of the AGPLv3 or higher.
import QtQuick 2.0
import QtQuick.Controls 1.2
import UM 1.0 as UM
UM.SettingView { }
UM.SettingView {
expandedCategories: Printer.expandedCategories;
onExpandedCategoriesChanged: Printer.setExpandedCategories(expandedCategories);
}

View file

@ -47,7 +47,6 @@ Item {
Button {
text: model.name;
iconSource: UM.Theme.icons[model.icon];
tooltip: model.description;
checkable: true;
checked: model.active;

View file

@ -1,6 +1,6 @@
{
"id": "ultimaker_original_plus",
"name": "Ultimaker Original Plus",
"name": "Ultimaker Original+",
"icon": "icon_ultimaker.png",
"platform": "ultimaker2_platform.obj",
"platform_texture": "UltimakerPlusbackplate.png",

View file

@ -35,47 +35,42 @@ QtObject {
}
}
property Component tool_button: Component {
property Component open_file_button: Component {
ButtonStyle {
background: UM.AngledCornerRectangle {
property bool down: control.pressed || (control.checkable && control.checked);
background: Item {
implicitWidth: UM.Theme.sizes.button.width;
implicitHeight: UM.Theme.sizes.button.height;
color: {
if(!control.enabled) {
return UM.Theme.colors.button_disabled;
} else if(control.checkable && control.checked && control.hovered) {
return UM.Theme.colors.button_active_hover;
} else if(control.pressed || (control.checkable && control.checked)) {
return UM.Theme.colors.button_active;
} else if(control.hovered) {
return UM.Theme.colors.button_hover;
} else {
return UM.Theme.colors.button;
}
}
Behavior on color { ColorAnimation { duration: 50; } }
cornerSize: UM.Theme.sizes.default_margin.width;
Rectangle {
anchors.bottom: parent.top;
anchors.bottom: parent.verticalCenter;
width: parent.width;
height: control.hovered ? label.height : 0;
Behavior on height { NumberAnimation { duration: 75; } }
height: control.hovered ? parent.height / 2 + label.height : 0;
Behavior on height { NumberAnimation { duration: 100; } }
opacity: control.hovered ? 1.0 : 0.0;
Behavior on opacity { NumberAnimation { duration: 75; } }
Behavior on opacity { NumberAnimation { duration: 100; } }
Label {
id: label
id: label;
anchors.horizontalCenter: parent.horizontalCenter;
text: control.text;
text: control.text.replace("&", "");
font: UM.Theme.fonts.button_tooltip;
color: UM.Theme.colors.button_tooltip_text;
}
}
UM.AngledCornerRectangle {
anchors.fill: parent;
color: {
if(control.hovered) {
return UM.Theme.colors.button_active_hover;
} else {
return UM.Theme.colors.button_active;
}
}
Behavior on color { ColorAnimation { duration: 50; } }
cornerSize: UM.Theme.sizes.default_margin.width;
}
}
label: Item {
@ -92,6 +87,113 @@ QtObject {
}
}
property Component tool_button: Component {
ButtonStyle {
background: Item {
implicitWidth: UM.Theme.sizes.button.width;
implicitHeight: UM.Theme.sizes.button.height;
Rectangle {
anchors.bottom: parent.verticalCenter;
width: parent.width;
height: control.hovered ? parent.height / 2 + label.height : 0;
Behavior on height { NumberAnimation { duration: 100; } }
opacity: control.hovered ? 1.0 : 0.0;
Behavior on opacity { NumberAnimation { duration: 100; } }
Label {
id: label
anchors.horizontalCenter: parent.horizontalCenter;
text: control.text.replace("&", "");
font: UM.Theme.fonts.button_tooltip;
color: UM.Theme.colors.button_tooltip_text;
}
}
UM.AngledCornerRectangle {
id: buttonFace;
anchors.fill: parent;
property bool down: control.pressed || (control.checkable && control.checked);
color: {
if(!control.enabled) {
return UM.Theme.colors.button_disabled;
} else if(control.checkable && control.checked && control.hovered) {
return UM.Theme.colors.button_active_hover;
} else if(control.pressed || (control.checkable && control.checked)) {
return UM.Theme.colors.button_active;
} else if(control.hovered) {
return UM.Theme.colors.button_hover;
} else {
return UM.Theme.colors.button;
}
}
Behavior on color { ColorAnimation { duration: 50; } }
cornerSize: UM.Theme.sizes.default_margin.width;
}
}
label: Item {
Image {
anchors.centerIn: parent;
source: control.iconSource;
width: UM.Theme.sizes.button_icon.width;
height: UM.Theme.sizes.button_icon.height;
sourceSize: UM.Theme.sizes.button_icon;
}
}
}
}
property Component progressbar: Component{
ProgressBarStyle {
background: UM.AngledCornerRectangle {
anchors.fill: parent
anchors.left: parent.left
implicitWidth: UM.Theme.sizes.progressbar.width
implicitHeight: UM.Theme.sizes.progressbar.height
color: "transparent"
}
progress: UM.AngledCornerRectangle {
anchors.left: parent.left
anchors.fill: parent
cornerSize: UM.Theme.sizes.progressbar_control.height
color: UM.Theme.colors.progressbar_background
Item {
anchors.fill: parent
anchors.margins: UM.Theme.sizes.progressbar_margin.width
visible: control.indeterminate
Row {
Repeater {
UM.AngledCornerRectangle {
cornerSize: UM.Theme.sizes.progressbar_control.height
color: UM.Theme.colors.progressbar_control
width: UM.Theme.sizes.progressbar_control.width
height: UM.Theme.sizes.progressbar_control.height
}
model: 1
}
SequentialAnimation on x {
id: xAnim
property int animEndPoint: UM.Theme.sizes.progressbar.width - UM.Theme.sizes.progressbar_control.width
running: control.indeterminate
loops: Animation.Infinite
NumberAnimation { from: 0; to: xAnim.animEndPoint; duration: 2000;}
NumberAnimation { from: xAnim.animEndPoint; to: 0; duration: 2000;}
}
}
}
}
}
}
property Component sidebar_category: Component {
ButtonStyle {
background: UM.AngledCornerRectangle {

View file

@ -52,15 +52,15 @@
"border": [205, 202, 201, 255],
"secondary": [205, 202, 201, 255],
"text": [174, 174, 174, 255],
"text_inactive": [205, 202, 201, 255],
"text": [140, 144, 154, 255],
"text_inactive": [174, 174, 174, 255],
"text_hover": [35, 35, 35, 255],
"text_pressed": [12, 169, 227, 255],
"button": [205, 202, 201, 255],
"button_hover": [174, 174, 174, 255],
"button": [160, 163, 171, 255],
"button_hover": [140, 144, 154, 255],
"button_active": [12, 169, 227, 255],
"button_active_hover": [34, 150, 190, 255],
"button_active_hover": [34, 150, 199, 255],
"button_text": [255, 255, 255, 255],
"button_disabled": [245, 245, 245, 255],
"button_tooltip_text": [35, 35, 35, 255],
@ -77,7 +77,7 @@
"setting_category_active_hover": [34, 150, 190, 255],
"setting_category_text": [255, 255, 255, 255],
"setting_label": [174, 174, 174, 255],
"setting_label": [140, 144, 154, 255],
"setting_control": [255, 255, 255, 255],
"setting_control_highlight": [245, 245, 245, 255],
"setting_control_border": [174, 174, 174, 255],
@ -88,6 +88,9 @@
"setting_validation_warning": [255, 186, 15, 255],
"setting_validation_ok": [255, 255, 255, 255],
"progressbar_background": [245, 245, 245, 255],
"progressbar_control": [12, 169, 227, 255],
"slider_groove": [245, 245, 245, 255],
"slider_groove_border": [205, 202, 201, 255],
"slider_groove_fill": [205, 202, 201, 255],
@ -98,7 +101,7 @@
"checkbox_hover": [245, 245, 245, 255],
"checkbox_border": [174, 174, 174, 255],
"checkbox_mark": [35, 35, 35, 255],
"checkbox_text": [174, 174, 174, 255],
"checkbox_text": [140, 144, 154, 255],
"tooltip": [255, 225, 146, 255],
@ -133,7 +136,11 @@
"setting_unit_margin": [0.5, 0.5],
"button": [4.25, 4.25],
"button_icon": [3.57, 3.57],
"button_icon": [2.9, 2.9],
"progressbar": [26.0, 0.5],
"progressbar_control": [8.0, 0.5],
"progressbar_padding": [0.0, 1.0],
"scrollbar": [0.5, 0.5],