mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-05 21:13:58 -06:00
Fix code style
Most stuff here was recently changed. Some of it was where I found a pattern in something that was likely copy-pasted from somewhere else, so I did a global search and replace on that. Contributes to issue CURA-5784.
This commit is contained in:
parent
a4c609d514
commit
1bcd134f85
24 changed files with 433 additions and 243 deletions
|
@ -40,7 +40,7 @@ Button
|
|||
id: popup
|
||||
|
||||
y: parent.height + UM.Theme.getSize("default_arrow").height
|
||||
x: (parent.width - width)
|
||||
x: parent.width - width
|
||||
|
||||
closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutsideParent
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright (c) 2015 Ultimaker B.V.
|
||||
// Copyright (c) 2018 Ultimaker B.V.
|
||||
// Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
pragma Singleton
|
||||
|
@ -67,7 +67,7 @@ Item
|
|||
|
||||
property alias browsePackages: browsePackagesAction
|
||||
|
||||
UM.I18nCatalog{id: catalog; name:"cura"}
|
||||
UM.I18nCatalog{id: catalog; name: "cura"}
|
||||
|
||||
Action
|
||||
{
|
||||
|
|
|
@ -26,7 +26,7 @@ UM.MainWindow
|
|||
UM.I18nCatalog
|
||||
{
|
||||
id: catalog
|
||||
name:"cura"
|
||||
name: "cura"
|
||||
}
|
||||
|
||||
function showTooltip(item, position, text)
|
||||
|
@ -236,7 +236,7 @@ UM.MainWindow
|
|||
textRole: "name"
|
||||
|
||||
// update the model's active index
|
||||
function updateItemActiveFlags ()
|
||||
function updateItemActiveFlags()
|
||||
{
|
||||
currentIndex = getActiveIndex()
|
||||
for (var i = 0; i < model.rowCount(); i++)
|
||||
|
@ -316,7 +316,7 @@ UM.MainWindow
|
|||
|
||||
Loader
|
||||
{
|
||||
// A stage can control this area. If nothing is set, it will therefor show the 3D view.
|
||||
// A stage can control this area. If nothing is set, it will therefore show the 3D view.
|
||||
id: main
|
||||
|
||||
anchors
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright (c) 2015 Ultimaker B.V.
|
||||
// Copyright (c) 2018 Ultimaker B.V.
|
||||
// Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.2
|
||||
|
@ -45,7 +45,7 @@ UM.Dialog
|
|||
anchors.topMargin: ((base.minimumWidth - width) / 2) | 0
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
|
||||
UM.I18nCatalog{id: catalog; name:"cura"}
|
||||
UM.I18nCatalog{id: catalog; name: "cura"}
|
||||
}
|
||||
|
||||
Label
|
||||
|
@ -129,32 +129,32 @@ UM.Dialog
|
|||
}
|
||||
Component.onCompleted:
|
||||
{
|
||||
projectsModel.append({ name:"Cura", description: catalog.i18nc("@label", "Graphical user interface"), license: "LGPLv3", url: "https://github.com/Ultimaker/Cura" });
|
||||
projectsModel.append({ name:"Uranium", description: catalog.i18nc("@label", "Application framework"), license: "LGPLv3", url: "https://github.com/Ultimaker/Uranium" });
|
||||
projectsModel.append({ name:"CuraEngine", description: catalog.i18nc("@label", "G-code generator"), license: "AGPLv3", url: "https://github.com/Ultimaker/CuraEngine" });
|
||||
projectsModel.append({ name:"libArcus", description: catalog.i18nc("@label", "Interprocess communication library"), license: "LGPLv3", url: "https://github.com/Ultimaker/libArcus" });
|
||||
projectsModel.append({ name: "Cura", description: catalog.i18nc("@label", "Graphical user interface"), license: "LGPLv3", url: "https://github.com/Ultimaker/Cura" });
|
||||
projectsModel.append({ name: "Uranium", description: catalog.i18nc("@label", "Application framework"), license: "LGPLv3", url: "https://github.com/Ultimaker/Uranium" });
|
||||
projectsModel.append({ name: "CuraEngine", description: catalog.i18nc("@label", "G-code generator"), license: "AGPLv3", url: "https://github.com/Ultimaker/CuraEngine" });
|
||||
projectsModel.append({ name: "libArcus", description: catalog.i18nc("@label", "Interprocess communication library"), license: "LGPLv3", url: "https://github.com/Ultimaker/libArcus" });
|
||||
|
||||
projectsModel.append({ name:"Python", description: catalog.i18nc("@label", "Programming language"), license: "Python", url: "http://python.org/" });
|
||||
projectsModel.append({ name:"Qt5", description: catalog.i18nc("@label", "GUI framework"), license: "LGPLv3", url: "https://www.qt.io/" });
|
||||
projectsModel.append({ name:"PyQt", description: catalog.i18nc("@label", "GUI framework bindings"), license: "GPL", url: "https://riverbankcomputing.com/software/pyqt" });
|
||||
projectsModel.append({ name:"SIP", description: catalog.i18nc("@label", "C/C++ Binding library"), license: "GPL", url: "https://riverbankcomputing.com/software/sip" });
|
||||
projectsModel.append({ name:"Protobuf", description: catalog.i18nc("@label", "Data interchange format"), license: "BSD", url: "https://developers.google.com/protocol-buffers" });
|
||||
projectsModel.append({ name:"SciPy", description: catalog.i18nc("@label", "Support library for scientific computing"), license: "BSD-new", url: "https://www.scipy.org/" });
|
||||
projectsModel.append({ name:"NumPy", description: catalog.i18nc("@label", "Support library for faster math"), license: "BSD", url: "http://www.numpy.org/" });
|
||||
projectsModel.append({ name:"NumPy-STL", description: catalog.i18nc("@label", "Support library for handling STL files"), license: "BSD", url: "https://github.com/WoLpH/numpy-stl" });
|
||||
projectsModel.append({ name:"Shapely", description: catalog.i18nc("@label", "Support library for handling planar objects"), license: "BSD", url: "https://github.com/Toblerity/Shapely" });
|
||||
projectsModel.append({ name:"Trimesh", description: catalog.i18nc("@label", "Support library for handling triangular meshes"), license: "MIT", url: "https://trimsh.org" });
|
||||
projectsModel.append({ name:"NetworkX", description: catalog.i18nc("@label", "Support library for analysis of complex networks"), license: "3-clause BSD", url: "https://networkx.github.io/" });
|
||||
projectsModel.append({ name:"libSavitar", description: catalog.i18nc("@label", "Support library for handling 3MF files"), license: "LGPLv3", url: "https://github.com/ultimaker/libsavitar" });
|
||||
projectsModel.append({ name:"libCharon", description: catalog.i18nc("@label", "Support library for file metadata and streaming"), license: "LGPLv3", url: "https://github.com/ultimaker/libcharon" });
|
||||
projectsModel.append({ name:"PySerial", description: catalog.i18nc("@label", "Serial communication library"), license: "Python", url: "http://pyserial.sourceforge.net/" });
|
||||
projectsModel.append({ name:"python-zeroconf", description: catalog.i18nc("@label", "ZeroConf discovery library"), license: "LGPL", url: "https://github.com/jstasiak/python-zeroconf" });
|
||||
projectsModel.append({ name:"Clipper", description: catalog.i18nc("@label", "Polygon clipping library"), license: "Boost", url: "http://www.angusj.com/delphi/clipper.php" });
|
||||
projectsModel.append({ name:"Requests", description: catalog.i18nc("@Label", "Python HTTP library"), license: "GPL", url: "http://docs.python-requests.org" });
|
||||
projectsModel.append({ name: "Python", description: catalog.i18nc("@label", "Programming language"), license: "Python", url: "http://python.org/" });
|
||||
projectsModel.append({ name: "Qt5", description: catalog.i18nc("@label", "GUI framework"), license: "LGPLv3", url: "https://www.qt.io/" });
|
||||
projectsModel.append({ name: "PyQt", description: catalog.i18nc("@label", "GUI framework bindings"), license: "GPL", url: "https://riverbankcomputing.com/software/pyqt" });
|
||||
projectsModel.append({ name: "SIP", description: catalog.i18nc("@label", "C/C++ Binding library"), license: "GPL", url: "https://riverbankcomputing.com/software/sip" });
|
||||
projectsModel.append({ name: "Protobuf", description: catalog.i18nc("@label", "Data interchange format"), license: "BSD", url: "https://developers.google.com/protocol-buffers" });
|
||||
projectsModel.append({ name: "SciPy", description: catalog.i18nc("@label", "Support library for scientific computing"), license: "BSD-new", url: "https://www.scipy.org/" });
|
||||
projectsModel.append({ name: "NumPy", description: catalog.i18nc("@label", "Support library for faster math"), license: "BSD", url: "http://www.numpy.org/" });
|
||||
projectsModel.append({ name: "NumPy-STL", description: catalog.i18nc("@label", "Support library for handling STL files"), license: "BSD", url: "https://github.com/WoLpH/numpy-stl" });
|
||||
projectsModel.append({ name: "Shapely", description: catalog.i18nc("@label", "Support library for handling planar objects"), license: "BSD", url: "https://github.com/Toblerity/Shapely" });
|
||||
projectsModel.append({ name: "Trimesh", description: catalog.i18nc("@label", "Support library for handling triangular meshes"), license: "MIT", url: "https://trimsh.org" });
|
||||
projectsModel.append({ name: "NetworkX", description: catalog.i18nc("@label", "Support library for analysis of complex networks"), license: "3-clause BSD", url: "https://networkx.github.io/" });
|
||||
projectsModel.append({ name: "libSavitar", description: catalog.i18nc("@label", "Support library for handling 3MF files"), license: "LGPLv3", url: "https://github.com/ultimaker/libsavitar" });
|
||||
projectsModel.append({ name: "libCharon", description: catalog.i18nc("@label", "Support library for file metadata and streaming"), license: "LGPLv3", url: "https://github.com/ultimaker/libcharon" });
|
||||
projectsModel.append({ name: "PySerial", description: catalog.i18nc("@label", "Serial communication library"), license: "Python", url: "http://pyserial.sourceforge.net/" });
|
||||
projectsModel.append({ name: "python-zeroconf", description: catalog.i18nc("@label", "ZeroConf discovery library"), license: "LGPL", url: "https://github.com/jstasiak/python-zeroconf" });
|
||||
projectsModel.append({ name: "Clipper", description: catalog.i18nc("@label", "Polygon clipping library"), license: "Boost", url: "http://www.angusj.com/delphi/clipper.php" });
|
||||
projectsModel.append({ name: "Requests", description: catalog.i18nc("@Label", "Python HTTP library"), license: "GPL", url: "http://docs.python-requests.org" });
|
||||
|
||||
projectsModel.append({ name:"Noto Sans", description: catalog.i18nc("@label", "Font"), license: "Apache 2.0", url: "https://www.google.com/get/noto/" });
|
||||
projectsModel.append({ name:"Font-Awesome-SVG-PNG", description: catalog.i18nc("@label", "SVG icons"), license: "SIL OFL 1.1", url: "https://github.com/encharm/Font-Awesome-SVG-PNG" });
|
||||
projectsModel.append({ name:"AppImageKit", description: catalog.i18nc("@label", "Linux cross-distribution application deployment"), license: "MIT", url: "https://github.com/AppImage/AppImageKit" });
|
||||
projectsModel.append({ name: "Noto Sans", description: catalog.i18nc("@label", "Font"), license: "Apache 2.0", url: "https://www.google.com/get/noto/" });
|
||||
projectsModel.append({ name: "Font-Awesome-SVG-PNG", description: catalog.i18nc("@label", "SVG icons"), license: "SIL OFL 1.1", url: "https://github.com/encharm/Font-Awesome-SVG-PNG" });
|
||||
projectsModel.append({ name: "AppImageKit", description: catalog.i18nc("@label", "Linux cross-distribution application deployment"), license: "MIT", url: "https://github.com/AppImage/AppImageKit" });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright (c) 2017 Ultimaker B.V.
|
||||
// Copyright (c) 2018 Ultimaker B.V.
|
||||
// Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.2
|
||||
|
@ -15,7 +15,7 @@ Item {
|
|||
property bool activity: CuraApplication.platformActivity
|
||||
property string fileBaseName: PrintInformation.baseName
|
||||
|
||||
UM.I18nCatalog { id: catalog; name:"cura"}
|
||||
UM.I18nCatalog { id: catalog; name: "cura"}
|
||||
|
||||
height: childrenRect.height
|
||||
|
||||
|
|
|
@ -128,7 +128,8 @@ Item
|
|||
Instantiator
|
||||
{
|
||||
model: Cura.ExtrudersModel { simpleNames: true }
|
||||
Menu {
|
||||
Menu
|
||||
{
|
||||
title: model.name
|
||||
|
||||
NozzleMenu { title: Cura.MachineManager.activeDefinitionVariantsName; visible: Cura.MachineManager.hasVariants; extruderIndex: index }
|
||||
|
@ -267,7 +268,8 @@ Item
|
|||
}
|
||||
}
|
||||
|
||||
UM.ExtensionModel {
|
||||
UM.ExtensionModel
|
||||
{
|
||||
id: curaExtensions
|
||||
}
|
||||
|
||||
|
@ -291,7 +293,8 @@ Item
|
|||
Connections
|
||||
{
|
||||
target: Cura.Actions.browsePackages
|
||||
onTriggered: {
|
||||
onTriggered:
|
||||
{
|
||||
curaExtensions.callExtensionMethod("Toolbox", "browsePackages")
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@ Rectangle
|
|||
// Height has an extra 2x margin for the top & bottom margin.
|
||||
height: childrenRect.height + 2 * UM.Theme.getSize("default_margin").width
|
||||
|
||||
Cura.ExtrudersModel { id: extrudersModel; }
|
||||
Cura.ExtrudersModel { id: extrudersModel }
|
||||
|
||||
ListView
|
||||
{
|
||||
|
@ -41,7 +41,7 @@ Rectangle
|
|||
margins: UM.Theme.getSize("sidebar_margin").width
|
||||
}
|
||||
|
||||
ExclusiveGroup { id: extruderMenuGroup; }
|
||||
ExclusiveGroup { id: extruderMenuGroup }
|
||||
|
||||
orientation: ListView.Horizontal
|
||||
|
||||
|
@ -69,8 +69,10 @@ Rectangle
|
|||
{
|
||||
anchors.fill: parent
|
||||
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
||||
onClicked: {
|
||||
switch (mouse.button) {
|
||||
onClicked:
|
||||
{
|
||||
switch (mouse.button)
|
||||
{
|
||||
case Qt.LeftButton:
|
||||
extruder_enabled = Cura.MachineManager.getExtruder(model.index).isEnabled
|
||||
if (extruder_enabled)
|
||||
|
@ -114,7 +116,8 @@ Rectangle
|
|||
{
|
||||
anchors.fill: parent
|
||||
border.width: control.checked ? UM.Theme.getSize("default_lining").width * 2 : UM.Theme.getSize("default_lining").width
|
||||
border.color: {
|
||||
border.color:
|
||||
{
|
||||
if (Cura.MachineManager.getExtruder(index).isEnabled)
|
||||
{
|
||||
if(control.checked || control.pressed)
|
||||
|
@ -128,13 +131,15 @@ Rectangle
|
|||
}
|
||||
return UM.Theme.getColor("action_button_disabled_border")
|
||||
}
|
||||
color: {
|
||||
color:
|
||||
{
|
||||
if (Cura.MachineManager.getExtruder(index).isEnabled)
|
||||
{
|
||||
if(control.checked || control.pressed)
|
||||
{
|
||||
return UM.Theme.getColor("action_button_active");
|
||||
} else if (control.hovered)
|
||||
}
|
||||
else if (control.hovered)
|
||||
{
|
||||
return UM.Theme.getColor("action_button_hovered")
|
||||
}
|
||||
|
@ -157,13 +162,15 @@ Rectangle
|
|||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.left: parent.left
|
||||
|
||||
color: {
|
||||
color:
|
||||
{
|
||||
if (Cura.MachineManager.getExtruder(index).isEnabled)
|
||||
{
|
||||
if(control.checked || control.pressed)
|
||||
{
|
||||
return UM.Theme.getColor("action_button_active_text");
|
||||
} else if (control.hovered)
|
||||
}
|
||||
else if (control.hovered)
|
||||
{
|
||||
return UM.Theme.getColor("action_button_hovered_text")
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@ import Cura 1.0 as Cura
|
|||
Item
|
||||
{
|
||||
id: base;
|
||||
UM.I18nCatalog { id: catalog; name:"cura"}
|
||||
UM.I18nCatalog { id: catalog; name: "cura"}
|
||||
|
||||
height: childrenRect.height + UM.Theme.getSize("sidebar_margin").height
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright (c) 2017 Ultimaker B.V.
|
||||
// Copyright (c) 2018 Ultimaker B.V.
|
||||
// Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.7
|
||||
|
@ -31,7 +31,7 @@ Rectangle
|
|||
property variant printMaterialNames: PrintInformation.materialNames
|
||||
|
||||
color: UM.Theme.getColor("sidebar")
|
||||
UM.I18nCatalog { id: catalog; name:"cura"}
|
||||
UM.I18nCatalog { id: catalog; name: "cura"}
|
||||
|
||||
Timer {
|
||||
id: tooltipDelayTimer
|
||||
|
@ -70,7 +70,7 @@ Rectangle
|
|||
time -= minutes * 60
|
||||
var seconds = Math.floor(time);
|
||||
|
||||
var finalTime = strPadLeft(hours, "0", 2) + ':' + strPadLeft(minutes,'0',2)+ ':' + strPadLeft(seconds,'0',2);
|
||||
var finalTime = strPadLeft(hours, "0", 2) + ":" + strPadLeft(minutes, "0", 2) + ":" + strPadLeft(seconds, "0", 2);
|
||||
return finalTime;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright (c) 2017 Ultimaker B.V.
|
||||
// Copyright (c) 2018 Ultimaker B.V.
|
||||
// Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.1
|
||||
|
@ -134,7 +134,7 @@ UM.PreferencesPage
|
|||
UM.PluginsModel { id: plugins }
|
||||
|
||||
//: Language selection label
|
||||
UM.I18nCatalog{id: catalog; name:"cura"}
|
||||
UM.I18nCatalog{id: catalog; name: "cura"}
|
||||
|
||||
Label
|
||||
{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright (c) 2017 Ultimaker B.V.
|
||||
// Copyright (c) 2018 Ultimaker B.V.
|
||||
// Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.7
|
||||
|
@ -26,7 +26,7 @@ Rectangle
|
|||
property variant printMaterialNames: PrintInformation.materialNames
|
||||
|
||||
color: UM.Theme.getColor("sidebar")
|
||||
UM.I18nCatalog { id: catalog; name:"cura"}
|
||||
UM.I18nCatalog { id: catalog; name: "cura"}
|
||||
|
||||
// This widget doesn't show tooltips by itself. Instead it emits signals so others can do something with it.
|
||||
signal showTooltip(Item item, point location, string text)
|
||||
|
@ -59,7 +59,7 @@ Rectangle
|
|||
time -= minutes * 60
|
||||
var seconds = Math.floor(time);
|
||||
|
||||
var finalTime = strPadLeft(hours, "0", 2) + ':' + strPadLeft(minutes,'0',2)+ ':' + strPadLeft(seconds,'0',2);
|
||||
var finalTime = strPadLeft(hours, "0", 2) + ":" + strPadLeft(minutes, "0", 2) + ":" + strPadLeft(seconds, "0", 2);
|
||||
return finalTime;
|
||||
}
|
||||
|
||||
|
@ -152,7 +152,7 @@ Rectangle
|
|||
background: Rectangle
|
||||
{
|
||||
border.width: control.checked ? UM.Theme.getSize("default_lining").width * 2 : UM.Theme.getSize("default_lining").width
|
||||
border.color: (control.checked || control.pressed) ? UM.Theme.getColor("action_button_active_border") : control.hovered ? UM.Theme.getColor("action_button_hovered_border"): UM.Theme.getColor("action_button_border")
|
||||
border.color: (control.checked || control.pressed) ? UM.Theme.getColor("action_button_active_border") : control.hovered ? UM.Theme.getColor("action_button_hovered_border") : UM.Theme.getColor("action_button_border")
|
||||
|
||||
// for some reason, QtQuick decided to use the color of the background property as text color for the contentItem, so here it is
|
||||
color: (control.checked || control.pressed) ? UM.Theme.getColor("action_button_active") : control.hovered ? UM.Theme.getColor("action_button_hovered") : UM.Theme.getColor("action_button")
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright (c) 2017 Ultimaker B.V.
|
||||
// Copyright (c) 2018 Ultimaker B.V.
|
||||
// Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.7
|
||||
|
@ -173,7 +173,8 @@ Rectangle
|
|||
var weights = [];
|
||||
var costs = [];
|
||||
var someCostsKnown = false;
|
||||
if(base.printMaterialLengths) {
|
||||
if(base.printMaterialLengths)
|
||||
{
|
||||
for(var index = 0; index < base.printMaterialLengths.length; index++)
|
||||
{
|
||||
if(base.printMaterialLengths[index] > 0)
|
||||
|
|
|
@ -13,7 +13,7 @@ import Cura 1.0 as Cura
|
|||
Item
|
||||
{
|
||||
id: base;
|
||||
UM.I18nCatalog { id: catalog; name:"cura"}
|
||||
UM.I18nCatalog { id: catalog; name: "cura"}
|
||||
|
||||
property real progress: UM.Backend.progress
|
||||
property int backendState: UM.Backend.state
|
||||
|
@ -36,7 +36,7 @@ Item
|
|||
case 2:
|
||||
return catalog.i18nc("@label:PrintjobStatus", "Slicing...");
|
||||
case 3:
|
||||
return catalog.i18nc("@label:PrintjobStatus %1 is target operation","Ready to %1").arg(UM.OutputDeviceManager.activeDeviceShortDescription);
|
||||
return catalog.i18nc("@label:PrintjobStatus %1 is target operation", "Ready to %1").arg(UM.OutputDeviceManager.activeDeviceShortDescription);
|
||||
case 4:
|
||||
return catalog.i18nc("@label:PrintjobStatus", "Unable to Slice");
|
||||
case 5:
|
||||
|
@ -48,16 +48,20 @@ Item
|
|||
|
||||
function sliceOrStopSlicing()
|
||||
{
|
||||
try {
|
||||
try
|
||||
{
|
||||
if ([1, 5].indexOf(base.backendState) != -1)
|
||||
{
|
||||
CuraApplication.backend.forceSlice();
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
CuraApplication.backend.stopSlicing();
|
||||
}
|
||||
} catch (e)
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
console.log('Could not start or stop slicing', e)
|
||||
console.log("Could not start or stop slicing.", e)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -203,50 +207,76 @@ Item
|
|||
sliceOrStopSlicing();
|
||||
}
|
||||
|
||||
style: ButtonStyle {
|
||||
style: ButtonStyle
|
||||
{
|
||||
background: Rectangle
|
||||
{
|
||||
border.width: UM.Theme.getSize("default_lining").width
|
||||
border.color:
|
||||
{
|
||||
if(!control.enabled)
|
||||
{
|
||||
return UM.Theme.getColor("action_button_disabled_border");
|
||||
}
|
||||
else if(control.pressed)
|
||||
{
|
||||
return UM.Theme.getColor("action_button_active_border");
|
||||
}
|
||||
else if(control.hovered)
|
||||
{
|
||||
return UM.Theme.getColor("action_button_hovered_border");
|
||||
}
|
||||
else
|
||||
{
|
||||
return UM.Theme.getColor("action_button_border");
|
||||
}
|
||||
}
|
||||
color:
|
||||
{
|
||||
if(!control.enabled)
|
||||
{
|
||||
return UM.Theme.getColor("action_button_disabled");
|
||||
}
|
||||
else if(control.pressed)
|
||||
{
|
||||
return UM.Theme.getColor("action_button_active");
|
||||
}
|
||||
else if(control.hovered)
|
||||
{
|
||||
return UM.Theme.getColor("action_button_hovered");
|
||||
}
|
||||
else
|
||||
{
|
||||
return UM.Theme.getColor("action_button");
|
||||
}
|
||||
}
|
||||
|
||||
Behavior on color { ColorAnimation { duration: 50; } }
|
||||
|
||||
implicitWidth: actualLabel.contentWidth + (UM.Theme.getSize("sidebar_margin").width * 2)
|
||||
|
||||
Label {
|
||||
Label
|
||||
{
|
||||
id: actualLabel
|
||||
anchors.centerIn: parent
|
||||
color:
|
||||
{
|
||||
if(!control.enabled)
|
||||
{
|
||||
return UM.Theme.getColor("action_button_disabled_text");
|
||||
}
|
||||
else if(control.pressed)
|
||||
{
|
||||
return UM.Theme.getColor("action_button_active_text");
|
||||
}
|
||||
else if(control.hovered)
|
||||
{
|
||||
return UM.Theme.getColor("action_button_hovered_text");
|
||||
}
|
||||
else
|
||||
{
|
||||
return UM.Theme.getColor("action_button_text");
|
||||
}
|
||||
}
|
||||
font: UM.Theme.getFont("action_button")
|
||||
text: control.text;
|
||||
|
@ -287,43 +317,61 @@ Item
|
|||
border.color:
|
||||
{
|
||||
if(!control.enabled)
|
||||
{
|
||||
return UM.Theme.getColor("action_button_disabled_border");
|
||||
}
|
||||
else if(control.pressed)
|
||||
{
|
||||
return UM.Theme.getColor("print_button_ready_pressed_border");
|
||||
}
|
||||
else if(control.hovered)
|
||||
{
|
||||
return UM.Theme.getColor("print_button_ready_hovered_border");
|
||||
}
|
||||
else
|
||||
{
|
||||
return UM.Theme.getColor("print_button_ready_border");
|
||||
}
|
||||
}
|
||||
color:
|
||||
{
|
||||
if(!control.enabled)
|
||||
{
|
||||
return UM.Theme.getColor("action_button_disabled");
|
||||
}
|
||||
else if(control.pressed)
|
||||
{
|
||||
return UM.Theme.getColor("print_button_ready_pressed");
|
||||
}
|
||||
else if(control.hovered)
|
||||
{
|
||||
return UM.Theme.getColor("print_button_ready_hovered");
|
||||
}
|
||||
else
|
||||
{
|
||||
return UM.Theme.getColor("print_button_ready");
|
||||
}
|
||||
}
|
||||
|
||||
Behavior on color { ColorAnimation { duration: 50; } }
|
||||
|
||||
implicitWidth: actualLabel.contentWidth + (UM.Theme.getSize("sidebar_margin").width * 2)
|
||||
|
||||
Label {
|
||||
Label
|
||||
{
|
||||
id: actualLabel
|
||||
anchors.centerIn: parent
|
||||
color:control.enabled ? UM.Theme.getColor("print_button_ready_text") : UM.Theme.getColor("action_button_disabled_text")
|
||||
color: control.enabled ? UM.Theme.getColor("print_button_ready_text") : UM.Theme.getColor("action_button_disabled_text")
|
||||
font: UM.Theme.getFont("action_button")
|
||||
text: control.text;
|
||||
text: control.text
|
||||
}
|
||||
}
|
||||
label: Item { }
|
||||
}
|
||||
}
|
||||
|
||||
Button {
|
||||
Button
|
||||
{
|
||||
id: deviceSelectionMenu
|
||||
tooltip: catalog.i18nc("@info:tooltip","Select the active output device");
|
||||
anchors.top: parent.top
|
||||
|
@ -349,13 +397,16 @@ Item
|
|||
if(!control.enabled)
|
||||
{
|
||||
return UM.Theme.getColor("action_button_disabled_border")
|
||||
} else if(control.pressed)
|
||||
}
|
||||
else if(control.pressed)
|
||||
{
|
||||
return UM.Theme.getColor("print_button_ready_pressed_border")
|
||||
} else if(control.hovered)
|
||||
}
|
||||
else if(control.hovered)
|
||||
{
|
||||
return UM.Theme.getColor("print_button_ready_hovered_border")
|
||||
} else
|
||||
}
|
||||
else
|
||||
{
|
||||
return UM.Theme.getColor("print_button_ready_border")
|
||||
}
|
||||
|
@ -365,13 +416,16 @@ Item
|
|||
if(!control.enabled)
|
||||
{
|
||||
return UM.Theme.getColor("action_button_disabled")
|
||||
} else if(control.pressed)
|
||||
}
|
||||
else if(control.pressed)
|
||||
{
|
||||
return UM.Theme.getColor("print_button_ready_pressed")
|
||||
} else if(control.hovered)
|
||||
}
|
||||
else if(control.hovered)
|
||||
{
|
||||
return UM.Theme.getColor("print_button_ready_hovered")
|
||||
} else
|
||||
}
|
||||
else
|
||||
{
|
||||
return UM.Theme.getColor("print_button_ready")
|
||||
}
|
||||
|
@ -391,7 +445,7 @@ Item
|
|||
sourceSize.width: width
|
||||
sourceSize.height: height
|
||||
color: control.enabled ? UM.Theme.getColor("print_button_ready_text") : UM.Theme.getColor("action_button_disabled_text")
|
||||
source: UM.Theme.getIcon("arrow_bottom");
|
||||
source: UM.Theme.getIcon("arrow_bottom")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -406,8 +460,8 @@ Item
|
|||
{
|
||||
text: model.description
|
||||
checkable: true;
|
||||
checked: model.id == UM.OutputDeviceManager.activeDevice;
|
||||
exclusiveGroup: devicesMenuGroup;
|
||||
checked: model.id == UM.OutputDeviceManager.activeDevice
|
||||
exclusiveGroup: devicesMenuGroup
|
||||
onTriggered:
|
||||
{
|
||||
UM.OutputDeviceManager.setActiveDevice(model.id);
|
||||
|
@ -416,9 +470,9 @@ Item
|
|||
onObjectAdded: devicesMenu.insertItem(index, object)
|
||||
onObjectRemoved: devicesMenu.removeItem(object)
|
||||
}
|
||||
ExclusiveGroup { id: devicesMenuGroup; }
|
||||
ExclusiveGroup { id: devicesMenuGroup }
|
||||
}
|
||||
}
|
||||
UM.OutputDevicesModel { id: devicesModel; }
|
||||
UM.OutputDevicesModel { id: devicesModel }
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue