Merge branch '2.1'

* 2.1: (60 commits)
  Fix documentation of XRayView class and add a note about RenderPass ctor
  Uranium -> Cura and drop some unused code
  Update XRayView to render properly
  Render Convex Hull below 0 to avoid z fighting artifacts
  Render the grid a bit below 0, so we avoid some z fighting artifacts
  Add a working X-Ray view
  Remove commented out code
  Update with the changed default for backface culling
  Fix convex hull and layer view rendering
  Default Cura to SolidView, not MeshView
  Add SolidView plugin, which is what used to be Uranium's MeshView
  Fix ConvexHullNode so it renders
  Update BuildVolume and ConvexHullNode to use new API
  Remove setLightPosition call
  Revert "Displays settings based on whether they are global-only or not"
  Revert "Adds a global-only role to the SettingOverrideModel"
  Tweak Setting Category header size
  Add warning to PerObjectSettingsPanel when Print Sequence is set to All at Once
  Fix PerObjectSettingsPanel layout
  Remove Print Speed setting from simple mode
  ...
This commit is contained in:
Arjen Hiemstra 2015-12-14 14:05:51 +01:00
commit 379ba357cf
39 changed files with 1813 additions and 4374 deletions

View File

@ -12,6 +12,9 @@ from UM.Math.Color import Color
from UM.Math.AxisAlignedBox import AxisAlignedBox
from UM.Math.Polygon import Polygon
from UM.View.RenderBatch import RenderBatch
from UM.View.GL.OpenGL import OpenGL
import numpy
class BuildVolume(SceneNode):
@ -24,10 +27,10 @@ class BuildVolume(SceneNode):
self._height = 0
self._depth = 0
self._material = None
self._shader = None
self._grid_mesh = None
self._grid_material = None
self._grid_shader = None
self._disallowed_areas = []
self._disallowed_area_mesh = None
@ -61,22 +64,14 @@ class BuildVolume(SceneNode):
if not self.getMeshData():
return True
if not self._material:
self._material = renderer.createMaterial(
Resources.getPath(Resources.Shaders, "basic.vert"),
Resources.getPath(Resources.Shaders, "vertexcolor.frag")
)
self._grid_material = renderer.createMaterial(
Resources.getPath(Resources.Shaders, "basic.vert"),
Resources.getPath(Resources.Shaders, "grid.frag")
)
self._grid_material.setUniformValue("u_gridColor0", Color(245, 245, 245, 255))
self._grid_material.setUniformValue("u_gridColor1", Color(205, 202, 201, 255))
if not self._shader:
self._shader = OpenGL.getInstance().createShaderProgram(Resources.getPath(Resources.Shaders, "default.shader"))
self._grid_shader = OpenGL.getInstance().createShaderProgram(Resources.getPath(Resources.Shaders, "grid.shader"))
renderer.queueNode(self, material = self._material, mode = Renderer.RenderLines)
renderer.queueNode(self, mesh = self._grid_mesh, material = self._grid_material, force_single_sided = True)
renderer.queueNode(self, mode = RenderBatch.RenderMode.Lines)
renderer.queueNode(self, mesh = self._grid_mesh, shader = self._grid_shader, backface_cull = True)
if self._disallowed_area_mesh:
renderer.queueNode(self, mesh = self._disallowed_area_mesh, material = self._material, transparent = True)
renderer.queueNode(self, mesh = self._disallowed_area_mesh, shader = self._shader, transparent = True, backface_cull = True, sort = -9)
return True
def rebuild(self):
@ -111,17 +106,17 @@ class BuildVolume(SceneNode):
mb = MeshBuilder()
mb.addQuad(
Vector(min_w, min_h, min_d),
Vector(max_w, min_h, min_d),
Vector(max_w, min_h, max_d),
Vector(min_w, min_h, max_d)
Vector(min_w, min_h - 0.2, min_d),
Vector(max_w, min_h - 0.2, min_d),
Vector(max_w, min_h - 0.2, max_d),
Vector(min_w, min_h - 0.2, max_d)
)
self._grid_mesh = mb.getData()
for n in range(0, 6):
v = self._grid_mesh.getVertex(n)
self._grid_mesh.setVertexUVCoordinates(n, v[0], v[2])
disallowed_area_height = 0.2
disallowed_area_height = 0.1
disallowed_area_size = 0
if self._disallowed_areas:
mb = MeshBuilder()

View File

@ -7,6 +7,8 @@ from UM.Math.Color import Color
from UM.Math.Vector import Vector
from UM.Mesh.MeshData import MeshData
from UM.View.GL.OpenGL import OpenGL
import numpy
class ConvexHullNode(SceneNode):
@ -15,14 +17,14 @@ class ConvexHullNode(SceneNode):
self.setCalculateBoundingBox(False)
self._material = None
self._shader = None
self._original_parent = parent
self._inherit_orientation = False
self._inherit_scale = False
self._color = Color(35, 35, 35, 0.5)
self._color = Color(35, 35, 35, 128)
self._node = node
self._node.transformationChanged.connect(self._onNodePositionChanged)
@ -44,11 +46,11 @@ class ConvexHullNode(SceneNode):
mesh = MeshData()
if len(hull_points) > 3:
center = (hull_points.min(0) + hull_points.max(0)) / 2.0
mesh.addVertex(center[0], 0.1, center[1])
mesh.addVertex(center[0], -0.1, center[1])
else:
return None
for point in hull_points:
mesh.addVertex(point[0], 0.1, point[1])
mesh.addVertex(point[0], -0.1, point[1])
indices = []
for i in range(len(hull_points) - 1):
indices.append([0, i + 1, i + 2])
@ -62,14 +64,14 @@ class ConvexHullNode(SceneNode):
return self._node
def render(self, renderer):
if not self._material:
self._material = renderer.createMaterial(Resources.getPath(Resources.Shaders, "basic.vert"), Resources.getPath(Resources.Shaders, "color.frag"))
if not self._shader:
self._shader = OpenGL.getInstance().createShaderProgram(Resources.getPath(Resources.Shaders, "default.shader"))
self._shader.setUniformValue("u_color", self._color)
if self.getParent():
self._material.setUniformValue("u_color", self._color)
renderer.queueNode(self, material = self._material, transparent = True)
renderer.queueNode(self, transparent = True, shader = self._shader, backface_cull = True, sort = -8)
if self._convex_hull_head_mesh:
renderer.queueNode(self, material = self._material,transparent = True, mesh = self._convex_hull_head_mesh)
renderer.queueNode(self, shader = self._shader, transparent = True, mesh = self._convex_hull_head_mesh, backface_cull = True, sort = -8)
return True

View File

@ -10,6 +10,7 @@ from UM.Scene.Platform import Platform
from UM.Math.Vector import Vector
from UM.Math.Matrix import Matrix
from UM.Math.Quaternion import Quaternion
from UM.Math.AxisAlignedBox import AxisAlignedBox
from UM.Resources import Resources
from UM.Scene.ToolHandle import ToolHandle
from UM.Scene.Iterator.DepthFirstIterator import DepthFirstIterator
@ -97,6 +98,7 @@ class CuraApplication(QtApplication):
self._i18n_catalog = None
self._previous_active_tool = None
self._platform_activity = False
self._scene_boundingbox = AxisAlignedBox()
self._job_name = None
self.getMachineManager().activeMachineInstanceChanged.connect(self._onActiveMachineChanged)
@ -156,7 +158,7 @@ class CuraApplication(QtApplication):
controller = self.getController()
controller.setActiveView("MeshView")
controller.setActiveView("SolidView")
controller.setCameraTool("CameraTool")
controller.setSelectionTool("SelectionTool")
@ -171,7 +173,6 @@ class CuraApplication(QtApplication):
self._volume = BuildVolume.BuildVolume(root)
self.getRenderer().setLightPosition(Vector(0, 150, 0))
self.getRenderer().setBackgroundColor(QColor(245, 245, 245))
self._physics = PlatformPhysics.PlatformPhysics(controller, self._volume)
@ -240,18 +241,29 @@ class CuraApplication(QtApplication):
requestAddPrinter = pyqtSignal()
activityChanged = pyqtSignal()
sceneBoundingBoxChanged = pyqtSignal()
@pyqtProperty(bool, notify = activityChanged)
def getPlatformActivity(self):
return self._platform_activity
@pyqtProperty(str, notify = sceneBoundingBoxChanged)
def getSceneBoundingBoxString(self):
return self._i18n_catalog.i18nc("@info", "%.1f x %.1f x %.1f mm") % (self._scene_boundingbox.width.item(), self._scene_boundingbox.depth.item(), self._scene_boundingbox.height.item())
def updatePlatformActivity(self, node = None):
count = 0
scene_boundingbox = AxisAlignedBox()
for node in DepthFirstIterator(self.getController().getScene().getRoot()):
if type(node) is not SceneNode or not node.getMeshData():
continue
count += 1
scene_boundingbox += node.getBoundingBox()
if repr(self._scene_boundingbox) != repr(scene_boundingbox):
self._scene_boundingbox = scene_boundingbox
self.sceneBoundingBoxChanged.emit()
self._platform_activity = True if count > 0 else False
self.activityChanged.emit()

View File

@ -19,10 +19,10 @@ class CuraSplashScreen(QSplashScreen):
version = Application.getInstance().getVersion().split("-")
painter.setFont(QFont("Roboto", 20))
painter.setFont(QFont("Proxima Nova Rg", 20))
painter.drawText(0, 0, 203, 230, Qt.AlignRight | Qt.AlignBottom, version[0])
if len(version) > 1:
painter.setFont(QFont("Roboto", 12))
painter.setFont(QFont("Proxima Nova Rg", 12))
painter.drawText(0, 0, 203, 255, Qt.AlignRight | Qt.AlignBottom, version[1])
painter.restore()

View File

@ -134,11 +134,11 @@ class CuraEngineBackend(Backend):
return #No slicing if we have error values since those are by definition illegal values.
self.processingProgress.emit(0.0)
if not self._message:
self._message = Message(catalog.i18nc("@info:status", "Slicing..."), 0, False, -1)
self._message.show()
else:
if self._message:
self._message.setProgress(-1)
#else:
# self._message = Message(catalog.i18nc("@info:status", "Slicing..."), 0, False, -1)
# self._message.show()
self._scene.gcode_list = []
self._slicing = True

View File

@ -11,6 +11,9 @@ from UM.Scene.Selection import Selection
from UM.Math.Color import Color
from UM.Mesh.MeshData import MeshData
from UM.View.RenderBatch import RenderBatch
from UM.View.GL.OpenGL import OpenGL
from cura.ConvexHullNode import ConvexHullNode
from PyQt5 import QtCore, QtWidgets
@ -21,7 +24,8 @@ from . import LayerViewProxy
class LayerView(View):
def __init__(self):
super().__init__()
self._material = None
self._shader = None
self._selection_shader = None
self._num_layers = 0
self._layer_percentage = 0 # what percentage of layers need to be shown (SLider gives value between 0 - 100)
self._proxy = LayerViewProxy.LayerViewProxy()
@ -53,14 +57,10 @@ class LayerView(View):
def beginRendering(self):
scene = self.getController().getScene()
renderer = self.getRenderer()
renderer.setRenderSelection(False)
if not self._material:
self._material = renderer.createMaterial(Resources.getPath(Resources.Shaders, "basic.vert"), Resources.getPath(Resources.Shaders, "vertexcolor.frag"))
self._material.setUniformValue("u_color", [1.0, 0.0, 0.0, 1.0])
self._selection_material = renderer.createMaterial(Resources.getPath(Resources.Shaders, "basic.vert"), Resources.getPath(Resources.Shaders, "color.frag"))
self._selection_material.setUniformValue("u_color", Color(35, 35, 35, 128))
if not self._selection_shader:
self._selection_shader = OpenGL.getInstance().createShaderProgram(Resources.getPath(Resources.Shaders, "default.shader"))
self._selection_shader.setUniformValue("u_color", Color(32, 32, 32, 128))
for node in DepthFirstIterator(scene.getRoot()):
# We do not want to render ConvexHullNode as it conflicts with the bottom layers.
@ -71,7 +71,7 @@ class LayerView(View):
if not node.render(renderer):
if node.getMeshData() and node.isVisible():
if Selection.isSelected(node):
renderer.queueNode(node, material = self._selection_material, transparent = True)
renderer.queueNode(node, transparent = True, shader = self._selection_shader)
layer_data = node.callDecoration("getLayerData")
if not layer_data:
continue
@ -87,7 +87,7 @@ class LayerView(View):
end += counts
# This uses glDrawRangeElements internally to only draw a certain range of lines.
renderer.queueNode(node, mesh = layer_data, material = self._material, mode = Renderer.RenderLines, start = start, end = end)
renderer.queueNode(node, mesh = layer_data, mode = RenderBatch.RenderMode.Lines, range = (start, end))
# We currently recreate the current "solid" layers every time a
if not self._current_layer_mesh:
@ -111,7 +111,7 @@ class LayerView(View):
if self._current_layer_mesh:
self._current_layer_mesh.addColors(layer_mesh.getColors() * brightness)
if self._current_layer_mesh:
renderer.queueNode(node, mesh = self._current_layer_mesh, material = self._material)
renderer.queueNode(node, mesh = self._current_layer_mesh)
if not self._current_layer_jumps:
self._current_layer_jumps = MeshData()
@ -133,7 +133,7 @@ class LayerView(View):
brightness = (2.0 - (i / self._solid_layers)) / 2.0
self._current_layer_jumps.addColors(layer_mesh.getColors() * brightness)
renderer.queueNode(node, mesh = self._current_layer_jumps, material = self._material)
renderer.queueNode(node, mesh = self._current_layer_jumps)
def setLayer(self, value):
if self._current_layer_num != value:
@ -152,31 +152,27 @@ class LayerView(View):
def calculateMaxLayers(self):
scene = self.getController().getScene()
renderer = self.getRenderer()
if renderer and self._material:
self._activity = True
renderer.setRenderSelection(False)
self._old_max_layers = self._max_layers
## Recalculate num max layers
new_max_layers = 0
for node in DepthFirstIterator(scene.getRoot()):
if not node.render(renderer):
if node.getMeshData() and node.isVisible():
layer_data = node.callDecoration("getLayerData")
if not layer_data:
continue
self._activity = True
if new_max_layers < len(layer_data.getLayers()):
new_max_layers = len(layer_data.getLayers()) - 1
self._old_max_layers = self._max_layers
## Recalculate num max layers
new_max_layers = 0
for node in DepthFirstIterator(scene.getRoot()):
layer_data = node.callDecoration("getLayerData")
if not layer_data:
continue
if new_max_layers > 0 and new_max_layers != self._old_max_layers:
self._max_layers = new_max_layers
self.maxLayersChanged.emit()
self._current_layer_num = self._max_layers
if new_max_layers < len(layer_data.getLayers()):
new_max_layers = len(layer_data.getLayers()) - 1
# This makes sure we update the current layer
self.setLayer(int(self._max_layers))
self.currentLayerNumChanged.emit()
if new_max_layers > 0 and new_max_layers != self._old_max_layers:
self._max_layers = new_max_layers
self.maxLayersChanged.emit()
self._current_layer_num = self._max_layers
# This makes sure we update the current layer
self.setLayer(int(self._max_layers))
self.currentLayerNumChanged.emit()
maxLayersChanged = Signal()
currentLayerNumChanged = Signal()

View File

@ -10,16 +10,16 @@ import UM 1.0 as UM
Item
{
width: 250
height: 250
width: UM.Theme.sizes.button.width
height: UM.Theme.sizes.slider_layerview_size.height
Slider
{
id: slider
width: 10
height: 250
anchors.right : parent.right
anchors.rightMargin: UM.Theme.sizes.slider_layerview_margin.width/2
width: UM.Theme.sizes.slider_layerview_size.width
height: UM.Theme.sizes.slider_layerview_size.height
anchors.left: parent.left
anchors.leftMargin: UM.Theme.sizes.slider_layerview_margin.width/2
orientation: Qt.Vertical
minimumValue: 0;
maximumValue: UM.LayerView.numLayers;
@ -31,15 +31,7 @@ Item
style: UM.Theme.styles.layerViewSlider
}
Rectangle {
anchors.right: parent.right
y: -UM.Theme.sizes.slider_layerview_background_extension.height
z: slider.z - 1
width: UM.Theme.sizes.button.width
height: UM.Theme.sizes.slider_layerview_background_extension.height
color: UM.Theme.colors.slider_text_background
}
Rectangle {
anchors.right : parent.right
anchors.left: parent.left
anchors.verticalCenter: parent.verticalCenter
z: slider.z - 1
width: UM.Theme.sizes.slider_layerview_background.width

View File

@ -1,157 +0,0 @@
// Copyright (c) 2015 Ultimaker B.V.
// Uranium is released under the terms of the AGPLv3 or higher.
import QtQuick 2.2
import QtQuick.Controls 1.2
import QtQuick.Controls.Styles 1.2
import QtQuick.Window 2.2
import UM 1.1 as UM
UM.Dialog {
id: settingPickDialog
title: catalog.i18nc("@title:window", "Pick a Setting to Customize")
property var settingCategoriesModel
TextField {
id: filter;
anchors {
top: parent.top;
left: parent.left;
right: parent.right;
}
placeholderText: catalog.i18nc("@label:textbox", "Filter...");
onTextChanged: settingCategoriesModel.filter(text);
}
ScrollView {
id: view;
anchors {
top: filter.bottom;
left: parent.left;
right: parent.right;
bottom: parent.bottom;
}
Column {
width: view.width - UM.Theme.sizes.default_margin.width * 2;
height: childrenRect.height;
Repeater {
id: settingList;
model: settingPickDialog.settingCategoriesModel
delegate: Item {
id: delegateItem;
width: parent.width;
height: childrenRect.height;
ToolButton {
id: categoryHeader;
text: model.name;
checkable: true;
width: parent.width;
onCheckedChanged: settingsColumn.state != "" ? settingsColumn.state = "" : settingsColumn.state = "collapsed";
style: ButtonStyle {
background: Rectangle
{
width: control.width;
height: control.height;
color: control.hovered ? palette.highlight : "transparent";
}
label: Row
{
spacing: UM.Theme.sizes.default_margin.width;
Image
{
anchors.verticalCenter: parent.verticalCenter;
source: control.checked ? UM.Theme.icons.arrow_right : UM.Theme.icons.arrow_bottom;
}
Label
{
text: control.text;
font.bold: true;
color: control.hovered ? palette.highlightedText : palette.text;
}
}
}
}
property variant settingsModel: model.settings;
visible: model.visible;
Column {
id: settingsColumn;
anchors.top: categoryHeader.bottom;
property real childrenHeight:
{
var h = 0.0;
for(var i in children)
{
var item = children[i];
h += children[i].height;
if(item.settingVisible)
{
if(i > 0)
{
h += spacing;
}
}
}
return h;
}
width: childrenRect.width;
height: childrenHeight;
Repeater {
model: delegateItem.settingsModel;
delegate: ToolButton {
id: button;
x: model.depth * UM.Theme.sizes.default_margin.width;
text: model.name
tooltip: model.description;
onClicked: {
var object_id = UM.ActiveTool.properties.Model.getItem(base.currentIndex).id;
UM.ActiveTool.properties.Model.addSettingOverride(object_id, model.key);
settingPickDialog.visible = false;
}
states: State {
name: "filtered"
when: model.filtered || !model.visible || !model.enabled || model.global_only
PropertyChanges { target: button; height: 0; opacity: 0; }
}
}
}
states: State {
name: "collapsed";
PropertyChanges { target: settingsColumn; opacity: 0; height: 0; }
}
}
}
}
}
}
rightButtons: [
Button {
text: catalog.i18nc("@action:button", "Cancel");
onClicked: {
settingPickDialog.visible = false;
}
}
]
}

View File

@ -10,136 +10,85 @@ import UM 1.1 as UM
Item {
id: base;
property int currentIndex: UM.ActiveTool.properties.SelectedIndex;
property string printSequence: UM.ActiveTool.properties.PrintSequence;
width: 0;
height: 0;
width: childrenRect.width;
height: childrenRect.height;
property variant position: mapToItem(null, 0, 0)
property var settingOverrideModel: UM.ActiveTool.properties.Model.getItem(base.currentIndex).settings
Column {
id: items
anchors.top: parent.top;
anchors.left: parent.left;
property real viewportWidth: UM.Application.mainWindow.width * UM.Application.mainWindow.viewportRect.width;
property real viewportHeight: UM.Application.mainWindow.height * UM.Application.mainWindow.viewportRect.height;
spacing: UM.Theme.sizes.default_margin.height;
property int currentIndex;
onSettingOverrideModelChanged:{
console.log(UM.ActiveTool.properties.Model.getItem(base.currentIndex).settings)
// UM.ActiveTool.properties.Model.getItem(base.currentIndex).settings.refresh()
// if (UM.ActiveTool.properties.Model.getItem(base.currentIndex).settings == undefined){
//
// }
}
Rectangle {
id: settingsPanel;
z: 3;
width: UM.Theme.sizes.per_object_settings_panel.width;
height: items.height + UM.Theme.sizes.default_margin.height * 2;
opacity: 0;
Behavior on opacity { NumberAnimation { } }
border.width: UM.Theme.sizes.per_object_settings_panel_border.width;
border.color: UM.Theme.colors.per_object_settings_panel_border;
color: UM.Theme.colors.per_object_settings_panel_background;
DropArea {
anchors.fill: parent;
Label {
width: UM.Theme.sizes.setting.width;
wrapMode: Text.Wrap;
text: catalog.i18nc("@label", "Per Object Settings behavior may be unexpected when 'Print sequence' is set to 'All at Once'.")
color: UM.Theme.colors.text;
visible: base.printSequence == "all_at_once"
}
Button {
id: closeButton;
width: UM.Theme.sizes.message_close.width;
height: UM.Theme.sizes.message_close.height;
anchors {
right: parent.right;
rightMargin: UM.Theme.sizes.default_margin.width / 2;
top: parent.top;
topMargin: UM.Theme.sizes.default_margin.width / 2;
}
UM.RecolorImage {
anchors.fill: parent;
sourceSize.width: width
sourceSize.height: width
color: UM.Theme.colors.message_dismiss
source: UM.Theme.icons.cross2;
}
onClicked: settingsPanel.opacity = 0
UM.SettingItem {
id: profileSelection
style: ButtonStyle {
background: Rectangle {
color: UM.Theme.colors.message_background
}
width: UM.Theme.sizes.setting.width;
height: UM.Theme.sizes.setting.height;
name: catalog.i18nc("@label", "Object profile")
type: "enum"
indent: false
style: UM.Theme.styles.setting_item;
options: UM.ProfilesModel { addUseGlobal: true }
value: UM.ActiveTool.properties.Model.getItem(base.currentIndex).profile
onItemValueChanged: {
var item = UM.ActiveTool.properties.Model.getItem(base.currentIndex);
UM.ActiveTool.properties.Model.setObjectProfile(item.id, value)
}
}
Column {
id: items
anchors.top: parent.top;
anchors.topMargin: UM.Theme.sizes.default_margin.height;
id: customisedSettings
spacing: UM.Theme.sizes.default_lining.height;
UM.SettingItem {
id: profileSelection
x: UM.Theme.sizes.per_object_settings_panel_border.width + 1
width: UM.Theme.sizes.setting.width;
height: UM.Theme.sizes.setting.height;
name: catalog.i18nc("@label", "Profile")
type: "enum"
style: UM.Theme.styles.setting_item;
options: UM.ProfilesModel { addUseGlobal: true }
value: UM.ActiveTool.properties.Model.getItem(base.currentIndex).profile
onItemValueChanged: {
var item = UM.ActiveTool.properties.Model.getItem(base.currentIndex);
UM.ActiveTool.properties.Model.setObjectProfile(item.id, value)
}
}
width: UM.Theme.sizes.setting.width + UM.Theme.sizes.setting.height/2;
Repeater {
id: settings;
model: base.settingOverrideModel
model: UM.ActiveTool.properties.Model.getItem(base.currentIndex).settings
UM.SettingItem {
width: UM.Theme.sizes.setting.width;
height: UM.Theme.sizes.setting.height;
x: UM.Theme.sizes.per_object_settings_panel_border.width + 1
name: model.label;
visible: !model.global_only;
type: model.type;
value: model.value;
description: model.description;
unit: model.unit;
valid: model.valid;
options: model.options;
options: model.options
indent: false
style: UM.Theme.styles.setting_item;
onItemValueChanged: {
settings.model.setSettingValue(model.key, value)
base.settingOverrideModel = UM.ActiveTool.properties.Model.getItem(base.currentIndex).settings
}
Button
{
anchors.left: parent.horizontalCenter;
anchors.leftMargin: UM.Theme.sizes.default_margin.width;
anchors.left: parent.right;
width: UM.Theme.sizes.setting.height;
height: UM.Theme.sizes.setting.height;
opacity: parent.hovered || hovered ? 1 : 0;
onClicked: UM.ActiveTool.properties.Model.removeSettingOverride(UM.ActiveTool.properties.Model.getItem(base.currentIndex).id, model.key)
style: ButtonStyle
@ -163,83 +112,16 @@ Item {
}
}
}
Item
{
height: UM.Theme.sizes.default_margin.height / 2
width: parent.width
}
Button
{
id: customise_settings_button;
anchors.right: profileSelection.right;
visible: parseInt(UM.Preferences.getValue("cura/active_mode")) == 1
text: catalog.i18nc("@action:button", "Customize Settings");
style: ButtonStyle
{
background: Rectangle
{
width: control.width;
height: control.height;
color: control.hovered ? UM.Theme.colors.load_save_button_hover : UM.Theme.colors.load_save_button;
}
label: Label
{
text: control.text;
color: UM.Theme.colors.load_save_button_text;
}
}
onClicked: {
settingPickDialog.settingCategoriesModel.reload()
settingPickDialog.visible = true;
}
Connections
{
target: UM.Preferences;
onPreferenceChanged:
{
customise_settings_button.visible = parseInt(UM.Preferences.getValue("cura/active_mode"))
}
}
}
}
UM.I18nCatalog { id: catalog; name: "uranium"; }
}
Button
{
id: customise_settings_button;
anchors.right: profileSelection.right;
height: UM.Theme.sizes.setting.height;
visible: parseInt(UM.Preferences.getValue("cura/active_mode")) == 1
Repeater {
model: UM.ActiveTool.properties.Model;
delegate: Button {
x: ((model.x + 1.0) / 2.0) * base.viewportWidth - base.position.x - width / 2
y: -((model.y + 1.0) / 2.0) * base.viewportHeight + (base.viewportHeight - base.position.y) + height / 2
width: UM.Theme.sizes.per_object_settings_button.width
height: UM.Theme.sizes.per_object_settings_button.height
tooltip: catalog.i18nc("@info:tooltip", "Customise settings for this object");
checkable: true;
onClicked: {
if(settingsPanel.opacity < 0.5) //Per-object panel is not currently displayed.
{
base.currentIndex = index;
settingsPanel.anchors.left = right;
settingsPanel.anchors.top = top;
settingsPanel.opacity = 1;
}
else //Per-object panel is already displayed. Deactivate it (same behaviour as the close button).
{
settingsPanel.opacity = 0;
}
}
text: catalog.i18nc("@action:button", "Add Setting");
style: ButtonStyle
{
@ -247,31 +129,183 @@ Item {
{
width: control.width;
height: control.height;
color: control.hovered ? UM.Theme.colors.button_active : UM.Theme.colors.button_hover;
border.width: UM.Theme.sizes.default_lining.width;
border.color: control.pressed ? UM.Theme.colors.action_button_active_border :
control.hovered ? UM.Theme.colors.action_button_hovered_border : UM.Theme.colors.action_button_border
color: control.pressed ? UM.Theme.colors.action_button_active :
control.hovered ? UM.Theme.colors.action_button_hovered : UM.Theme.colors.action_button
}
label: Image {
width: control.width;
height: control.height;
sourceSize.width: width;
sourceSize.height: height;
source: UM.Theme.icons.plus;
label: Label
{
text: control.text;
color: UM.Theme.colors.setting_control_text;
anchors.centerIn: parent
}
}
onClicked: settingPickDialog.visible = true;
Connections
{
target: UM.Preferences;
onPreferenceChanged:
{
customise_settings_button.visible = parseInt(UM.Preferences.getValue("cura/active_mode"))
}
}
}
}
PerObjectSettingsDialog{
UM.I18nCatalog { id: catalog; name: "uranium"; }
UM.Dialog {
id: settingPickDialog
settingCategoriesModel: UM.SettingCategoriesModel { id: settingCategoriesModel; }
onVisibilityChanged:{
if (settingPickDialog.visibility == false){
base.settingOverrideModel = UM.ActiveTool.properties.Model.getItem(base.currentIndex).settings
title: catalog.i18nc("@title:window", "Pick a Setting to Customize")
TextField {
id: filter;
anchors {
top: parent.top;
left: parent.left;
right: parent.right;
}
placeholderText: catalog.i18nc("@label:textbox", "Filter...");
onTextChanged: settingCategoriesModel.filter(text);
}
ScrollView {
id: view;
anchors {
top: filter.bottom;
left: parent.left;
right: parent.right;
bottom: parent.bottom;
}
Column {
width: view.width - UM.Theme.sizes.default_margin.width * 2;
height: childrenRect.height;
Repeater {
id: settingList;
model: UM.SettingCategoriesModel { id: settingCategoriesModel; }
delegate: Item {
id: delegateItem;
width: parent.width;
height: childrenRect.height;
ToolButton {
id: categoryHeader;
text: model.name;
checkable: true;
width: parent.width;
onCheckedChanged: settingsColumn.state != "" ? settingsColumn.state = "" : settingsColumn.state = "collapsed";
style: ButtonStyle {
background: Rectangle
{
width: control.width;
height: control.height;
color: control.hovered ? palette.highlight : "transparent";
}
label: Row
{
spacing: UM.Theme.sizes.default_margin.width;
Image
{
anchors.verticalCenter: parent.verticalCenter;
source: control.checked ? UM.Theme.icons.arrow_right : UM.Theme.icons.arrow_bottom;
}
Label
{
text: control.text;
font.bold: true;
color: control.hovered ? palette.highlightedText : palette.text;
}
}
}
}
property variant settingsModel: model.settings;
visible: model.visible;
Column {
id: settingsColumn;
anchors.top: categoryHeader.bottom;
property real childrenHeight:
{
var h = 0.0;
for(var i in children)
{
var item = children[i];
h += children[i].height;
if(item.settingVisible)
{
if(i > 0)
{
h += spacing;
}
}
}
return h;
}
width: childrenRect.width;
height: childrenHeight;
Repeater {
model: delegateItem.settingsModel;
delegate: ToolButton {
id: button;
x: model.depth * UM.Theme.sizes.default_margin.width;
text: model.name;
tooltip: model.description;
onClicked: {
var object_id = UM.ActiveTool.properties.Model.getItem(base.currentIndex).id;
UM.ActiveTool.properties.Model.addSettingOverride(object_id, model.key);
settingPickDialog.visible = false;
}
states: State {
name: "filtered"
when: model.filtered || !model.visible || !model.enabled
PropertyChanges { target: button; height: 0; opacity: 0; }
}
}
}
states: State {
name: "collapsed";
PropertyChanges { target: settingsColumn; opacity: 0; height: 0; }
}
}
}
}
}
}
}
rightButtons: [
Button {
text: catalog.i18nc("@action:button", "Cancel");
onClicked: {
settingPickDialog.visible = false;
}
}
]
}
SystemPalette { id: palette; }
}

View File

@ -2,6 +2,8 @@
# Uranium is released under the terms of the AGPLv3 or higher.
from UM.Tool import Tool
from UM.Scene.Selection import Selection
from UM.Application import Application
from . import PerObjectSettingsModel
@ -9,10 +11,19 @@ class PerObjectSettingsTool(Tool):
def __init__(self):
super().__init__()
self.setExposedProperties("Model")
self.setExposedProperties("Model", "SelectedIndex", "PrintSequence")
def event(self, event):
return False
def getModel(self):
return PerObjectSettingsModel.PerObjectSettingsModel()
def getSelectedIndex(self):
selected_object_id = id(Selection.getSelectedObject(0))
index = self.getModel().find("id", selected_object_id)
return index
def getPrintSequence(self):
settings = Application.getInstance().getMachineManager().getActiveProfile()
return settings.getSettingValue("print_sequence")

View File

@ -1,7 +1,7 @@
# Copyright (c) 2015 Ultimaker B.V.
# Uranium is released under the terms of the AGPLv3 or higher.
from PyQt5.QtCore import Qt, pyqtSlot, QUrl, pyqtSignal
from PyQt5.QtCore import Qt, pyqtSlot, QUrl
from UM.Application import Application
from UM.Qt.ListModel import ListModel
@ -18,7 +18,6 @@ class SettingOverrideModel(ListModel):
OptionsRole = Qt.UserRole + 8
WarningDescriptionRole = Qt.UserRole + 9
ErrorDescriptionRole = Qt.UserRole + 10
GlobalOnlyRole = Qt.UserRole + 11
def __init__(self, node, parent = None):
super().__init__(parent)
@ -39,7 +38,6 @@ class SettingOverrideModel(ListModel):
self.addRoleName(self.OptionsRole, "options")
self.addRoleName(self.WarningDescriptionRole, "warning_description")
self.addRoleName(self.ErrorDescriptionRole, "error_description")
self.addRoleName(self.GlobalOnlyRole, "global_only")
@pyqtSlot(str, "QVariant")
def setSettingValue(self, key, value):
@ -52,6 +50,7 @@ class SettingOverrideModel(ListModel):
if not self._node.getDecorator(SettingOverrideDecorator):
self.clear()
return
self._decorator = self._node.getDecorator(SettingOverrideDecorator)
self._decorator.settingAdded.connect(self._onSettingsChanged)
self._decorator.settingRemoved.connect(self._onSettingsChanged)
@ -69,20 +68,6 @@ class SettingOverrideModel(ListModel):
model.appendItem({"value": str(value), "name": str(name)})
return model
@pyqtSlot()
def reload(self):
self.clear()
#if self._machine_instance:
#for category in self._machine_instance.getMachineDefinition().getAllCategories():
#self.appendItem({
#"id": category.getKey(),
#"name": category.getLabel(),
#"icon": category.getIcon(),
#"visible": category.isVisible(),
#"settings": SettingsFromCategoryModel.SettingsFromCategoryModel(category),
#"hiddenValuesCount": category.getHiddenValuesCount()
#})
def _onSettingsChanged(self):
self.clear()
@ -99,9 +84,9 @@ class SettingOverrideModel(ListModel):
"valid": setting.validate(value),
"options": self._createOptionsModel(setting.getOptions()),
"warning_description": setting.getWarningDescription(),
"error_description": setting.getErrorDescription(),
"global_only": setting.getGlobalOnly()
"error_description": setting.getErrorDescription()
})
items.sort(key = lambda i: i["key"])
for item in items:

View File

@ -19,7 +19,8 @@ def getMetaData():
"name": i18n_catalog.i18nc("@label", "Per Object Settings"),
"description": i18n_catalog.i18nc("@info:tooltip", "Configure Per Object Settings"),
"icon": "setting_per_object",
"tool_panel": "PerObjectSettingsPanel.qml"
"tool_panel": "PerObjectSettingsPanel.qml",
"weight": 3
},
}

View File

@ -0,0 +1,68 @@
# Copyright (c) 2015 Ultimaker B.V.
# Cura is released under the terms of the AGPLv3 or higher.
from UM.View.View import View
from UM.Scene.Iterator.DepthFirstIterator import DepthFirstIterator
from UM.Resources import Resources
from UM.Application import Application
from UM.Math.Color import Color
from UM.Preferences import Preferences
from UM.View.Renderer import Renderer
from UM.View.GL.OpenGL import OpenGL
import math
## Standard view for mesh models.
class SolidView(View):
def __init__(self):
super().__init__()
Preferences.getInstance().addPreference("view/show_overhang", True)
self._enabled_shader = None
self._disabled_shader = None
def beginRendering(self):
scene = self.getController().getScene()
renderer = self.getRenderer()
if not self._enabled_shader:
self._enabled_shader = OpenGL.getInstance().createShaderProgram(Resources.getPath(Resources.Shaders, "overhang.shader"))
if not self._disabled_shader:
self._disabled_shader = OpenGL.getInstance().createShaderProgram(Resources.getPath(Resources.Shaders, "overhang.shader"))
self._disabled_shader.setUniformValue("u_diffuseColor", [0.68, 0.68, 0.68, 1.0])
if Application.getInstance().getMachineManager().getActiveProfile():
profile = Application.getInstance().getMachineManager().getActiveProfile()
if profile.getSettingValue("support_enable") or not Preferences.getInstance().getValue("view/show_overhang"):
angle = profile.getSettingValue("support_angle")
if angle != None:
self._enabled_shader.setUniformValue("u_overhangAngle", math.cos(math.radians(90 - angle)))
else:
self._enabled_shader.setUniformValue("u_overhangAngle", math.cos(math.radians(0)))
for node in DepthFirstIterator(scene.getRoot()):
if not node.render(renderer):
if node.getMeshData() and node.isVisible():
# TODO: Find a better way to handle this
#if node.getBoundingBoxMesh():
# renderer.queueNode(scene.getRoot(), mesh = node.getBoundingBoxMesh(),mode = Renderer.RenderLines)
if hasattr(node, "_outside_buildarea"):
if node._outside_buildarea:
renderer.queueNode(node, shader = self._disabled_shader)
else:
renderer.queueNode(node, shader = self._enabled_shader)
else:
renderer.queueNode(node, material = self._enabled_shader)
if node.callDecoration("isGroup"):
renderer.queueNode(scene.getRoot(), mesh = node.getBoundingBoxMesh(),mode = Renderer.RenderLines)
def endRendering(self):
pass
#def _onPreferenceChanged(self, preference):
#if preference == "view/show_overhang": ## Todo: This a printer only setting. Should be removed from Uranium.
#self._enabled_material = None

View File

@ -0,0 +1,24 @@
# Copyright (c) 2015 Ultimaker B.V.
# Cura is released under the terms of the AGPLv3 or higher.
from . import SolidView
from UM.i18n import i18nCatalog
i18n_catalog = i18nCatalog("cura")
def getMetaData():
return {
"plugin": {
"name": i18n_catalog.i18nc("@label", "Solid View"),
"author": "Ultimaker",
"version": "1.0",
"decription": i18n_catalog.i18nc("@info:whatsthis", "Provides a normal solid mesh view."),
"api": 2
},
"view": {
"name": i18n_catalog.i18nc("@item:inmenu", "Solid")
}
}
def register(app):
return { "view": SolidView.SolidView() }

View File

@ -0,0 +1,39 @@
# Copyright (c) 2015 Ultimaker B.V.
# Cura is released under the terms of the AGPLv3 or higher.
import os.path
from UM.Application import Application
from UM.PluginRegistry import PluginRegistry
from UM.View.RenderPass import RenderPass
from UM.View.RenderBatch import RenderBatch
from UM.View.GL.OpenGL import OpenGL
from UM.Scene.SceneNode import SceneNode
from UM.Scene.Iterator.DepthFirstIterator import DepthFirstIterator
class XRayPass(RenderPass):
def __init__(self, width, height):
super().__init__("xray", width, height)
self._shader = None
self._gl = OpenGL.getInstance().getBindingsObject()
self._scene = Application.getInstance().getController().getScene()
def render(self):
if not self._shader:
self._shader = OpenGL.getInstance().createShaderProgram(os.path.join(PluginRegistry.getInstance().getPluginPath("XRayView"), "xray.shader"))
batch = RenderBatch(self._shader, type = RenderBatch.RenderType.NoType, backface_cull = False, blend_mode = RenderBatch.BlendMode.Additive)
for node in DepthFirstIterator(self._scene.getRoot()):
if type(node) is SceneNode and node.getMeshData() and node.isVisible():
batch.addItem(node.getWorldTransformation(), node.getMeshData())
self.bind()
self._gl.glDisable(self._gl.GL_DEPTH_TEST)
batch.render(self._scene.getActiveCamera())
self._gl.glEnable(self._gl.GL_DEPTH_TEST)
self.release()

View File

@ -0,0 +1,72 @@
# Copyright (c) 2015 Ultimaker B.V.
# Cura is released under the terms of the AGPLv3 or higher.
import os.path
from UM.PluginRegistry import PluginRegistry
from UM.Event import Event
from UM.View.View import View
from UM.Scene.Iterator.BreadthFirstIterator import BreadthFirstIterator
from UM.View.RenderBatch import RenderBatch
from UM.View.GL.OpenGL import OpenGL
from . import XRayPass
## View used to display a see-through version of objects with errors highlighted.
class XRayView(View):
def __init__(self):
super().__init__()
self._xray_shader = None
self._xray_pass = None
self._xray_composite_shader = None
self._composite_pass = None
self._old_composite_shader = None
self._old_layer_bindings = None
def beginRendering(self):
scene = self.getController().getScene()
renderer = self.getRenderer()
if not self._xray_shader:
self._xray_shader = OpenGL.getInstance().createShaderProgram(os.path.join(PluginRegistry.getInstance().getPluginPath("XRayView"), "xray.shader"))
self._xray_shader.setUniformValue("u_color", [0.1, 0.1, 0.2, 1.0])
for node in BreadthFirstIterator(scene.getRoot()):
if not node.render(renderer):
if node.getMeshData() and node.isVisible():
renderer.queueNode(node,
shader = self._xray_shader,
type = RenderBatch.RenderType.Solid,
blend_mode = RenderBatch.BlendMode.Additive,
sort = -10,
state_setup_callback = lambda gl: gl.glDepthFunc(gl.GL_ALWAYS),
state_teardown_callback = lambda gl: gl.glDepthFunc(gl.GL_LESS)
)
def endRendering(self):
pass
def event(self, event):
if event.type == Event.ViewActivateEvent:
if not self._xray_pass:
# Currently the RenderPass constructor requires a size > 0
# This should be fixed in RenderPass's constructor.
self._xray_pass = XRayPass.XRayPass(1, 1)
self.getRenderer().addRenderPass(self._xray_pass)
if not self._xray_composite_shader:
self._xray_composite_shader = OpenGL.getInstance().createShaderProgram(os.path.join(PluginRegistry.getInstance().getPluginPath("XRayView"), "xray_composite.shader"))
if not self._composite_pass:
self._composite_pass = self.getRenderer().getRenderPass("composite")
self._old_layer_bindings = self._composite_pass.getLayerBindings()
self._composite_pass.setLayerBindings(["default", "selection", "xray"])
self._old_composite_shader = self._composite_pass.getCompositeShader()
self._composite_pass.setCompositeShader(self._xray_composite_shader)
if event.type == Event.ViewDeactivateEvent:
self._composite_pass.setLayerBindings(self._old_layer_bindings)
self._composite_pass.setCompositeShader(self._old_composite_shader)

View File

@ -0,0 +1,24 @@
# Copyright (c) 2015 Ultimaker B.V.
# Cura is released under the terms of the AGPLv3 or higher.
from . import XRayView
from UM.i18n import i18nCatalog
catalog = i18nCatalog("cura")
def getMetaData():
return {
"plugin": {
"name": catalog.i18nc("@label", "X-Ray View"),
"author": "Ultimaker",
"version": "1.0",
"description": catalog.i18nc("@info:whatsthis", "Provides the X-Ray view."),
"api": 2
},
"view": {
"name": catalog.i18nc("@item:inlistbox", "X-Ray")
}
}
def register(app):
return { "view": XRayView.XRayView() }

View File

@ -0,0 +1,27 @@
[shaders]
vertex =
uniform highp mat4 u_modelViewProjectionMatrix;
attribute highp vec4 a_vertex;
void main()
{
gl_Position = u_modelViewProjectionMatrix * a_vertex;
}
fragment =
uniform lowp vec4 u_color;
void main()
{
gl_FragColor = u_color;
}
[defaults]
u_color = [0.02, 0.02, 0.02, 1.0]
[bindings]
u_modelViewProjectionMatrix = model_view_projection_matrix
[attributes]
a_vertex = vertex

View File

@ -0,0 +1,75 @@
[shaders]
vertex =
uniform highp mat4 u_modelViewProjectionMatrix;
attribute highp vec4 a_vertex;
attribute highp vec2 a_uvs;
varying highp vec2 v_uvs;
void main()
{
gl_Position = u_modelViewProjectionMatrix * a_vertex;
v_uvs = a_uvs;
}
fragment =
uniform sampler2D u_layer0;
uniform sampler2D u_layer1;
uniform sampler2D u_layer2;
uniform sampler2D u_layer3;
uniform float u_imageWidth;
uniform float u_imageHeight;
uniform vec2 u_offset[9];
uniform float u_outline_strength;
uniform vec4 u_outline_color;
uniform vec4 u_error_color;
varying vec2 v_uvs;
float kernel[9];
void main()
{
kernel[0] = 0.0; kernel[1] = 1.0; kernel[2] = 0.0;
kernel[3] = 1.0; kernel[4] = -4.0; kernel[5] = 1.0;
kernel[6] = 0.0; kernel[7] = 1.0; kernel[8] = 0.0;
vec4 result = vec4(0.965, 0.965, 0.965, 1.0);
vec4 layer0 = texture2D(u_layer0, v_uvs);
result = layer0 * layer0.a + result * (1.0 - layer0.a);
float intersection_count = (texture2D(u_layer2, v_uvs).r * 255.0) / 5.0;
if(mod(intersection_count, 2.0) == 1.0)
{
result = u_error_color;
}
vec4 sum = vec4(0.0);
for (int i = 0; i < 9; i++)
{
vec4 color = vec4(texture2D(u_layer1, v_uvs.xy + u_offset[i]).a);
sum += color * (kernel[i] / u_outline_strength);
}
gl_FragColor = mix(result, vec4(abs(sum.a)) * u_outline_color, abs(sum.a));
}
[defaults]
u_layer0 = 0
u_layer1 = 1
u_layer2 = 2
u_layer3 = 3
u_outline_strength = 1.0
u_outline_color = [0.05, 0.66, 0.89, 1.0]
u_error_color = [1.0, 0.0, 0.0, 1.0]
[bindings]
[attributes]
a_vertex = vertex
a_uvs = uv

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 20 KiB

View File

@ -310,14 +310,24 @@ UM.MainWindow
}
}
JobSpecs
{
anchors
{
bottom: parent.bottom;
right: sidebar.left;
bottomMargin: UM.Theme.sizes.default_margin.height;
rightMargin: UM.Theme.sizes.default_margin.width;
}
}
UM.MessageStack
{
anchors
{
horizontalCenter: parent.horizontalCenter
horizontalCenterOffset: -(UM.Theme.sizes.logo.width/ 2)
top: parent.verticalCenter;
bottom: parent.bottom;
horizontalCenterOffset: -(UM.Theme.sizes.sidebar.width/ 2)
verticalCenter: parent.verticalCenter;
}
}
@ -330,8 +340,7 @@ UM.MainWindow
//anchors.bottom: parent.bottom
anchors.top: viewModeButton.bottom
anchors.topMargin: UM.Theme.sizes.default_margin.height;
anchors.right: sidebar.left;
anchors.rightMargin: UM.Theme.sizes.window_margin.width;
anchors.left: viewModeButton.left;
//anchors.bottom: buttons.top;
//anchors.bottomMargin: UM.Theme.sizes.default_margin.height;
@ -344,10 +353,9 @@ UM.MainWindow
{
id: openFileButton;
//style: UM.Backend.progress < 0 ? UM.Theme.styles.open_file_button : UM.Theme.styles.tool_button;
//style: UM.Theme.styles.open_file_button
text: catalog.i18nc("@action:button","Open File");
iconSource: UM.Theme.icons.load
style: UM.Theme.styles.open_file_button
style: UM.Theme.styles.tool_button
tooltip: '';
anchors
{
@ -373,6 +381,7 @@ UM.MainWindow
source: UM.Theme.images.logo;
width: UM.Theme.sizes.logo.width;
height: UM.Theme.sizes.logo.height;
z: -1;
sourceSize.width: width;
sourceSize.height: height;
@ -381,13 +390,12 @@ UM.MainWindow
Button
{
id: viewModeButton
property bool verticalTooltip: true
anchors
{
top: parent.top;
right: sidebar.left;
rightMargin: UM.Theme.sizes.window_margin.width;
top: toolbar.bottom;
topMargin: UM.Theme.sizes.window_margin.height;
left: parent.left;
}
text: catalog.i18nc("@action:button","View Mode");
iconSource: UM.Theme.icons.viewmode;
@ -422,12 +430,9 @@ UM.MainWindow
id: toolbar;
anchors {
left: parent.left
top: parent.top
topMargin: UM.Theme.sizes.window_margin.height + UM.Theme.sizes.button.height
//horizontalCenter: parent.horizontalCenter
//horizontalCenterOffset: -(UM.Theme.sizes.sidebar.width / 2)
//top: parent.top;
top: openFileButton.bottom;
topMargin: UM.Theme.sizes.window_margin.height;
left: parent.left;
}
}
@ -629,7 +634,7 @@ UM.MainWindow
id: openDialog;
//: File open dialog title
title: catalog.i18nc("@title:window","Open File")
title: catalog.i18nc("@title:window","Open file")
modality: UM.Application.platform == "linux" ? Qt.NonModal : Qt.WindowModal;
//TODO: Support multiple file selection, workaround bug in KDE file dialog
//selectMultiple: true

165
resources/qml/JobSpecs.qml Normal file
View File

@ -0,0 +1,165 @@
// Copyright (c) 2015 Ultimaker B.V.
// Cura is released under the terms of the AGPLv3 or higher.
import QtQuick 2.2
import QtQuick.Controls 1.1
import QtQuick.Controls.Styles 1.1
import QtQuick.Layouts 1.1
import UM 1.1 as UM
Rectangle {
id: base;
property bool activity: Printer.getPlatformActivity;
property string fileBaseName
property variant activeMachineInstance: UM.MachineManager.activeMachineInstance
onActiveMachineInstanceChanged:
{
base.createFileName()
}
UM.I18nCatalog { id: catalog; name:"cura"}
property variant printDuration: PrintInformation.currentPrintTime;
property real printMaterialAmount: PrintInformation.materialAmount;
width: UM.Theme.sizes.jobspecs.width
height: childrenRect.height
color: "transparent"
function createFileName(){
var splitMachineName = UM.MachineManager.activeMachineInstance.split(" ")
var abbrMachine = ''
for (var i = 0; i < splitMachineName.length; i++){
if (splitMachineName[i].search(/ultimaker/i) != -1){
abbrMachine += 'UM'
}
else{
if (splitMachineName[i].charAt(0).search(/[0-9]/g) == -1)
abbrMachine += splitMachineName[i].charAt(0)
}
var regExpAdditives = /[0-9\+]/g;
var resultAdditives = splitMachineName[i].match(regExpAdditives);
if (resultAdditives != null){
for (var j = 0; j < resultAdditives.length; j++){
abbrMachine += resultAdditives[j]
}
}
}
printJobTextfield.text = abbrMachine + '_' + base.fileBaseName
}
Connections {
target: openDialog
onHasMesh: {
if(base.fileBaseName == ''){
base.fileBaseName = name
base.createFileName()
}
}
}
onActivityChanged: {
if (activity == false){
base.fileBaseName = ''
base.createFileName()
}
}
TextField {
id: printJobTextfield
anchors.right: parent.right
height: UM.Theme.sizes.jobspecs_line.height
width: base.width
property int unremovableSpacing: 5
text: ''
horizontalAlignment: TextInput.AlignRight
onTextChanged: Printer.setJobName(text)
visible: base.activity
onEditingFinished: {
if (printJobTextfield.text != ''){
printJobTextfield.focus = false
}
}
validator: RegExpValidator {
regExp: /^[^\\ \/ \.]*$/
}
style: TextFieldStyle{
textColor: UM.Theme.colors.setting_control_text;
font: UM.Theme.fonts.default;
background: Rectangle {
opacity: 0
border.width: 0
}
}
}
Label{
id: boundingSpec
anchors.top: printJobTextfield.bottom
anchors.right: parent.right
height: UM.Theme.sizes.jobspecs_line.height
verticalAlignment: Text.AlignVCenter
font: UM.Theme.fonts.small
color: UM.Theme.colors.text_subtext
text: Printer.getSceneBoundingBoxString
}
Rectangle {
id: specsRow
anchors.top: boundingSpec.bottom
anchors.right: parent.right
height: UM.Theme.sizes.jobspecs_line.height
Item{
width: parent.width
height: parent.height
UM.RecolorImage {
id: timeIcon
anchors.right: timeSpec.left
anchors.rightMargin: UM.Theme.sizes.default_margin.width/2
anchors.verticalCenter: parent.verticalCenter
width: UM.Theme.sizes.save_button_specs_icons.width
height: UM.Theme.sizes.save_button_specs_icons.height
sourceSize.width: width
sourceSize.height: width
color: UM.Theme.colors.text_subtext
source: UM.Theme.icons.print_time;
}
Label{
id: timeSpec
anchors.right: lengthIcon.left
anchors.rightMargin: UM.Theme.sizes.default_margin.width
anchors.verticalCenter: parent.verticalCenter
font: UM.Theme.fonts.small
color: UM.Theme.colors.text_subtext
text: (!base.printDuration || !base.printDuration.valid) ? "00h 00min" : base.printDuration.getDisplayString(UM.DurationFormat.Short)
}
UM.RecolorImage {
id: lengthIcon
anchors.right: lengthSpec.left
anchors.rightMargin: UM.Theme.sizes.default_margin.width/2
anchors.verticalCenter: parent.verticalCenter
width: UM.Theme.sizes.save_button_specs_icons.width
height: UM.Theme.sizes.save_button_specs_icons.height
sourceSize.width: width
sourceSize.height: width
color: UM.Theme.colors.text_subtext
source: UM.Theme.icons.category_material;
}
Label{
id: lengthSpec
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
font: UM.Theme.fonts.small
color: UM.Theme.colors.text_subtext
text: base.printMaterialAmount <= 0 ? "0.0 m" : catalog.i18nc("@label %1 is length of filament","%1 m").arg(base.printMaterialAmount)
}
}
}
}

View File

@ -81,7 +81,7 @@ Item{
text: catalog.i18nc("@label","Global Profile:");
width: parent.width/100*45
font: UM.Theme.fonts.default;
color: UM.Theme.colors.text_default;
color: UM.Theme.colors.text;
}

View File

@ -10,187 +10,71 @@ import UM 1.1 as UM
Rectangle {
id: base;
UM.I18nCatalog { id: catalog; name:"cura"}
property real progress: UM.Backend.progress;
property bool activity: Printer.getPlatformActivity;
Behavior on progress { NumberAnimation { duration: 250; } }
property int totalHeight: childrenRect.height
//Behavior on progress { NumberAnimation { duration: 250; } }
property int totalHeight: childrenRect.height + UM.Theme.sizes.default_margin.height
property string fileBaseName
property variant activeMachineInstance: UM.MachineManager.activeMachineInstance
onActiveMachineInstanceChanged:
{
base.createFileName()
}
UM.I18nCatalog { id: catalog; name:"cura"}
property variant printDuration: PrintInformation.currentPrintTime;
property real printMaterialAmount: PrintInformation.materialAmount;
function createFileName(){
var splitMachineName = UM.MachineManager.activeMachineInstance.split(" ")
var abbrMachine = ''
for (var i = 0; i < splitMachineName.length; i++){
if (splitMachineName[i].search(/ultimaker/i) != -1){
abbrMachine += 'UM'
}
else{
if (splitMachineName[i].charAt(0).search(/[0-9]/g) == -1)
abbrMachine += splitMachineName[i].charAt(0)
}
var regExpAdditives = /[0-9\+]/g;
var resultAdditives = splitMachineName[i].match(regExpAdditives);
if (resultAdditives != null){
for (var j = 0; j < resultAdditives.length; j++){
abbrMachine += resultAdditives[j]
}
}
}
printJobTextfield.text = abbrMachine + '_' + base.fileBaseName
}
Connections {
target: openDialog
onHasMesh: {
if(base.fileBaseName == ''){
base.fileBaseName = name
base.createFileName()
property string statusText: {
if(progress == 0) {
if(!activity) {
return catalog.i18nc("@label:PrintjobStatus","Please load a 3d model");
} else {
return catalog.i18nc("@label:PrintjobStatus","Preparing to slice...");
}
} else if(base.progress < 0.99) {
return catalog.i18nc("@label:PrintjobStatus","Slicing...");
} else {
return catalog.i18nc("@label:PrintjobStatus","Ready to ") + UM.OutputDeviceManager.activeDeviceShortDescription;
}
}
onActivityChanged: {
if (activity == false){
base.fileBaseName = ''
base.createFileName()
}
Label {
id: statusLabel
width: parent.width - 2 * UM.Theme.sizes.default_margin.width
anchors.top: parent.top
anchors.left: parent.left
anchors.leftMargin: UM.Theme.sizes.default_margin.width
color: UM.Theme.colors.text
font: UM.Theme.fonts.large
text: statusText;
}
Rectangle{
id: printJobRow
implicitWidth: base.width;
implicitHeight: UM.Theme.sizes.save_button_header.height
anchors.top: parent.top
color: UM.Theme.colors.sidebar_header_bar
Label{
id: printJobTextfieldLabel
text: catalog.i18nc("@label:textbox", "Printjob Name");
anchors.left: parent.left
anchors.leftMargin: UM.Theme.sizes.default_margin.width;
anchors.verticalCenter: parent.verticalCenter
font: UM.Theme.fonts.default;
color: UM.Theme.colors.text_white
}
TextField {
id: printJobTextfield
anchors.right: parent.right
anchors.rightMargin: UM.Theme.sizes.default_margin.width;
anchors.verticalCenter: parent.verticalCenter
width: parent.width/100*55
height: UM.Theme.sizes.sidebar_inputFields.height
property int unremovableSpacing: 5
text: ''
onTextChanged: Printer.setJobName(text)
onEditingFinished: {
if (printJobTextfield.text != ''){
printJobTextfield.focus = false
}
}
validator: RegExpValidator {
regExp: /^[^\\ \/ \.]*$/
}
style: TextFieldStyle{
textColor: UM.Theme.colors.setting_control_text;
font: UM.Theme.fonts.default;
background: Rectangle {
radius: 0
implicitWidth: parent.width
implicitHeight: parent.height
border.width: 1;
border.color: UM.Theme.colors.slider_groove_border;
}
}
}
}
id: progressBar
width: parent.width - 2 * UM.Theme.sizes.default_margin.width
height: UM.Theme.sizes.progressbar.height
anchors.top: statusLabel.bottom
anchors.topMargin: UM.Theme.sizes.default_margin.height/4
anchors.left: parent.left
anchors.leftMargin: UM.Theme.sizes.default_margin.width
radius: UM.Theme.sizes.progressbar_radius.width
color: UM.Theme.colors.progressbar_background
Rectangle {
id: specsRow
implicitWidth: base.width
implicitHeight: UM.Theme.sizes.sidebar_specs_bar.height
anchors.top: printJobRow.bottom
visible: base.progress > 0.99 && base.activity == true
Item{
id: time
width: childrenRect.width;
Rectangle{
width: Math.max(parent.width * base.progress)
height: parent.height
anchors.left: parent.left
anchors.leftMargin: UM.Theme.sizes.default_margin.width
anchors.top: parent.top
visible: base.printMaterialAmount > 0 ? true : false
UM.RecolorImage {
id: timeIcon
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left
width: UM.Theme.sizes.save_button_specs_icons.width
height: UM.Theme.sizes.save_button_specs_icons.height
sourceSize.width: width
sourceSize.height: width
color: UM.Theme.colors.text_hover
source: UM.Theme.icons.print_time;
}
Label{
id: timeSpec
anchors.verticalCenter: parent.verticalCenter
anchors.left: timeIcon.right
anchors.leftMargin: UM.Theme.sizes.default_margin.width/2
font: UM.Theme.fonts.default
color: UM.Theme.colors.text
text: (!base.printDuration || !base.printDuration.valid) ? "" : base.printDuration.getDisplayString(UM.DurationFormat.Short)
}
}
Item{
width: parent.width / 100 * 55
height: parent.height
anchors.left: time.right
anchors.leftMargin: UM.Theme.sizes.default_margin.width;
anchors.top: parent.top
visible: base.printMaterialAmount > 0 ? true : false
UM.RecolorImage {
id: lengthIcon
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left
width: UM.Theme.sizes.save_button_specs_icons.width
height: UM.Theme.sizes.save_button_specs_icons.height
sourceSize.width: width
sourceSize.height: width
color: UM.Theme.colors.text_hover
source: UM.Theme.icons.category_material;
}
Label{
id: lengthSpec
anchors.verticalCenter: parent.verticalCenter
anchors.left: lengthIcon.right
anchors.leftMargin: UM.Theme.sizes.default_margin.width/2
font: UM.Theme.fonts.default
color: UM.Theme.colors.text
text: base.printMaterialAmount <= 0 ? "" : catalog.i18nc("@label %1 is length of filament","%1 m").arg(base.printMaterialAmount)
}
color: UM.Theme.colors.progressbar_control
radius: UM.Theme.sizes.progressbar_radius.width
visible: base.progress > 0.99 ? false : true
}
}
Rectangle{
id: saveRow
width: base.width
height: saveToButton.height + (UM.Theme.sizes.default_margin.height / 2) // height + bottomMargin
anchors.top: specsRow.bottom
height: saveToButton.height
anchors.top: progressBar.bottom
anchors.topMargin: UM.Theme.sizes.default_margin.height
anchors.left: parent.left
Button {
id: saveToButton
property int resizedWidth
x: base.width - saveToButton.resizedWidth - UM.Theme.sizes.default_margin.width - UM.Theme.sizes.save_button_save_to_button.height
x: base.width - saveToButton.resizedWidth - UM.Theme.sizes.default_margin.width - UM.Theme.sizes.save_button_save_to_button.height + 3
tooltip: UM.OutputDeviceManager.activeDeviceDescription;
enabled: base.progress > 0.99 && base.activity == true
height: UM.Theme.sizes.save_button_save_to_button.height
@ -206,39 +90,25 @@ Rectangle {
background: Rectangle {
//opacity: control.enabled ? 1.0 : 0.5
//Behavior on opacity { NumberAnimation { duration: 50; } }
color: {
if(!control.enabled){
return UM.Theme.colors.button;
}
else if(control.enabled && control.hovered) {
return UM.Theme.colors.load_save_button_hover
} else {
return UM.Theme.colors.load_save_button
}
}
border.color: !control.enabled ? UM.Theme.colors.action_button_disabled_border :
control.pressed ? UM.Theme.colors.action_button_active_border :
control.hovered ? UM.Theme.colors.action_button_hovered_border : UM.Theme.colors.action_button_border
color: !control.enabled ? UM.Theme.colors.action_button_disabled :
control.pressed ? UM.Theme.colors.action_button_active :
control.hovered ? UM.Theme.colors.action_button_hovered : UM.Theme.colors.action_button
Behavior on color { ColorAnimation { duration: 50; } }
width: {
var w = 0;
if (base.width*0.55 > actualLabel.width + (UM.Theme.sizes.default_margin.width * 2)){
saveToButton.resizedWidth = base.width*0.55
w = base.width*0.55
}
else {
saveToButton.resizedWidth = actualLabel.width + (UM.Theme.sizes.default_margin.width * 2)
w = actualLabel.width + (UM.Theme.sizes.default_margin.width * 2)
}
if(w < base.width * 0.55) {
w = base.width * 0.55;
}
return w;
saveToButton.resizedWidth = actualLabel.width + (UM.Theme.sizes.default_margin.width * 2)
return saveToButton.resizedWidth
}
Label {
id: actualLabel
opacity: control.enabled ? 1.0 : 0.4
//Behavior on opacity { NumberAnimation { duration: 50; } }
anchors.centerIn: parent
color: UM.Theme.colors.load_save_button_text
font: UM.Theme.fonts.default
color: !control.enabled ? UM.Theme.colors.action_button_disabled_text :
control.pressed ? UM.Theme.colors.action_button_active_text :
control.hovered ? UM.Theme.colors.action_button_hovered_text : UM.Theme.colors.action_button_text
font: UM.Theme.fonts.action_button
text: control.text;
}
}
@ -260,16 +130,12 @@ Rectangle {
style: ButtonStyle {
background: Rectangle {
id: deviceSelectionIcon
color: {
if(!control.enabled){
return UM.Theme.colors.button;
}
else if(control.enabled && control.hovered) {
return UM.Theme.colors.load_save_button_hover
} else {
return UM.Theme.colors.load_save_button
}
}
border.color: !control.enabled ? UM.Theme.colors.action_button_disabled_border :
control.pressed ? UM.Theme.colors.action_button_active_border :
control.hovered ? UM.Theme.colors.action_button_hovered_border : UM.Theme.colors.action_button_border
color: !control.enabled ? UM.Theme.colors.action_button_disabled :
control.pressed ? UM.Theme.colors.action_button_active :
control.hovered ? UM.Theme.colors.action_button_hovered : UM.Theme.colors.action_button
Behavior on color { ColorAnimation { duration: 50; } }
anchors.left: parent.left
anchors.leftMargin: UM.Theme.sizes.save_button_text_margin.width / 2;
@ -282,9 +148,11 @@ Rectangle {
width: UM.Theme.sizes.standard_arrow.width
height: UM.Theme.sizes.standard_arrow.height
sourceSize.width: width
sourceSize.height: width
color: UM.Theme.colors.load_save_button_text
source: UM.Theme.icons.arrow_bottom
sourceSize.height: height
color: !control.enabled ? UM.Theme.colors.action_button_disabled_text :
control.pressed ? UM.Theme.colors.action_button_active_text :
control.hovered ? UM.Theme.colors.action_button_hovered_text : UM.Theme.colors.action_button_text;
source: UM.Theme.icons.arrow_bottom;
}
}
label: Label{ }

View File

@ -15,6 +15,7 @@ Rectangle
property Action addMachineAction;
property Action configureMachinesAction;
property Action manageProfilesAction;
property int currentModeIndex;
color: UM.Theme.colors.sidebar;
UM.I18nCatalog { id: catalog; name:"cura"}
@ -49,38 +50,118 @@ Rectangle
addMachineAction: base.addMachineAction;
configureMachinesAction: base.configureMachinesAction;
modesModel: modesListModel;
}
currentModeIndex:
{
var index = parseInt(UM.Preferences.getValue("cura/active_mode"))
if(index)
{
return index;
}
return 0;
}
onCurrentModeIndexChanged: UM.Preferences.setValue("cura/active_mode", currentModeIndex);
Rectangle {
id: headerSeparator
width: parent.width
height: UM.Theme.sizes.sidebar_lining.height
color: UM.Theme.colors.sidebar_lining
anchors.top: header.bottom
anchors.topMargin: UM.Theme.sizes.default_margin.height
}
ProfileSetup {
id: profileItem
manageProfilesAction: base.manageProfilesAction
anchors.top: header.bottom
anchors.top: settingsModeSelection.bottom
anchors.topMargin: UM.Theme.sizes.default_margin.height
width: parent.width
height: totalHeightProfileSetup
}
currentModeIndex:
{
var index = parseInt(UM.Preferences.getValue("cura/active_mode"))
if(index)
{
return index;
}
return 0;
}
onCurrentModeIndexChanged:
{
UM.Preferences.setValue("cura/active_mode", currentModeIndex);
}
Label {
id: settingsModeLabel
text: catalog.i18nc("@label:listbox","Setup");
anchors.left: parent.left
anchors.leftMargin: UM.Theme.sizes.default_margin.width;
anchors.top: headerSeparator.bottom
anchors.topMargin: UM.Theme.sizes.default_margin.height
width: parent.width/100*45
font: UM.Theme.fonts.large;
color: UM.Theme.colors.text
}
Rectangle {
id: settingsModeSelection
width: parent.width/100*55
height: UM.Theme.sizes.sidebar_header_mode_toggle.height
anchors.right: parent.right
anchors.rightMargin: UM.Theme.sizes.default_margin.width
anchors.top: headerSeparator.bottom
anchors.topMargin: UM.Theme.sizes.default_margin.height
Component{
id: wizardDelegate
Button {
height: settingsModeSelection.height
anchors.left: parent.left
anchors.leftMargin: model.index * (settingsModeSelection.width / 2)
anchors.verticalCenter: parent.verticalCenter
width: parent.width / 2
text: model.text
exclusiveGroup: modeMenuGroup;
checkable: true;
checked: base.currentModeIndex == index
onClicked: base.currentModeIndex = index
style: ButtonStyle {
background: Rectangle {
border.color: control.checked ? UM.Theme.colors.toggle_checked_border :
control.pressed ? UM.Theme.colors.toggle_active_border :
control.hovered ? UM.Theme.colors.toggle_hovered_border : UM.Theme.colors.toggle_unchecked_border
color: control.checked ? UM.Theme.colors.toggle_checked :
control.pressed ? UM.Theme.colors.toggle_active :
control.hovered ? UM.Theme.colors.toggle_hovered : UM.Theme.colors.toggle_unchecked
Behavior on color { ColorAnimation { duration: 50; } }
Label {
anchors.centerIn: parent
color: control.checked ? UM.Theme.colors.toggle_checked_text :
control.pressed ? UM.Theme.colors.toggle_active_text :
control.hovered ? UM.Theme.colors.toggle_hovered_text : UM.Theme.colors.toggle_unchecked_text
font: UM.Theme.fonts.default
text: control.text;
}
}
label: Item { }
}
}
}
ExclusiveGroup { id: modeMenuGroup; }
ListView{
id: modesList
property var index: 0
model: modesListModel
delegate: wizardDelegate
anchors.top: parent.top
anchors.left: parent.left
width: parent.width
}
}
Loader
{
id: sidebarContents;
anchors.bottom: saveButton.top
anchors.bottom: footerSeparator.top
anchors.top: profileItem.bottom
anchors.topMargin: UM.Theme.sizes.default_margin.height
anchors.left: base.left
anchors.right: base.right
source: modesListModel.count > header.currentModeIndex ? modesListModel.get(header.currentModeIndex).file : "";
source: modesListModel.count > base.currentModeIndex ? modesListModel.get(base.currentModeIndex).file : "";
property Item sidebar: base;
@ -101,6 +182,15 @@ Rectangle
}
}
Rectangle {
id: footerSeparator
width: parent.width
height: UM.Theme.sizes.sidebar_lining.height
color: UM.Theme.colors.sidebar_lining
anchors.bottom: saveButton.top
anchors.bottomMargin: UM.Theme.sizes.default_margin.height
}
SaveButton
{
id: saveButton;
@ -123,6 +213,6 @@ Rectangle
{
modesListModel.append({ text: catalog.i18nc("@title:tab", "Simple"), file: "SidebarSimple.qml" })
modesListModel.append({ text: catalog.i18nc("@title:tab", "Advanced"), file: "SidebarAdvanced.qml" })
sidebarContents.setSource(modesListModel.get(header.currentModeIndex).file)
sidebarContents.setSource(modesListModel.get(base.currentModeIndex).file)
}
}

View File

@ -11,8 +11,6 @@ Item
{
id: base;
// Machine Setup
property variant modesModel;
property int currentModeIndex: 0;
property Action addMachineAction;
property Action configureMachinesAction;
UM.I18nCatalog { id: catalog; name:"cura"}
@ -21,74 +19,28 @@ Item
Rectangle {
id: settingsModeRow
width: base.width
height: UM.Theme.sizes.sidebar_header.height
height: 0
anchors.top: parent.top
color: UM.Theme.colors.sidebar_header_bar
}
Label{
id: settingsModeLabel
text: catalog.i18nc("@label:listbox","Print Setup");
anchors.left: parent.left
anchors.leftMargin: UM.Theme.sizes.default_margin.width;
anchors.verticalCenter: parent.verticalCenter
width: parent.width/100*45
font: UM.Theme.fonts.default;
color: UM.Theme.colors.text_white
}
Rectangle{
id: settingsModeSelection
width: parent.width/100*55
height: UM.Theme.sizes.sidebar_header_mode_toggle.height
anchors.right: parent.right
anchors.rightMargin: UM.Theme.sizes.default_margin.width;
anchors.verticalCenter: parent.verticalCenter
Component{
id: wizardDelegate
Button {
height: settingsModeSelection.height
anchors.left: parent.left
anchors.leftMargin: model.index * (settingsModeSelection.width / 2)
anchors.verticalCenter: parent.verticalCenter
width: parent.width / 2
text: model.text
exclusiveGroup: modeMenuGroup;
checkable: true;
checked: base.currentModeIndex == index
onClicked: base.currentModeIndex = index
style: ButtonStyle {
background: Rectangle {
color: control.checked ? UM.Theme.colors.toggle_active : UM.Theme.colors.toggle_disabled
Behavior on color { ColorAnimation { duration: 50; } }
Label {
anchors.centerIn: parent
color: control.checked ? UM.Theme.colors.toggle_active_text : UM.Theme.colors.toggle_disabled_text
font: UM.Theme.fonts.default
text: control.text;
}
}
label: Item { }
}
}
}
ExclusiveGroup { id: modeMenuGroup; }
ListView{
id: modesList
property var index: 0
model: base.modesModel
delegate: wizardDelegate
anchors.top: parent.top
anchors.left: parent.left
width: parent.width
}
}
Label{
id: printjobTabLabel
text: catalog.i18nc("@label:listbox","Print Job");
anchors.left: parent.left
anchors.leftMargin: UM.Theme.sizes.default_margin.width;
anchors.top: settingsModeRow.bottom
anchors.topMargin: UM.Theme.sizes.default_margin.height
width: parent.width/100*45
font: UM.Theme.fonts.large;
color: UM.Theme.colors.text
}
Rectangle {
id: machineSelectionRow
width: base.width
height: UM.Theme.sizes.sidebar_setup.height
anchors.top: settingsModeRow.bottom
anchors.top: printjobTabLabel.bottom
anchors.topMargin: UM.Theme.sizes.default_margin.height
anchors.horizontalCenter: parent.horizontalCenter
@ -100,7 +52,7 @@ Item
anchors.leftMargin: UM.Theme.sizes.default_margin.width
anchors.verticalCenter: parent.verticalCenter
font: UM.Theme.fonts.default;
color: UM.Theme.colors.text_default;
color: UM.Theme.colors.text;
}
ToolButton {

View File

@ -13,6 +13,9 @@ Item
id: base;
anchors.fill: parent;
signal showTooltip(Item item, point location, string text);
signal hideTooltip();
property Action configureSettings;
property variant minimumPrintTime: PrintInformation.minimumPrintTime;
property variant maximumPrintTime: PrintInformation.maximumPrintTime;
@ -20,12 +23,110 @@ Item
Component.onCompleted: PrintInformation.enabled = true
Component.onDestruction: PrintInformation.enabled = false
UM.I18nCatalog { id: catalog; name:"cura"}
/*
Rectangle{
id: speedCellLeft
anchors.top: parent.top
anchors.left: parent.left
width: base.width/100*35 - UM.Theme.sizes.default_margin.width
height: childrenRect.height
Label{
id: speedLabel
//: Speed selection label
text: catalog.i18nc("@label","Speed:");
font: UM.Theme.fonts.default;
color: UM.Theme.colors.text;
anchors.top: parent.top
anchors.topMargin: UM.Theme.sizes.default_margin.height
anchors.left: parent.left
anchors.leftMargin: UM.Theme.sizes.default_margin.width
}
}
Rectangle {
id: speedCellRight
anchors.left: speedCellLeft.right
anchors.top: speedCellLeft.top
anchors.topMargin: UM.Theme.sizes.default_margin.height
width: parent.width/100*65 - UM.Theme.sizes.default_margin.width
height: childrenRect.height
CheckBox{
id: normalSpeedCheckBox
property bool hovered_ex: false
anchors.top: parent.top
anchors.left: parent.left
//: Normal speed checkbox
text: catalog.i18nc("@option:check","Normal");
style: UM.Theme.styles.checkbox;
exclusiveGroup: speedCheckBoxGroup
checked: UM.ActiveProfile.valid ? UM.ActiveProfile.settingValues.speed_print <= 60 : true;
MouseArea {
anchors.fill: parent
hoverEnabled: true
onClicked:
{
UM.MachineManager.setSettingValue("speed_print", 60)
}
onEntered:
{
parent.hovered_ex = true
base.showTooltip(normalSpeedCheckBox, Qt.point(-speedCellRight.x, parent.height),
catalog.i18nc("@label", "Use normal printing speed. This will result in high quality prints."));
}
onExited:
{
parent.hovered_ex = false
base.hideTooltip();
}
}
}
CheckBox{
id: highSpeedCheckBox
property bool hovered_ex: false
anchors.top: parent.top
anchors.left: normalSpeedCheckBox.right
anchors.leftMargin: UM.Theme.sizes.default_margin.width
//: High speed checkbox
text: catalog.i18nc("@option:check","Fast");
style: UM.Theme.styles.checkbox;
exclusiveGroup: speedCheckBoxGroup
checked: UM.ActiveProfile.valid ? UM.ActiveProfile.settingValues.speed_print > 60 : true;
MouseArea {
anchors.fill: parent
hoverEnabled: true
onClicked:
{
UM.MachineManager.setSettingValue("speed_print", 100)
}
onEntered:
{
parent.hovered_ex = true
base.showTooltip(normalSpeedCheckBox, Qt.point(-speedCellRight.x, parent.height),
catalog.i18nc("@label", "Use high printing speed. This will reduce printing time, but may affect the quality of the print."));
}
onExited:
{
parent.hovered_ex = false
base.hideTooltip();
}
}
}
ExclusiveGroup { id: speedCheckBoxGroup; }
}
*/
Rectangle{
id: infillCellLeft
anchors.top: parent.top
anchors.left: parent.left
width: base.width/100* 55 - UM.Theme.sizes.default_margin.width
width: base.width/100* 35 - UM.Theme.sizes.default_margin.width
height: childrenRect.height < UM.Theme.sizes.simple_mode_infill_caption.height ? UM.Theme.sizes.simple_mode_infill_caption.height : childrenRect.height
Label{
@ -33,34 +134,34 @@ Item
//: Infill selection label
text: catalog.i18nc("@label","Infill:");
font: UM.Theme.fonts.default;
color: UM.Theme.colors.text_default;
color: UM.Theme.colors.text;
anchors.top: parent.top
anchors.topMargin: UM.Theme.sizes.default_margin.height
anchors.left: parent.left
anchors.leftMargin: UM.Theme.sizes.default_margin.width
}
Label{
/* Label{
id: infillCaption
width: infillCellLeft.width - UM.Theme.sizes.default_margin.width
width: infillCellLeft.width - UM.Theme.sizes.default_margin.width * 2
text: infillModel.count > 0 && infillListView.activeIndex != -1 ? infillModel.get(infillListView.activeIndex).text : ""
font: UM.Theme.fonts.caption
wrapMode: Text.Wrap
color: UM.Theme.colors.text
color: UM.Theme.colors.text_subtext
anchors.top: infillLabel.bottom
anchors.left: parent.left
anchors.leftMargin: UM.Theme.sizes.default_margin.width
}
} */
}
Flow {
id: infillCellRight
height: childrenRect.height;
width: base.width / 100 * 45
width: base.width / 100 * 65
spacing: UM.Theme.sizes.default_margin.width
anchors.right: parent.right
anchors.rightMargin: UM.Theme.sizes.default_margin.width - (UM.Theme.sizes.default_margin.width/4)
anchors.top: parent.top
anchors.left: infillCellLeft.right
anchors.top: infillCellLeft.top
anchors.topMargin: UM.Theme.sizes.default_margin.height
Repeater {
@ -91,28 +192,41 @@ Item
Rectangle{
id: infillIconLining
width: infillCellRight.width / 3 - UM.Theme.sizes.default_margin.width;
width: (infillCellRight.width - 3 * UM.Theme.sizes.default_margin.width) / 4;
height: width
border.color: infillListView.activeIndex == index ? UM.Theme.colors.setting_control_text : UM.Theme.colors.setting_control_border
border.width: infillListView.activeIndex == index ? 2 : 1
color: infillListView.activeIndex == index ? UM.Theme.colors.setting_category_active : "transparent"
border.color: (infillListView.activeIndex == index) ? UM.Theme.colors.setting_control_selected :
(mousearea.containsMouse ? UM.Theme.colors.setting_control_border_highlight : UM.Theme.colors.setting_control_border)
border.width: UM.Theme.sizes.default_lining.width
color: infillListView.activeIndex == index ? UM.Theme.colors.setting_control_selected : "transparent"
Image {
UM.RecolorImage {
id: infillIcon
anchors.fill: parent;
anchors.margins: UM.Theme.sizes.default_margin.width / 2
anchors.margins: UM.Theme.sizes.infill_button_margin.width
sourceSize.width: width
sourceSize.height: width
source: UM.Theme.icons[model.icon];
color: (infillListView.activeIndex == index) ? UM.Theme.colors.text_white : UM.Theme.colors.text
}
MouseArea {
id: mousearea
anchors.fill: parent
hoverEnabled: true
onClicked: {
infillListView.activeIndex = index
UM.MachineManager.setSettingValue("infill_sparse_density", model.percentage)
if (infillListView.activeIndex != index)
{
infillListView.activeIndex = index
UM.MachineManager.setSettingValue("infill_sparse_density", model.percentage)
}
}
onEntered: {
base.showTooltip(infillCellRight, Qt.point(-infillCellRight.x, parent.height), model.text);
}
onExited: {
base.hideTooltip();
}
}
}
@ -132,9 +246,15 @@ Item
Component.onCompleted:
{
infillModel.append({
name: catalog.i18nc("@label", "Sparse"),
name: catalog.i18nc("@label", "Hollow"),
percentage: 0,
text: catalog.i18nc("@label", "No (0%) infill will leave your model hollow at the cost of low strength"),
icon: "hollow"
})
infillModel.append({
name: catalog.i18nc("@label", "Light"),
percentage: 20,
text: catalog.i18nc("@label", "Sparse (20%) infill will give your model an average strength"),
text: catalog.i18nc("@label", "Light (20%) infill will give your model an average strength"),
icon: "sparse"
})
infillModel.append({
@ -158,7 +278,7 @@ Item
anchors.top: infillCellRight.bottom
anchors.topMargin: UM.Theme.sizes.default_margin.height
anchors.left: parent.left
width: parent.width/100*45 - UM.Theme.sizes.default_margin.width
width: parent.width/100*35 - UM.Theme.sizes.default_margin.width
height: childrenRect.height
Label{
@ -167,45 +287,81 @@ Item
//: Helpers selection label
text: catalog.i18nc("@label:listbox","Helpers:");
font: UM.Theme.fonts.default;
color: UM.Theme.colors.text_default;
color: UM.Theme.colors.text;
}
}
Rectangle {
id: helpersCellRight
anchors.top: helpersCellLeft.top
anchors.left: helpersCellLeft.right
width: parent.width/100*55 - UM.Theme.sizes.default_margin.width
width: parent.width/100*65 - UM.Theme.sizes.default_margin.width
height: childrenRect.height
CheckBox{
id: skirtCheckBox
id: brimCheckBox
property bool hovered_ex: false
anchors.top: parent.top
anchors.left: parent.left
//: Setting enable skirt adhesion checkbox
text: catalog.i18nc("@option:check","Enable Skirt Adhesion");
text: catalog.i18nc("@option:check","Generate Brim");
style: UM.Theme.styles.checkbox;
checked: UM.ActiveProfile.valid ? UM.ActiveProfile.settingValues.adhesion_type == "brim" : false;
onClicked:
{
UM.MachineManager.setSettingValue("adhesion_type", "brim")
MouseArea {
anchors.fill: parent
hoverEnabled: true
onClicked:
{
parent.checked = !parent.checked
UM.MachineManager.setSettingValue("adhesion_type", parent.checked?"brim":"skirt")
}
onEntered:
{
parent.hovered_ex = true
base.showTooltip(brimCheckBox, Qt.point(-helpersCellRight.x, parent.height),
catalog.i18nc("@label", "Enable printing a brim. This will add a single-layer-thick flat area around your object which is easy to cut off afterwards."));
}
onExited:
{
parent.hovered_ex = false
base.hideTooltip();
}
}
}
CheckBox{
anchors.top: skirtCheckBox.bottom
id: supportCheckBox
property bool hovered_ex: false
anchors.top: brimCheckBox.bottom
anchors.topMargin: UM.Theme.sizes.default_lining.height
anchors.left: parent.left
//: Setting enable support checkbox
text: catalog.i18nc("@option:check","Enable Support");
text: catalog.i18nc("@option:check","Generate Support Structure");
style: UM.Theme.styles.checkbox;
checked: UM.ActiveProfile.valid ? UM.ActiveProfile.settingValues.support_enable : false;
onClicked:
{
UM.MachineManager.setSettingValue("support_enable", checked)
MouseArea {
anchors.fill: parent
hoverEnabled: true
onClicked:
{
parent.checked = !parent.checked
UM.MachineManager.setSettingValue("support_enable", parent.checked)
}
onEntered:
{
parent.hovered_ex = true
base.showTooltip(supportCheckBox, Qt.point(-helpersCellRight.x, parent.height),
catalog.i18nc("@label", "Enable printing support structures. This will build up supporting structures below the model to prevent the model from sagging or printing in mid air."));
}
onExited:
{
parent.hovered_ex = false
base.hideTooltip();
}
}
}
}

View File

@ -8,13 +8,15 @@ import QtQuick.Layouts 1.1
import UM 1.0 as UM
Rectangle {
UM.PointingRectangle {
id: base;
width: UM.Theme.sizes.tooltip.width;
height: label.height + UM.Theme.sizes.tooltip_margins.height * 2;
color: UM.Theme.colors.tooltip;
arrowSize: UM.Theme.sizes.default_arrow.width
opacity: 0;
Behavior on opacity { NumberAnimation { duration: 100; } }
@ -26,9 +28,10 @@ Rectangle {
y = parent.height - base.height;
} else {
x = position.x - base.width;
y = position.y;
y = position.y - UM.Theme.sizes.tooltip_arrow_margins.height;
}
base.opacity = 1;
target = Qt.point(40 , position.y)
}
function hide() {
@ -47,6 +50,6 @@ Rectangle {
}
wrapMode: Text.Wrap;
font: UM.Theme.fonts.default;
color: UM.Theme.colors.text_default;
color: UM.Theme.colors.tooltip_text;
}
}

View File

@ -20,7 +20,7 @@ Item {
anchors.bottom: parent.bottom;
anchors.left: parent.left;
spacing: UM.Theme.sizes.default_lining.width
spacing: UM.Theme.sizes.button_lining.width
Repeater {
id: repeat
@ -50,20 +50,17 @@ Item {
}
}
Rectangle {
width: base.width
height: base.height
z: parent.z - 1
anchors.verticalCenter: parent.verticalCenter
anchors.horizontalCenter: parent.horizontalCenter
color: UM.Theme.colors.lining
}
Rectangle {
id: panelBackground;
UM.PointingRectangle {
id: panelBorder;
anchors.left: parent.right;
y: base.activeY
anchors.leftMargin: UM.Theme.sizes.default_margin.width;
anchors.top: base.top;
anchors.topMargin: base.activeY
z: buttons.z -1
target: Qt.point(parent.right, base.activeY + UM.Theme.sizes.button.height/2)
arrowSize: UM.Theme.sizes.default_arrow.width
width: {
if (panel.item && panel.width > 0){
@ -78,9 +75,20 @@ Item {
opacity: panel.item ? 1 : 0
Behavior on opacity { NumberAnimation { duration: 100 } }
color: UM.Theme.colors.tool_panel_background;
border.width: UM.Theme.sizes.default_lining.width
border.color: UM.Theme.colors.lining
color: UM.Theme.colors.lining;
//border.width: UM.Theme.sizes.default_lining.width
//border.color: UM.Theme.colors.lining
UM.PointingRectangle {
id: panelBackground;
color: UM.Theme.colors.tool_panel_background;
anchors.fill: parent
anchors.margins: UM.Theme.sizes.default_lining.width
target: Qt.point(-UM.Theme.sizes.default_margin.width, UM.Theme.sizes.button.height/2)
arrowSize: parent.arrowSize
}
Loader {
id: panel

View File

@ -0,0 +1,39 @@
[shaders]
vertex =
uniform highp mat4 u_modelViewProjectionMatrix;
attribute highp vec4 a_vertex;
attribute lowp vec2 a_uvs;
varying lowp vec2 v_uvs;
void main()
{
gl_Position = u_modelViewProjectionMatrix * a_vertex;
v_uvs = a_uvs;
}
fragment =
uniform lowp vec4 u_gridColor0;
uniform lowp vec4 u_gridColor1;
varying lowp vec2 v_uvs;
void main()
{
if (mod(floor(v_uvs.x / 10.0) - floor(v_uvs.y / 10.0), 2.0) < 1.0)
gl_FragColor = u_gridColor0;
else
gl_FragColor = u_gridColor1;
}
[defaults]
u_gridColor0 = [0.96, 0.96, 0.96, 1.0]
u_gridColor1 = [0.8, 0.8, 0.8, 1.0]
[bindings]
u_modelViewProjectionMatrix = model_view_projection_matrix
[attributes]
a_vertex = vertex
a_uvs = uv0

View File

@ -0,0 +1,80 @@
[shaders]
vertex =
uniform highp mat4 u_modelMatrix;
uniform highp mat4 u_viewProjectionMatrix;
uniform highp mat4 u_normalMatrix;
attribute highp vec4 a_vertex;
attribute highp vec4 a_normal;
attribute highp vec2 a_uvs;
varying highp vec3 v_vertex;
varying highp vec3 v_normal;
void main()
{
vec4 world_space_vert = u_modelMatrix * a_vertex;
gl_Position = u_viewProjectionMatrix * world_space_vert;
v_vertex = world_space_vert.xyz;
v_normal = (u_normalMatrix * normalize(a_normal)).xyz;
}
fragment =
uniform mediump vec4 u_ambientColor;
uniform mediump vec4 u_diffuseColor;
uniform mediump vec4 u_specularColor;
uniform highp vec3 u_lightPosition;
uniform mediump float u_shininess;
uniform highp vec3 u_viewPosition;
uniform lowp float u_overhangAngle;
uniform lowp vec4 u_overhangColor;
varying highp vec3 v_vertex;
varying highp vec3 v_normal;
void main()
{
mediump vec4 finalColor = vec4(0.0);
/* Ambient Component */
finalColor += u_ambientColor;
highp vec3 normal = normalize(v_normal);
highp vec3 lightDir = normalize(u_lightPosition - v_vertex);
/* Diffuse Component */
highp float NdotL = clamp(abs(dot(normal, lightDir)), 0.0, 1.0);
finalColor += (NdotL * u_diffuseColor);
/* Specular Component */
/* TODO: We should not do specularity for fragments facing away from the light.*/
highp vec3 reflectedLight = reflect(-lightDir, normal);
highp vec3 viewVector = normalize(u_viewPosition - v_vertex);
highp float NdotR = clamp(dot(viewVector, reflectedLight), 0.0, 1.0);
finalColor += pow(NdotR, u_shininess) * u_specularColor;
finalColor = (-normal.y > u_overhangAngle) ? u_overhangColor : finalColor;
gl_FragColor = finalColor;
gl_FragColor.a = 1.0;
}
[defaults]
u_ambientColor = [0.3, 0.3, 0.3, 1.0]
u_diffuseColor = [1.0, 0.79, 0.14, 1.0]
u_specularColor = [0.4, 0.4, 0.4, 1.0]
u_overhangColor = [1.0, 0.0, 0.0, 1.0]
u_shininess = 20.0
[bindings]
u_modelMatrix = model_matrix
u_viewProjectionMatrix = view_projection_matrix
u_normalMatrix = normal_matrix
u_viewPosition = view_position
u_lightPosition = light_0_position
[attributes]
a_vertex = vertex
a_normal = normal

View File

@ -3,17 +3,12 @@
<svg version="1.2" baseProfile="tiny" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
x="0px" y="0px" viewBox="0 0 30 30" xml:space="preserve">
<g>
<g>
<rect x="0" y="0" width="1.2" height="30"/>
<rect x="28.8" y="0" width="1.2" height="30"/>
<rect x="0" y="28.8" width="30" height="1.2"/>
<rect x="0" y="0" width="30" height="1.2"/>
</g>
<rect x="14.4" y="-5.4" transform="matrix(0.7071 0.7071 -0.7071 0.7071 14.9999 -6.2122)" width="1.2" height="40.8"/>
<polygon points="0.7,10 0.1,8.9 9,0.1 9.8,0.9 "/>
<rect x="24.5" y="19" transform="matrix(0.7071 0.7071 -0.7071 0.7071 25.0689 -10.4098)" width="1.2" height="12.2"/>
<rect x="14.4" y="-5.4" transform="matrix(0.7071 -0.7071 0.7071 0.7071 -6.2136 14.9987)" width="1.2" height="40.8"/>
<polyline points="0.8,20.1 9.6,29 8.8,29.8 0,21 "/>
<rect x="24.5" y="-1.2" transform="matrix(0.7071 -0.7071 0.7071 0.7071 3.8484 19.2136)" width="1.2" height="12.2"/>
<path d="M30,0L30,0L0,0v30h0h30V0z M12.4,28.8L1.2,17.6v-0.2L12.5,6.1l11.4,11.4L12.6,28.8H12.4z M1.2,7l4.4,4.4l-4.4,4.4V7z
M1.2,19.3l4.4,4.4L1.2,28V19.3z M28.8,8.6l-7.4-7.4h7.4L28.8,8.6z M19.8,1.2l4.1,4.1l-5.3,5.3l-5.3-5.3l4.2-4.2H19.8z M15.8,1.2
l-3.3,3.3L9.2,1.2H15.8z M1.2,1.2h6.4l4.2,4.2l-5.3,5.3L1.2,5.4V1.2z M2,28.8l4.4-4.4l4.4,4.4H2z M14.2,28.8l4.4-4.4l4.4,4.4H14.2z
M28.8,28.8h-4.2l-5.2-5.2l5.3-5.3l4.1,4.1V28.8z M28.8,20.8l-3.3-3.3l3.3-3.3V20.8z M24.7,16.7l-5.3-5.3l5.3-5.3l4.1,4.1v2.3
L24.7,16.7z"/>
<rect x="12.7" y="3.3" transform="matrix(0.7071 -0.7071 0.7071 0.7071 -9.0598 14.7879)" width="1.2" height="30"/>
<rect x="15.1" y="-5.1" transform="matrix(0.7071 0.7071 -0.7071 0.7071 14.7286 -6.8835)" width="1.2" height="38.9"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 16.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1"
id="Capa_1" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" sodipodi:docname="check.svg" inkscape:version="0.91 r13725"
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="415.582px"
height="415.582px" viewBox="0 0 415.582 415.582" enable-background="new 0 0 415.582 415.582" xml:space="preserve">
<sodipodi:namedview inkscape:cy="137.35337" inkscape:cx="211.31288" inkscape:zoom="1.61" showgrid="false" guidetolerance="10" gridtolerance="10" objecttolerance="10" bordercolor="#666666" pagecolor="#ffffff" borderopacity="1" id="namedview7" inkscape:current-layer="Capa_1" inkscape:window-maximized="1" inkscape:window-y="27" inkscape:window-x="1440" inkscape:window-height="1134" inkscape:window-width="1920" inkscape:pageopacity="0" inkscape:pageshadow="2">
</sodipodi:namedview>
<circle fill="#231F20" cx="207.791" cy="207.791" r="207.791"/>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 19.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.2" baseProfile="tiny" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
x="0px" y="0px" viewBox="0 0 30 30" xml:space="preserve">
<g>
<g>
<rect x="0" y="0" width="1.2" height="30"/>
<rect x="28.8" y="0" width="1.2" height="30"/>
<rect x="0" y="28.8" width="30" height="1.2"/>
<rect x="0" y="0" width="30" height="1.2"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 540 B

View File

@ -1,14 +1,171 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generator: Adobe Illustrator 19.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.2" baseProfile="tiny" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
x="0px" y="0px" viewBox="0 0 30 30" xml:space="preserve">
<svg version="1.2" baseProfile="tiny" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="-282 405.9 30 30" xml:space="preserve">
<g>
<path d="M30,0L30,0L0,0v30h0h30V0z M12.4,28.8L1.2,17.6v-0.2L12.5,6.1l11.4,11.4L12.6,28.8H12.4z M1.2,7l4.4,4.4l-4.4,4.4V7z
M1.2,19.3l4.4,4.4L1.2,28V19.3z M28.8,8.6l-7.4-7.4h7.4L28.8,8.6z M19.8,1.2l4.1,4.1l-5.3,5.3l-5.3-5.3l4.2-4.2H19.8z M15.8,1.2
l-3.3,3.3L9.2,1.2H15.8z M1.2,1.2h6.4l4.2,4.2l-5.3,5.3L1.2,5.4V1.2z M2,28.8l4.4-4.4l4.4,4.4H2z M14.2,28.8l4.4-4.4l4.4,4.4H14.2z
M28.8,28.8h-4.2l-5.2-5.2l5.3-5.3l4.1,4.1V28.8z M28.8,20.8l-3.3-3.3l3.3-3.3V20.8z M24.7,16.7l-5.3-5.3l5.3-5.3l4.1,4.1v2.3
L24.7,16.7z"/>
<rect x="12.7" y="3.3" transform="matrix(0.7071 -0.7071 0.7071 0.7071 -9.0598 14.7879)" width="1.2" height="30"/>
<rect x="15.1" y="-5.1" transform="matrix(0.7071 0.7071 -0.7071 0.7071 14.7286 -6.8835)" width="1.2" height="38.9"/>
<polygon fill="none" points="-253.2,421.1 -266.8,434.7 -266.4,434.7 -253.2,421.5 "/>
<polygon fill="none" points="-253.2,418.9 -269,434.7 -268.6,434.7 -253.2,419.3 "/>
<polygon fill="none" points="-253.2,423.3 -264.6,434.7 -264.2,434.7 -253.2,423.7 "/>
<polygon fill="none" points="-253.2,425.5 -262.4,434.7 -262,434.7 -253.2,425.9 "/>
<polygon fill="none" points="-253.2,434.7 -253.2,434.3 -253.6,434.7 "/>
<polygon fill="none" points="-253.2,429.9 -258,434.7 -257.6,434.7 -253.2,430.3 "/>
<polygon fill="none" points="-253.2,432.1 -255.8,434.7 -255.4,434.7 -253.2,432.5 "/>
<polygon fill="none" points="-253.2,427.7 -260.2,434.7 -259.8,434.7 -253.2,428.1 "/>
<polygon fill="none" points="-267.7,407.1 -280.8,420.2 -280.8,420.6 -267.3,407.1 "/>
<polygon fill="none" points="-261.1,407.1 -280.8,426.8 -280.8,427.2 -260.7,407.1 "/>
<polygon fill="none" points="-272,407.1 -280.8,415.8 -280.8,416.2 -271.7,407.1 "/>
<polygon fill="none" points="-269.9,407.1 -280.8,418 -280.8,418.4 -269.5,407.1 "/>
<polygon fill="none" points="-265.5,407.1 -280.8,422.4 -280.8,422.8 -265.1,407.1 "/>
<polygon fill="none" points="-274.2,407.1 -280.8,413.7 -280.8,414 -273.8,407.1 "/>
<polygon fill="none" points="-278.6,407.1 -280.8,409.3 -280.8,409.7 -278.2,407.1 "/>
<polygon fill="none" points="-280.8,407.1 -280.8,407.5 -280.4,407.1 "/>
<polygon fill="none" points="-276.4,407.1 -280.8,411.5 -280.8,411.9 -276,407.1 "/>
<polygon fill="none" points="-253.2,408 -279.9,434.7 -279.5,434.7 -253.2,408.4 "/>
<polygon fill="none" points="-253.2,412.3 -275.5,434.7 -275.2,434.7 -253.2,412.7 "/>
<polygon fill="none" points="-253.2,414.5 -273.4,434.7 -273,434.7 -253.2,414.9 "/>
<polygon fill="none" points="-253.2,410.2 -277.7,434.7 -277.3,434.7 -253.2,410.5 "/>
<polygon fill="none" points="-258.9,407.1 -280.8,429 -280.8,429.4 -258.5,407.1 "/>
<polygon fill="none" points="-253.2,416.7 -271.2,434.7 -270.8,434.7 -253.2,417.1 "/>
<polygon fill="none" points="-254.5,407.1 -280.8,433.4 -280.8,433.8 -254.1,407.1 "/>
<polygon fill="none" points="-256.7,407.1 -280.8,431.2 -280.8,431.6 -256.3,407.1 "/>
<polygon fill="none" points="-263.3,407.1 -280.8,424.6 -280.8,425 -262.9,407.1 "/>
<polygon points="-280.4,407.1 -280.8,407.5 -280.8,409.3 -278.6,407.1 "/>
<polygon points="-278.2,407.1 -280.8,409.7 -280.8,411.5 -276.4,407.1 "/>
<polygon points="-276,407.1 -280.8,411.9 -280.8,413.7 -274.2,407.1 "/>
<polygon points="-273.8,407.1 -280.8,414 -280.8,415.8 -272,407.1 "/>
<polygon points="-271.7,407.1 -280.8,416.2 -280.8,418 -269.9,407.1 "/>
<polygon points="-269.5,407.1 -280.8,418.4 -280.8,420.2 -267.7,407.1 "/>
<polygon points="-267.3,407.1 -280.8,420.6 -280.8,422.4 -265.5,407.1 "/>
<polygon points="-265.1,407.1 -280.8,422.8 -280.8,424.6 -263.3,407.1 "/>
<polygon points="-262.9,407.1 -280.8,425 -280.8,426.8 -261.1,407.1 "/>
<polygon points="-260.7,407.1 -280.8,427.2 -280.8,429 -258.9,407.1 "/>
<polygon points="-258.5,407.1 -280.8,429.4 -280.8,431.2 -256.7,407.1 "/>
<polygon points="-256.3,407.1 -280.8,431.6 -280.8,433.4 -254.5,407.1 "/>
<polygon points="-282,435 -282,435 -282,435 "/>
<polygon points="-253.2,407.1 -254.1,407.1 -280.8,433.8 -280.8,434.7 -279.9,434.7 -253.2,408 "/>
<polygon points="-253.2,408.4 -279.5,434.7 -277.7,434.7 -253.2,410.2 "/>
<polygon points="-253.2,410.5 -277.3,434.7 -275.5,434.7 -253.2,412.3 "/>
<polygon points="-253.2,412.7 -275.2,434.7 -273.4,434.7 -253.2,414.5 "/>
<polygon points="-253.2,414.9 -273,434.7 -271.2,434.7 -253.2,416.7 "/>
<polygon points="-253.2,417.1 -270.8,434.7 -269,434.7 -253.2,418.9 "/>
<polygon points="-253.2,419.3 -268.6,434.7 -266.8,434.7 -253.2,421.1 "/>
<polygon points="-253.2,421.5 -266.4,434.7 -264.6,434.7 -253.2,423.3 "/>
<polygon points="-253.2,423.7 -264.2,434.7 -262.4,434.7 -253.2,425.5 "/>
<polygon points="-253.2,425.9 -262,434.7 -260.2,434.7 -253.2,427.7 "/>
<polygon points="-253.2,428.1 -259.8,434.7 -258,434.7 -253.2,429.9 "/>
<polygon points="-253.2,430.3 -257.6,434.7 -255.8,434.7 -253.2,432.1 "/>
<polygon points="-255.4,434.7 -253.6,434.7 -253.2,434.3 -253.2,432.5 "/>
<polygon points="-280.8,407.1 -282,407.1 -282,408.7 -280.8,407.5 "/>
<polygon points="-280.8,415.8 -282,417 -282,417.4 -280.8,416.2 "/>
<polygon points="-280.8,422.4 -282,423.6 -282,424 -280.8,422.8 "/>
<polygon points="-280.8,413.7 -282,414.9 -282,415.2 -280.8,414 "/>
<polygon points="-280.8,418 -282,419.2 -282,419.6 -280.8,418.4 "/>
<polygon points="-280.8,409.3 -282,410.5 -282,410.9 -280.8,409.7 "/>
<polygon points="-280.8,411.5 -282,412.7 -282,413.1 -280.8,411.9 "/>
<polygon points="-280.8,420.2 -282,421.4 -282,421.8 -280.8,420.6 "/>
<polygon points="-280.8,433.8 -280.8,433.4 -282,434.6 -282,434.7 -281.7,434.7 "/>
<polygon points="-280.8,429 -282,430.2 -282,430.6 -280.8,429.4 "/>
<polygon points="-280.8,431.2 -282,432.4 -282,432.8 -280.8,431.6 "/>
<polygon points="-280.8,424.6 -282,425.8 -282,426.2 -280.8,425 "/>
<polygon points="-280.8,426.8 -282,428 -282,428.4 -280.8,427.2 "/>
<polygon points="-280.8,407.5 -282,408.7 -282,410.5 -280.8,409.3 "/>
<polygon points="-280.8,409.7 -282,410.9 -282,412.7 -280.8,411.5 "/>
<polygon points="-280.8,411.9 -282,413.1 -282,414.9 -280.8,413.7 "/>
<polygon points="-280.8,414 -282,415.2 -282,417 -280.8,415.8 "/>
<polygon points="-280.8,416.2 -282,417.4 -282,419.2 -280.8,418 "/>
<polygon points="-280.8,418.4 -282,419.6 -282,421.4 -280.8,420.2 "/>
<polygon points="-280.8,420.6 -282,421.8 -282,423.6 -280.8,422.4 "/>
<polygon points="-280.8,422.8 -282,424 -282,425.8 -280.8,424.6 "/>
<polygon points="-280.8,425 -282,426.2 -282,428 -280.8,426.8 "/>
<polygon points="-280.8,427.2 -282,428.4 -282,430.2 -280.8,429 "/>
<polygon points="-280.8,429.4 -282,430.6 -282,432.4 -280.8,431.2 "/>
<polygon points="-280.8,431.6 -282,432.8 -282,434.6 -280.8,433.4 "/>
<polygon points="-281.7,434.7 -280.8,434.7 -280.8,433.8 "/>
<polygon points="-253.2,414.9 -252,413.7 -252,413.3 -253.2,414.5 "/>
<polygon points="-253.2,419.3 -252,418.1 -252,417.7 -253.2,418.9 "/>
<polygon points="-253.2,408 -253.2,408.4 -252,407.2 -252,407.1 -252.3,407.1 "/>
<polygon points="-253.2,423.7 -252,422.5 -252,422.1 -253.2,423.3 "/>
<polygon points="-253.2,417.1 -252,415.9 -252,415.5 -253.2,416.7 "/>
<polygon points="-253.2,410.5 -252,409.3 -252,409 -253.2,410.2 "/>
<polygon points="-253.2,412.7 -252,411.5 -252,411.1 -253.2,412.3 "/>
<polygon points="-253.2,421.5 -252,420.3 -252,419.9 -253.2,421.1 "/>
<polygon points="-253.2,434.3 -253.2,434.7 -252,434.7 -252,433.1 "/>
<polygon points="-253.2,425.9 -252,424.7 -252,424.3 -253.2,425.5 "/>
<polygon points="-253.2,428.1 -252,426.9 -252,426.5 -253.2,427.7 "/>
<polygon points="-253.2,432.5 -252,431.3 -252,430.9 -253.2,432.1 "/>
<polygon points="-253.2,430.3 -252,429.1 -252,428.7 -253.2,429.9 "/>
<polygon points="-252.3,407.1 -253.2,407.1 -253.2,408 "/>
<polygon points="-253.2,410.2 -252,409 -252,407.2 -253.2,408.4 "/>
<polygon points="-253.2,412.3 -252,411.1 -252,409.3 -253.2,410.5 "/>
<polygon points="-253.2,414.5 -252,413.3 -252,411.5 -253.2,412.7 "/>
<polygon points="-253.2,416.7 -252,415.5 -252,413.7 -253.2,414.9 "/>
<polygon points="-253.2,418.9 -252,417.7 -252,415.9 -253.2,417.1 "/>
<polygon points="-253.2,421.1 -252,419.9 -252,418.1 -253.2,419.3 "/>
<polygon points="-253.2,423.3 -252,422.1 -252,420.3 -253.2,421.5 "/>
<polygon points="-253.2,425.5 -252,424.3 -252,422.5 -253.2,423.7 "/>
<polygon points="-253.2,427.7 -252,426.5 -252,424.7 -253.2,425.9 "/>
<polygon points="-253.2,429.9 -252,428.7 -252,426.9 -253.2,428.1 "/>
<polygon points="-253.2,432.1 -252,430.9 -252,429.1 -253.2,430.3 "/>
<polygon points="-253.2,434.3 -252,433.1 -252,431.3 -253.2,432.5 "/>
<polygon points="-263.3,407.1 -262.9,407.1 -261.7,405.9 -263.9,405.9 -263,406.8 "/>
<polygon points="-265.5,407.1 -265.1,407.1 -263.9,405.9 -266.1,405.9 -265.2,406.8 "/>
<polygon points="-269.9,407.1 -269.5,407.1 -268.3,405.9 -270.5,405.9 -269.6,406.8 "/>
<polygon points="-256.7,407.1 -256.3,407.1 -255.1,405.9 -257.3,405.9 -256.4,406.8 "/>
<polygon points="-254.5,407.1 -254.1,407.1 -253.2,406.2 -253.2,405.9 -255.1,405.9 -254.2,406.8 "/>
<polygon points="-258.9,407.1 -258.5,407.1 -257.3,405.9 -259.5,405.9 -258.6,406.8 "/>
<polygon points="-261.1,407.1 -260.7,407.1 -259.5,405.9 -261.7,405.9 -260.8,406.8 "/>
<polygon points="-280.4,407.1 -279.2,405.9 -280.8,405.9 -280.8,407.1 "/>
<polygon points="-276.4,407.1 -276,407.1 -274.8,405.9 -277,405.9 -276.1,406.8 "/>
<polygon points="-278.6,407.1 -278.2,407.1 -277,405.9 -279.2,405.9 -278.3,406.8 "/>
<polygon points="-274.2,407.1 -273.8,407.1 -272.6,405.9 -274.8,405.9 -273.9,406.8 "/>
<polygon points="-272,407.1 -271.7,407.1 -270.5,405.9 -272.6,405.9 -271.7,406.8 "/>
<polygon points="-267.7,407.1 -267.3,407.1 -266.1,405.9 -268.3,405.9 -267.4,406.8 "/>
<polygon points="-278.6,407.1 -278.3,406.8 -279.2,405.9 -280.4,407.1 "/>
<polygon points="-276.4,407.1 -276.1,406.8 -277,405.9 -278.2,407.1 "/>
<polygon points="-274.2,407.1 -273.9,406.8 -274.8,405.9 -276,407.1 "/>
<polygon points="-272,407.1 -271.7,406.8 -272.6,405.9 -273.8,407.1 "/>
<polygon points="-269.9,407.1 -269.6,406.8 -270.5,405.9 -271.7,407.1 "/>
<polygon points="-267.7,407.1 -267.4,406.8 -268.3,405.9 -269.5,407.1 "/>
<polygon points="-265.5,407.1 -265.2,406.8 -266.1,405.9 -267.3,407.1 "/>
<polygon points="-263.3,407.1 -263,406.8 -263.9,405.9 -265.1,407.1 "/>
<polygon points="-261.1,407.1 -260.8,406.8 -261.7,405.9 -262.9,407.1 "/>
<polygon points="-258.9,407.1 -258.6,406.8 -259.5,405.9 -260.7,407.1 "/>
<polygon points="-256.7,407.1 -256.4,406.8 -257.3,405.9 -258.5,407.1 "/>
<polygon points="-254.5,407.1 -254.2,406.8 -255.1,405.9 -256.3,407.1 "/>
<polygon points="-253.2,406.2 -254.1,407.1 -253.2,407.1 "/>
<rect x="-282" y="405.9" width="1.2" height="1.2"/>
<polygon points="-252.3,407.1 -252,407.1 -252,405.9 -252.9,405.9 -252,406.8 "/>
<polygon points="-252.9,405.9 -253.2,405.9 -253.2,406.2 "/>
<polygon points="-253.2,407.1 -252.3,407.1 -252,406.8 -252.9,405.9 -253.2,406.2 "/>
<polygon points="-266.4,434.7 -266.8,434.7 -268,435.9 -265.8,435.9 -266.7,435 "/>
<polygon points="-264.2,434.7 -264.6,434.7 -265.8,435.9 -263.6,435.9 -264.5,435 "/>
<polygon points="-270.8,434.7 -271.2,434.7 -272.4,435.9 -270.2,435.9 -271.1,435 "/>
<polygon points="-268.6,434.7 -269,434.7 -270.2,435.9 -268,435.9 -268.9,435 "/>
<polygon points="-253.6,434.7 -254.8,435.9 -253.2,435.9 -253.2,434.7 "/>
<polygon points="-257.6,434.7 -258,434.7 -259.2,435.9 -257,435.9 -257.9,435 "/>
<polygon points="-259.8,434.7 -260.2,434.7 -261.4,435.9 -259.2,435.9 -260.1,435 "/>
<polygon points="-255.4,434.7 -255.8,434.7 -257,435.9 -254.8,435.9 -255.7,435 "/>
<polygon points="-273,434.7 -273.4,434.7 -274.6,435.9 -272.4,435.9 -273.3,435 "/>
<polygon points="-262,434.7 -262.4,434.7 -263.6,435.9 -261.4,435.9 -262.3,435 "/>
<polygon points="-277.3,434.7 -277.7,434.7 -278.9,435.9 -276.7,435.9 -277.6,435 "/>
<polygon points="-275.2,434.7 -275.5,434.7 -276.7,435.9 -274.6,435.9 -275.5,435 "/>
<polygon points="-279.5,434.7 -279.9,434.7 -280.8,435.6 -280.8,435.9 -278.9,435.9 -279.8,435 "/>
<polygon points="-280.8,435.6 -279.9,434.7 -280.8,434.7 "/>
<polygon points="-279.5,434.7 -279.8,435 -278.9,435.9 -277.7,434.7 "/>
<polygon points="-277.3,434.7 -277.6,435 -276.7,435.9 -275.5,434.7 "/>
<polygon points="-275.2,434.7 -275.5,435 -274.6,435.9 -273.4,434.7 "/>
<polygon points="-273,434.7 -273.3,435 -272.4,435.9 -271.2,434.7 "/>
<polygon points="-270.8,434.7 -271.1,435 -270.2,435.9 -269,434.7 "/>
<polygon points="-268.6,434.7 -268.9,435 -268,435.9 -266.8,434.7 "/>
<polygon points="-266.4,434.7 -266.7,435 -265.8,435.9 -264.6,434.7 "/>
<polygon points="-264.2,434.7 -264.5,435 -263.6,435.9 -262.4,434.7 "/>
<polygon points="-262,434.7 -262.3,435 -261.4,435.9 -260.2,434.7 "/>
<polygon points="-259.8,434.7 -260.1,435 -259.2,435.9 -258,434.7 "/>
<polygon points="-257.6,434.7 -257.9,435 -257,435.9 -255.8,434.7 "/>
<polygon points="-255.4,434.7 -255.7,435 -254.8,435.9 -253.6,434.7 "/>
<polygon points="-282,435.9 -281.1,435.9 -282,435 "/>
<polygon points="-282,434.7 -282,435 -281.7,434.7 "/>
<polygon points="-281.1,435.9 -280.8,435.9 -280.8,435.6 "/>
<polygon points="-280.8,434.7 -281.7,434.7 -282,435 -282,435 -281.1,435.9 -280.8,435.6 "/>
<rect x="-253.2" y="434.7" width="1.2" height="1.2"/>
</g>
</svg>
</svg>

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View File

@ -9,7 +9,11 @@
<rect x="0" y="28.8" width="30" height="1.2"/>
<rect x="0" y="0" width="30" height="1.2"/>
</g>
<rect x="14.4" y="-5.4" transform="matrix(0.7071 0.7071 -0.7071 0.7071 15.0003 -6.2132)" width="1.2" height="40.8"/>
<rect x="14.4" y="-5.4" transform="matrix(0.7071 -0.7071 0.7071 0.7071 -6.2132 14.9997)" width="1.2" height="40.8"/>
<rect x="14.4" y="-5.4" transform="matrix(0.7071 0.7071 -0.7071 0.7071 14.9999 -6.2122)" width="1.2" height="40.8"/>
<polygon points="0.7,10 0.1,8.9 9,0.1 9.8,0.9 "/>
<rect x="24.5" y="19" transform="matrix(0.7071 0.7071 -0.7071 0.7071 25.0689 -10.4098)" width="1.2" height="12.2"/>
<rect x="14.4" y="-5.4" transform="matrix(0.7071 -0.7071 0.7071 0.7071 -6.2136 14.9987)" width="1.2" height="40.8"/>
<polyline points="0.8,20.1 9.6,29 8.8,29.8 0,21 "/>
<rect x="24.5" y="-1.2" transform="matrix(0.7071 -0.7071 0.7071 0.7071 3.8484 19.2136)" width="1.2" height="12.2"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 791 B

After

Width:  |  Height:  |  Size: 1.1 KiB

File diff suppressed because it is too large Load Diff

Before

Width:  |  Height:  |  Size: 247 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -13,7 +13,7 @@ QtObject {
background: Rectangle {
color: UM.Theme.colors.setting_control
border.width: 1
border.color: UM.Theme.colors.setting_control_border
border.color: control.hovered ? UM.Theme.colors.setting_control_border_highlight : UM.Theme.colors.setting_control_border
UM.RecolorImage {
id: downArrow
anchors.verticalCenter: parent.verticalCenter
@ -28,47 +28,41 @@ QtObject {
}
Label {
id: sidebarComboBoxLabel
//property bool down: control.pressed || (control.checkable && control.checked);
color: UM.Theme.colors.setting_control_text
text: control.text;
elide: Text.ElideRight;
anchors.left: parent.left;
anchors.leftMargin: UM.Theme.sizes.setting_unit_margin.width
anchors.right: separationLine.left;
anchors.right: downArrow.left;
anchors.verticalCenter: parent.verticalCenter;
font: UM.Theme.fonts.default
}
Rectangle{
id: separationLine
width: 1
height: UM.Theme.sizes.setting_control.height
color: UM.Theme.colors.setting_control_border
anchors.right: downArrow.left
anchors.rightMargin: UM.Theme.sizes.setting_unit_margin.width + downArrow.width/2
anchors.top: parent.top
z: parent.z + 1
}
}
label: Label{}
}
}
/*
property Component open_file_button: Component {
ButtonStyle {
background: Item{
implicitWidth: UM.Theme.sizes.button.width;
implicitHeight: UM.Theme.sizes.button.height;
Rectangle {
id: tool_button_background
anchors.left: parent.right
anchors.verticalCenter: parent.verticalCenter
color: UM.Theme.colors.button_text
width: control.hovered ? openFileLabel.width : 0;
height: openFileLabel.height
Behavior on width { NumberAnimation { duration: 100; } }
opacity: control.hovered ? 1.0 : 0.0;
width: control.hovered ? label.width : 0;
height: label.height
Behavior on width { NumberAnimation { duration: 100; } }
Behavior on height { NumberAnimation { duration: 100; } }
Behavior on opacity { NumberAnimation { duration: 100; } }
Label {
id: openFileLabel
id: label
anchors.bottom: parent.bottom
text: control.text
font: UM.Theme.fonts.button_tooltip;
@ -77,7 +71,8 @@ QtObject {
}
Rectangle {
anchors.fill: parent;
color: control.hovered ? UM.Theme.colors.load_save_button_hover : UM.Theme.colors.load_save_button
color: control.pressed ? UM.Theme.colors.button_active :
control.hovered ? UM.Theme.colors.button_hover : UM.Theme.colors.button
Behavior on color { ColorAnimation { duration: 50; } }
}
}
@ -92,6 +87,7 @@ QtObject {
}
}
}
*/
property Component tool_button: Component {
ButtonStyle {
@ -99,39 +95,33 @@ QtObject {
implicitWidth: UM.Theme.sizes.button.width;
implicitHeight: UM.Theme.sizes.button.height;
Rectangle {
id: tool_button_background
anchors.left: control.verticalTooltip ? parent.left : parent.right
anchors.verticalCenter: control.verticalTooltip ? undefined : parent.verticalCenter
anchors.top: control.verticalTooltip ? parent.bottom : undefined
UM.PointingRectangle {
id: button_tooltip
anchors.left: parent.right
anchors.leftMargin: UM.Theme.sizes.button_tooltip_arrow.width * 2
anchors.verticalCenter: parent.verticalCenter
target: Qt.point(parent.x, y + height/2)
arrowSize: UM.Theme.sizes.button_tooltip_arrow.width
color: UM.Theme.colors.tooltip
opacity: control.hovered ? 1.0 : 0.0;
width: {
if (control.verticalTooltip == true){
if (label.width > parent.width)
return label.width
else
return parent.width
}
else {
if (control.hovered)
return label.width
else
return 0
}
}
height: !control.verticalTooltip ? label.height : control.hovered ? label.height: 0
width: control.hovered ? button_tip.width + UM.Theme.sizes.button_tooltip.width : 0
height: UM.Theme.sizes.button_tooltip.height
Behavior on width { NumberAnimation { duration: 100; } }
Behavior on height { NumberAnimation { duration: 100; } }
Behavior on opacity { NumberAnimation { duration: 100; } }
Label {
id: label
anchors.bottom: parent.bottom
text: control.text
id: button_tip
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter;
text: control.text;
font: UM.Theme.fonts.button_tooltip;
color: UM.Theme.colors.button_tooltip_text;
color: UM.Theme.colors.tooltip_text;
}
}
@ -154,16 +144,21 @@ QtObject {
}
Behavior on color { ColorAnimation { duration: 50; } }
Label {
UM.RecolorImage {
id: tool_button_arrow
opacity: !control.enabled ? 0.4 : 1.0
opacity: !control.enabled ? 0.2 : 1.0
anchors.right: parent.right;
anchors.rightMargin: (UM.Theme.sizes.button.width - UM.Theme.sizes.button_icon.width - tool_button_arrow.width) / 2
anchors.verticalCenter: parent.verticalCenter;
text: "▼";
font: UM.Theme.fonts.small;
anchors.rightMargin: (UM.Theme.sizes.button.width - UM.Theme.sizes.button_icon.width) / 4
anchors.bottom: parent.bottom;
anchors.bottomMargin: (UM.Theme.sizes.button.height - UM.Theme.sizes.button_icon.height) / 4
width: UM.Theme.sizes.standard_arrow.width
height: UM.Theme.sizes.standard_arrow.height
sourceSize.width: width
sourceSize.height: width
visible: control.menu != null;
color: UM.Theme.colors.button_text
source: UM.Theme.icons.arrow_bottom
}
}
}
@ -171,7 +166,7 @@ QtObject {
label: Item {
Image {
anchors.centerIn: parent;
opacity: !control.enabled ? 0.4 : 1.0
opacity: !control.enabled ? 0.2 : 1.0
source: control.iconSource;
width: UM.Theme.sizes.button_icon.width;
height: UM.Theme.sizes.button_icon.height;
@ -181,6 +176,8 @@ QtObject {
}
}
}
/*
property Component tool_button_panel: Component {
ButtonStyle {
background: Item {
@ -189,21 +186,21 @@ QtObject {
Rectangle {
id: tool_button_background
anchors.top: parent.verticalCenter;
width: parent.width;
height: control.hovered ? parent.height / 2 + label.height : 0;
Behavior on height { NumberAnimation { duration: 100; } }
anchors.left: parent.right
anchors.verticalCenter: parent.verticalCenter
opacity: control.hovered ? 1.0 : 0.0;
width: control.hovered ? label.width : 0;
height: label.height
Behavior on width { NumberAnimation { duration: 100; } }
Behavior on height { NumberAnimation { duration: 100; } }
Behavior on opacity { NumberAnimation { duration: 100; } }
Label {
id: label
anchors.bottom: parent.bottom
text: control.text
width: UM.Theme.sizes.button.width;
wrapMode: Text.WordWrap
font: UM.Theme.fonts.button_tooltip;
color: UM.Theme.colors.button_tooltip_text;
}
@ -246,18 +243,20 @@ QtObject {
}
}
}
*/
property Component progressbar: Component{
ProgressBarStyle {
background:Rectangle {
implicitWidth: UM.Theme.sizes.message.width - (UM.Theme.sizes.default_margin.width * 2)
implicitHeight: UM.Theme.sizes.progressbar.height
radius: UM.Theme.sizes.progressbar_radius.width
color: UM.Theme.colors.progressbar_background
}
progress: Rectangle {
color: control.indeterminate ? "transparent" : UM.Theme.colors.progressbar_control
Rectangle{
radius: UM.Theme.sizes.progressbar_radius.width
color: UM.Theme.colors.progressbar_control
width: UM.Theme.sizes.progressbar_control.width
height: UM.Theme.sizes.progressbar_control.height
@ -281,6 +280,11 @@ QtObject {
property Component sidebar_category: Component {
ButtonStyle {
background: Rectangle {
anchors.fill: parent;
anchors.left: parent.left
anchors.leftMargin: UM.Theme.sizes.default_margin.width
anchors.right: parent.right
anchors.rightMargin: UM.Theme.sizes.default_margin.width
implicitHeight: UM.Theme.sizes.section.height;
color: {
if(control.color) {
@ -298,6 +302,24 @@ QtObject {
}
}
Behavior on color { ColorAnimation { duration: 50; } }
Rectangle {
height: UM.Theme.sizes.default_lining.height
width: parent.width
anchors.bottom: parent.bottom
color: {
if(!control.enabled) {
return UM.Theme.colors.setting_category_disabled_border;
} else if(control.hovered && control.checkable && control.checked) {
return UM.Theme.colors.setting_category_active_hover_border;
} else if(control.pressed || (control.checkable && control.checked)) {
return UM.Theme.colors.setting_category_active_border;
} else if(control.hovered) {
return UM.Theme.colors.setting_category_hover_border;
} else {
return UM.Theme.colors.setting_category_border;
}
}
}
}
label: Item {
anchors.fill: parent;
@ -341,7 +363,7 @@ QtObject {
sourceSize.width: width
sourceSize.height: width
color: UM.Theme.colors.setting_category_text
source: control.checked ? UM.Theme.icons.arrow_top : UM.Theme.icons.arrow_bottom
source: control.checked ? UM.Theme.icons.arrow_bottom : UM.Theme.icons.arrow_left
}
}
}
@ -356,12 +378,14 @@ QtObject {
scrollBarBackground: Rectangle {
implicitWidth: UM.Theme.sizes.scrollbar.width
radius: implicitWidth / 2
color: UM.Theme.colors.scrollbar_background;
}
handle: Rectangle {
id: scrollViewHandle
implicitWidth: UM.Theme.sizes.scrollbar.width;
radius: implicitWidth / 2
color: styleData.pressed ? UM.Theme.colors.scrollbar_handle_down : styleData.hovered ? UM.Theme.colors.scrollbar_handle_hover : UM.Theme.colors.scrollbar_handle;
Behavior on color { ColorAnimation { duration: 50; } }
@ -381,7 +405,9 @@ QtObject {
controlColor: UM.Theme.colors.setting_control;
controlHighlightColor: UM.Theme.colors.setting_control_highlight;
controlBorderColor: UM.Theme.colors.setting_control_border;
controlBorderHighlightColor: UM.Theme.colors.setting_control_border_highlight;
controlTextColor: UM.Theme.colors.setting_control_text;
controlBorderWidth: UM.Theme.sizes.default_lining.width;
controlFont: UM.Theme.fonts.default;
validationErrorColor: UM.Theme.colors.setting_validation_error;
@ -400,19 +426,24 @@ QtObject {
implicitWidth: UM.Theme.sizes.checkbox.width;
implicitHeight: UM.Theme.sizes.checkbox.height;
color: control.hovered ? UM.Theme.colors.checkbox_hover : UM.Theme.colors.checkbox;
color: (control.hovered || control.hovered_ex) ? UM.Theme.colors.checkbox_hover : UM.Theme.colors.checkbox;
Behavior on color { ColorAnimation { duration: 50; } }
border.width: 1
border.color: UM.Theme.colors.checkbox_border;
radius: control.exclusiveGroup ? UM.Theme.sizes.checkbox.width / 2 : 0
Label {
anchors.centerIn: parent;
color: UM.Theme.colors.checkbox_mark;
border.width: UM.Theme.sizes.default_lining.width;
border.color: (control.hovered || control.hovered_ex) ? UM.Theme.colors.checkbox_border_hover : UM.Theme.colors.checkbox_border;
text: "✓";
opacity: control.checked ? 1 : 0;
UM.RecolorImage {
anchors.verticalCenter: parent.verticalCenter
anchors.horizontalCenter: parent.horizontalCenter
width: parent.width/2.5
height: parent.height/2.5
sourceSize.width: width
sourceSize.height: width
color: UM.Theme.colors.checkbox_mark
source: control.exclusiveGroup ? UM.Theme.icons.dot : UM.Theme.icons.check
opacity: control.checked
Behavior on opacity { NumberAnimation { duration: 100; } }
}
}
@ -431,7 +462,7 @@ QtObject {
implicitHeight: UM.Theme.sizes.slider_groove.height;
color: UM.Theme.colors.slider_groove;
border.width: 1;
border.width: UM.Theme.sizes.default_lining.width;
border.color: UM.Theme.colors.slider_groove_border;
Rectangle {
@ -459,9 +490,10 @@ QtObject {
id: layerSliderGroove
implicitWidth: control.width;
implicitHeight: UM.Theme.sizes.slider_groove.height;
radius: width/2;
color: UM.Theme.colors.slider_groove;
border.width: 1;
border.width: UM.Theme.sizes.default_lining;
border.color: UM.Theme.colors.slider_groove_border;
Rectangle {
anchors {
@ -471,6 +503,7 @@ QtObject {
}
color: UM.Theme.colors.slider_groove_fill;
width: (control.value / (control.maximumValue - control.minimumValue)) * parent.width;
radius: width/2
}
}
handle: Rectangle {
@ -481,7 +514,6 @@ QtObject {
Behavior on color { ColorAnimation { duration: 50; } }
TextField {
id: valueLabel
property int unremovableSpacing: 5
property string maxValue: control.maximumValue + 1
placeholderText: control.value + 1
onEditingFinished: {
@ -494,20 +526,17 @@ QtObject {
}
validator: IntValidator {bottom: 1; top: control.maximumValue + 1;}
visible: UM.LayerView.getLayerActivity && Printer.getPlatformActivity ? true : false
anchors.bottom: layerSliderControl.bottom
anchors.right: layerSliderControl.left
anchors.rightMargin: valueLabel.unremovableSpacing / 2
anchors.bottomMargin: parent.width + (UM.Theme.sizes.default_margin.width / 2)
transformOrigin: Item.BottomRight
anchors.top: layerSliderControl.bottom
anchors.topMargin: UM.Theme.sizes.default_margin.width
anchors.horizontalCenter: layerSliderControl.horizontalCenter
rotation: 90
style: TextFieldStyle{
textColor: UM.Theme.colors.setting_control_text;
font: UM.Theme.fonts.default;
background: Rectangle {
radius: 0
implicitWidth: control.maxValue.length * valueLabel.font.pixelSize
implicitHeight: UM.Theme.sizes.slider_handle.height + valueLabel.unremovableSpacing
border.width: 1;
implicitHeight: UM.Theme.sizes.slider_handle.height + UM.Theme.sizes.default_margin.width
border.width: UM.Theme.sizes.default_lining.width;
border.color: UM.Theme.colors.slider_groove_border;
}
}
@ -526,8 +555,8 @@ QtObject {
implicitHeight: control.height;
implicitWidth: control.width;
border.width: 1;
border.color: UM.Theme.colors.setting_control_border;
border.width: UM.Theme.sizes.default_lining.width;
border.color: control.hovered ? UM.Theme.colors.setting_control_border_highlight : UM.Theme.colors.setting_control_border;
color: UM.Theme.colors.setting_validation_ok;

View File

@ -1,159 +1,180 @@
{
"fonts": {
"large": {
"size": 1.5,
"size": 1.25,
"bold": true,
"family": "Roboto"
"family": "Proxima Nova Rg"
},
"default": {
"size": 1,
"family": "Roboto"
},
"default_allcaps": {
"size": 1,
"capitalize": true,
"family": "Roboto"
"size": 1.15,
"family": "Proxima Nova Rg"
},
"small": {
"size": 0.75,
"family": "Roboto"
},
"tiny": {
"size": 0.5,
"family": "Roboto"
"size": 1.0,
"family": "Proxima Nova Rg"
},
"caption": {
"size": 0.75,
"italic": true,
"family": "Roboto"
"size": 1.0,
"family": "Proxima Nova Rg"
},
"sidebar_header": {
"size": 0.75,
"capitalize": true,
"family": "Roboto"
"family": "Proxima Nova Rg"
},
"default_header": {
"size": 1.0,
"bold": true,
"family": "Roboto",
"family": "Proxima Nova Rg",
"letterSpacing": 2.0
},
"button_tooltip": {
"size": 0.75,
"capitalize": true,
"family": "Roboto"
"size": 1.0,
"family": "Proxima Nova Rg"
},
"setting_category": {
"size": 1.0,
"family": "Roboto"
"size": 1.15,
"family": "Proxima Nova Rg"
},
"action_button": {
"size": 1.15,
"bold": true,
"family": "Proxima Nova Rg"
}
},
"colors": {
"text_default": [0, 0, 0, 255],
"sidebar": [255, 255, 255, 255],
"lining": [208, 210, 211, 255],
"lining": [127, 127, 127, 255],
"primary": [12, 169, 227, 255],
"primary_hover": [34, 150, 190, 255],
"primary_hover": [48, 182, 231, 255],
"primary_text": [255, 255, 255, 255],
"border": [205, 202, 201, 255],
"secondary": [205, 202, 201, 255],
"border": [127, 127, 127, 255],
"secondary": [245, 245, 245, 255],
"text": [140, 144, 154, 255],
"text": [24, 41, 77, 255],
"text_inactive": [174, 174, 174, 255],
"text_white": [255, 255, 255, 255],
"text_hover": [35, 35, 35, 255],
"text_pressed": [12, 169, 227, 255],
"text_white": [255, 255, 255, 255],
"text_subtext": [127, 127, 127, 255],
"error": [255, 140, 0, 255],
"sidebar_header_bar": [12, 169, 227, 255],
"sidebar_header_bar": [24, 41, 77, 255],
"sidebar_lining": [245, 245, 245, 255],
"button": [139, 143, 153, 255],
"button_hover": [77, 184, 226, 255],
"button": [24, 41, 77, 255],
"button_hover": [70, 84, 113, 255],
"button_active": [32, 166, 219, 255],
"button_active_hover": [77, 184, 226, 255],
"button_active_hover": [12, 169, 227, 255],
"button_text": [255, 255, 255, 255],
"button_disabled": [0, 0, 0, 255],
"button_tooltip_text": [35, 35, 35, 255],
"button_disabled": [24, 41, 77, 255],
"button_disabled_text": [70, 84, 113, 255],
"toggle_active": [255, 255, 255, 255],
"toggle_active_text": [77, 184, 226, 255],
"toggle_disabled": [77, 184, 226, 255],
"toggle_disabled_text": [255, 255, 255, 255],
"button_tooltip": [255, 255, 255, 255],
"button_tooltip_border": [24, 41, 77, 255],
"button_tooltip_text": [24, 41, 77, 255],
"load_save_button": [0, 0, 0, 255],
"load_save_button_text": [255, 255, 255, 255],
"load_save_button_hover": [43, 45, 46, 255],
"load_save_button_inactive": [176, 184, 191, 255],
"load_save_button_inactive_text": [209, 214, 219, 255],
"toggle_checked": [24, 41, 77, 255],
"toggle_checked_border": [24, 41, 77, 255],
"toggle_checked_text": [255, 255, 255, 255],
"toggle_unchecked": [255, 255, 255, 255],
"toggle_unchecked_border": [127, 127, 127, 255],
"toggle_unchecked_text": [24, 41, 77, 255],
"toggle_hovered": [255, 255, 255, 255],
"toggle_hovered_border": [32, 166, 219, 255],
"toggle_hovered_text": [24, 41, 77, 255],
"toggle_active": [32, 166, 219, 255],
"toggle_active_border": [32, 166, 219, 255],
"toggle_active_text": [255, 255, 255, 255],
"scrollbar_background": [245, 245, 245, 255],
"scrollbar_handle": [12, 159, 227, 255],
"scrollbar_handle_hover": [174, 174, 174, 255],
"action_button": [255, 255, 255, 255],
"action_button_text": [24, 41, 77, 255],
"action_button_border": [127, 127, 127, 255],
"action_button_hovered": [255, 255, 255, 255],
"action_button_hovered_text": [24, 41, 77, 255],
"action_button_hovered_border": [12, 169, 227, 255],
"action_button_active": [12, 169, 227, 255],
"action_button_active_text": [255, 255, 255, 255],
"action_button_active_border": [12, 169, 227, 255],
"action_button_disabled": [245, 245, 245, 255],
"action_button_disabled_text": [127, 127, 127, 255],
"action_button_disabled_border": [127, 127, 127, 255],
"scrollbar_background": [255, 255, 255, 255],
"scrollbar_handle": [24, 41, 77, 255],
"scrollbar_handle_hover": [12, 159, 227, 255],
"scrollbar_handle_down": [12, 159, 227, 255],
"setting_category": [238, 238, 238, 255],
"setting_category_disabled": [238, 238, 238, 255],
"setting_category_hover": [231, 231, 231, 255],
"setting_category_active": [240, 248, 255, 255],
"setting_category_active_hover": [233, 244, 245, 255],
"setting_category_text": [35, 35, 35, 255],
"setting_category": [255, 255, 255, 255],
"setting_category_disabled": [255, 255, 255, 255],
"setting_category_hover": [245, 245, 245, 255],
"setting_category_active": [255, 255, 255, 255],
"setting_category_active_hover": [245, 245, 245, 255],
"setting_category_text": [24, 41, 77, 255],
"setting_category_border": [127, 127, 127, 255],
"setting_category_disabled_border": [127, 127, 127, 255],
"setting_category_hover_border": [12, 159, 227, 255],
"setting_category_active_border": [245, 245, 245, 255],
"setting_category_active_hover_border": [245, 245, 245, 255],
"setting_control": [255, 255, 255, 255],
"setting_control_highlight": [245, 245, 245, 255],
"setting_control_border": [174, 174, 174, 255],
"setting_control_text": [0, 0, 0, 255],
"setting_control_depth_line": [162, 192, 227, 255],
"setting_control_hover": [139, 143, 153, 255],
"setting_control_selected": [35, 35, 35, 255],
"setting_control_revert": [85, 85, 85, 255],
"setting_unit": [174, 174, 174, 255],
"setting_control_selected": [24, 41, 77, 255],
"setting_control_highlight": [255, 255, 255, 0],
"setting_control_border": [127, 127, 127, 255],
"setting_control_border_highlight": [12, 169, 227, 255],
"setting_control_text": [24, 41, 77, 255],
"setting_control_depth_line": [127, 127, 127, 255],
"setting_control_revert": [127, 127, 127, 255],
"setting_unit": [127, 127, 127, 255],
"setting_validation_error": [255, 57, 14, 255],
"setting_validation_warning": [255, 186, 15, 255],
"setting_validation_ok": [255, 255, 255, 255],
"progressbar_background": [208, 210, 211, 255],
"progressbar_control": [12, 169, 227, 255],
"progressbar_background": [245, 245, 245, 255],
"progressbar_control": [24, 41, 77, 255],
"slider_groove": [245, 245, 245, 255],
"slider_groove_border": [139, 143, 153, 255],
"slider_groove_fill": [139, 143, 153, 255],
"slider_groove_border": [127, 127, 127, 255],
"slider_groove_fill": [127, 127, 127, 255],
"slider_handle": [32, 166, 219, 255],
"slider_handle_hover": [77, 182, 226, 255],
"slider_text_background": [255, 255, 255, 255],
"checkbox": [255, 255, 255, 255],
"checkbox_hover": [245, 245, 245, 255],
"checkbox_border": [174, 174, 174, 255],
"checkbox_mark": [35, 35, 35, 255],
"checkbox_text": [0, 0, 0, 255],
"checkbox_hover": [255, 255, 255, 255],
"checkbox_border": [127, 127, 127, 255],
"checkbox_border_hover": [12, 169, 227, 255],
"checkbox_mark": [24, 41, 77, 255],
"checkbox_text": [24, 41, 77, 255],
"tooltip": [255, 225, 146, 255],
"tooltip": [12, 169, 227, 255],
"tooltip_text": [255, 255, 255, 255],
"message_background": [255, 255, 255, 255],
"message_text": [32, 166, 219, 255],
"message_dismiss": [139, 143, 153, 255],
"message_dismiss": [127, 127, 127, 255],
"tool_panel_background": [255, 255, 255, 255],
"per_object_settings_panel_background": [255, 255, 255, 255],
"per_object_settings_panel_border": [208, 210, 211, 255]
"per_object_settings_panel_border": [127, 127, 127, 255]
},
"sizes": {
"window_margin": [1.5, 1.5],
"window_margin": [1.0, 1.0],
"default_margin": [1.0, 1.0],
"default_lining": [0.1, 0.1],
"default_lining": [0.08, 0.08],
"default_arrow": [0.8, 0.8],
"logo": [9.5, 2.0],
"sidebar": [26.0, 10.0],
"sidebar_header": [0.0, 3.8],
"sidebar_header_mode_toggle": [0.0, 2.4],
"sidebar_setup": [0.0, 2.6],
"sidebar_subParts": [0.0, 2.4],
"sidebar_specs_bar": [0.0, 2.2],
"sidebar_inputFields": [0.0, 1.9],
"sidebar": [30.0, 10.0],
"sidebar_header": [0.0, 4.0],
"sidebar_header_mode_toggle": [0.0, 2.0],
"sidebar_lining": [0.5, 0.5],
"sidebar_setup": [0.0, 2.0],
"sidebar_inputfields": [0.0, 2.0],
"simple_mode_infill_caption": [0.0, 5.0],
"simple_mode_infill_height": [0.0, 8.0],
@ -161,8 +182,8 @@
"section_icon": [1.6, 1.6],
"section_icon_column": [2.8, 0.0],
"setting": [21.0, 1.8],
"setting_control": [7.0, 2.0],
"setting": [19.0, 1.8],
"setting_control": [10.0, 2.0],
"setting_control_depth_margin": [1.4, 0.0],
"setting_preferences_button_margin": [3.3, 0.0],
"setting_control_margin": [0.0, 0.0],
@ -171,31 +192,35 @@
"standard_list_lineheight": [1.5, 1.5],
"standard_list_input": [20.0, 25.0],
"standard_arrow": [0.6, 0.6],
"standard_arrow": [0.8, 0.8],
"button": [3.8, 3.8],
"button_icon": [2.6, 2.6],
"button": [4, 4],
"button_icon": [3, 3],
"button_lining": [0, 0],
"button_tooltip": [1.0, 1.3],
"button_tooltip_arrow": [0.25, 0.25],
"progressbar": [26.0, 0.8],
"progressbar_radius": [0.4, 0.4],
"progressbar_control": [8.0, 0.8],
"progressbar_padding": [0.0, 1.0],
"scrollbar": [0.7, 0.5],
"scrollbar": [0.75, 0.5],
"slider_groove": [0.5, 0.5],
"slider_handle": [1.5, 1.5],
"slider_layerview_size": [1.0, 16.0],
"slider_layerview_background": [4.0, 0.0],
"slider_layerview_smalltext_margin": [0.3, 0.00],
"slider_layerview_background_extension": [0.0, 2.2],
"slider_layerview_margin": [3.0, 3.0],
"checkbox": [1.5, 1.5],
"checkbox": [2.0, 2.0],
"tooltip": [20.0, 10.0],
"tooltip_margins": [1.0, 1.0],
"tooltip_arrow_margins": [2.0, 2.0],
"save_button_border": [0.06, 0.06],
"save_button_header": [0.0, 3.2],
"save_button_text_margin": [0.3, 0.6],
"save_button_slicing_bar": [0.0, 2.2],
"save_button_label_margin": [0.5, 0.5],
@ -209,8 +234,13 @@
"message_close": [1.25, 1.25],
"message_button": [6.0, 1.8],
"infill_button_margin": [0.5, 0.5],
"per_object_settings_button": [2.0, 2.0],
"per_object_settings_panel": [24.0, 10.0],
"per_object_settings_panel_border": [0.1, 0.1]
"per_object_settings_panel_border": [0.1, 0.1],
"jobspecs": [20, 0],
"jobspecs_line": [2.0, 2.0]
}
}