Merge branch 'master' into CURA-6435_new_style_add_machine

This commit is contained in:
Lipu Fei 2019-04-10 09:06:55 +02:00 committed by GitHub
commit 0e49d3dc12
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
25 changed files with 222 additions and 157 deletions

View File

@ -60,13 +60,11 @@ class ConvexHullDecorator(SceneNodeDecorator):
previous_node = self._node previous_node = self._node
# Disconnect from previous node signals # Disconnect from previous node signals
if previous_node is not None and node is not previous_node: if previous_node is not None and node is not previous_node:
previous_node.transformationChanged.disconnect(self._onChanged) previous_node.boundingBoxChanged.disconnect(self._onChanged)
previous_node.parentChanged.disconnect(self._onChanged)
super().setNode(node) super().setNode(node)
# Mypy doesn't understand that self._node is no longer optional, so just use the node.
node.transformationChanged.connect(self._onChanged) node.boundingBoxChanged.connect(self._onChanged)
node.parentChanged.connect(self._onChanged)
self._onChanged() self._onChanged()

View File

@ -362,7 +362,6 @@ class MachineManager(QObject):
# Mark global stack as invalid # Mark global stack as invalid
ConfigurationErrorMessage.getInstance().addFaultyContainers(global_stack.getId()) ConfigurationErrorMessage.getInstance().addFaultyContainers(global_stack.getId())
return # We're done here return # We're done here
ExtruderManager.getInstance().setActiveExtruderIndex(0) # Switch to first extruder
self._global_container_stack = global_stack self._global_container_stack = global_stack
self._application.setGlobalContainerStack(global_stack) self._application.setGlobalContainerStack(global_stack)
@ -370,6 +369,11 @@ class MachineManager(QObject):
self._initMachineState(global_stack) self._initMachineState(global_stack)
self._onGlobalContainerChanged() self._onGlobalContainerChanged()
# Switch to the first enabled extruder
self.updateDefaultExtruder()
default_extruder_position = int(self.defaultExtruderPosition)
ExtruderManager.getInstance().setActiveExtruderIndex(default_extruder_position)
self.__emitChangedSignals() self.__emitChangedSignals()
## Given a definition id, return the machine with this id. ## Given a definition id, return the machine with this id.
@ -1626,6 +1630,7 @@ class MachineManager(QObject):
return abbr_machine return abbr_machine
@pyqtSlot(str, result = str)
def getMachineTypeNameFromId(self, machine_type_id: str) -> str: def getMachineTypeNameFromId(self, machine_type_id: str) -> str:
machine_type_name = "" machine_type_name = ""
results = self._container_registry.findDefinitionContainersMetadata(id = machine_type_id) results = self._container_registry.findDefinitionContainersMetadata(id = machine_type_id)

View File

@ -20,12 +20,12 @@ Item
anchors.right: parent.right anchors.right: parent.right
anchors.top: parent.top anchors.top: parent.top
property int labelWidth: 180 property int labelWidth: 210 * screenScaleFactor
property int controlWidth: UM.Theme.getSize("setting_control").width * 3 / 4 property int controlWidth: (UM.Theme.getSize("setting_control").width * 3 / 4) | 0
property var labelFont: UM.Theme.getFont("medium") property var labelFont: UM.Theme.getFont("medium")
property int columnWidth: (parent.width - 2 * UM.Theme.getSize("default_margin").width) / 2 property int columnWidth: ((parent.width - 2 * UM.Theme.getSize("default_margin").width) / 2) | 0
property int columnSpacing: 3 property int columnSpacing: 3 * screenScaleFactor
property int propertyStoreIndex: manager.storeContainerIndex // definition_changes property int propertyStoreIndex: manager.storeContainerIndex // definition_changes
property string extruderStackId: "" property string extruderStackId: ""

View File

@ -20,12 +20,12 @@ Item
anchors.right: parent.right anchors.right: parent.right
anchors.top: parent.top anchors.top: parent.top
property int labelWidth: 130 property int labelWidth: 120 * screenScaleFactor
property int controlWidth: UM.Theme.getSize("setting_control").width * 3 / 4 property int controlWidth: (UM.Theme.getSize("setting_control").width * 3 / 4) | 0
property var labelFont: UM.Theme.getFont("default") property var labelFont: UM.Theme.getFont("default")
property int columnWidth: (parent.width - 2 * UM.Theme.getSize("default_margin").width) / 2 property int columnWidth: ((parent.width - 2 * UM.Theme.getSize("default_margin").width) / 2) | 0
property int columnSpacing: 3 property int columnSpacing: 3 * screenScaleFactor
property int propertyStoreIndex: manager.storeContainerIndex // definition_changes property int propertyStoreIndex: manager.storeContainerIndex // definition_changes
property string machineStackId: Cura.MachineManager.activeMachineId property string machineStackId: Cura.MachineManager.activeMachineId

View File

@ -1,150 +1,154 @@
// Copyright (c) 2018 Ultimaker B.V. // Copyright (c) 2019 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher. // Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.7 import QtQuick 2.10
import QtQuick.Controls 2.3
import QtQuick.Window 2.2 import QtQuick.Window 2.2
import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4
import UM 1.3 as UM import UM 1.3 as UM
import Cura 1.0 as Cura import Cura 1.1 as Cura
UM.Dialog Window
{ {
UM.I18nCatalog { id: catalog; name: "cura" }
id: baseDialog id: baseDialog
title: catalog.i18nc("@title:window", "More information on anonymous data collection") title: catalog.i18nc("@title:window", "More information on anonymous data collection")
visible: false visible: false
modality: Qt.ApplicationModal
minimumWidth: 500 * screenScaleFactor minimumWidth: 500 * screenScaleFactor
minimumHeight: 400 * screenScaleFactor minimumHeight: 400 * screenScaleFactor
width: minimumWidth width: minimumWidth
height: minimumHeight height: minimumHeight
property bool allowSendData: true // for saving the user's choice color: UM.Theme.getColor("main_background")
onAccepted: manager.setSendSliceInfo(allowSendData) property bool allowSendData: true // for saving the user's choice
onVisibilityChanged: onVisibilityChanged:
{ {
if (visible) if (visible)
{ {
baseDialog.allowSendData = UM.Preferences.getValue("info/send_slice_info"); baseDialog.allowSendData = UM.Preferences.getValue("info/send_slice_info")
if (baseDialog.allowSendData) if (baseDialog.allowSendData)
{ {
allowSendButton.checked = true; allowSendButton.checked = true
} }
else else
{ {
dontSendButton.checked = true; dontSendButton.checked = true
} }
} }
} }
// Main content area
Item Item
{ {
id: textRow anchors.fill: parent
anchors anchors.margins: UM.Theme.getSize("default_margin").width
{
top: parent.top
bottom: radioButtonsRow.top
bottomMargin: UM.Theme.getSize("default_margin").height
left: parent.left
right: parent.right
}
Label Item // Text part
{ {
id: headerText id: textRow
anchors anchors
{ {
top: parent.top top: parent.top
left: parent.left bottom: radioButtonsRow.top
right: parent.right
}
text: catalog.i18nc("@text:window", "Cura sends anonymous data to Ultimaker in order to improve the print quality and user experience. Below is an example of all the data that is sent.")
wrapMode: Text.WordWrap
}
TextArea
{
id: exampleData
anchors
{
top: headerText.bottom
topMargin: UM.Theme.getSize("default_margin").height
bottom: parent.bottom
bottomMargin: UM.Theme.getSize("default_margin").height bottomMargin: UM.Theme.getSize("default_margin").height
left: parent.left left: parent.left
right: parent.right right: parent.right
} }
text: manager.getExampleData() Label
readOnly: true
textFormat: TextEdit.PlainText
}
}
Column
{
id: radioButtonsRow
width: parent.width
anchors.bottom: buttonRow.top
anchors.bottomMargin: UM.Theme.getSize("default_margin").height
ExclusiveGroup { id: group }
RadioButton
{
id: dontSendButton
text: catalog.i18nc("@text:window", "I don't want to send this data")
exclusiveGroup: group
onClicked:
{ {
baseDialog.allowSendData = !checked; id: headerText
anchors
{
top: parent.top
left: parent.left
right: parent.right
}
text: catalog.i18nc("@text:window", "Cura sends anonymous data to Ultimaker in order to improve the print quality and user experience. Below is an example of all the data that is sent.")
wrapMode: Text.WordWrap
renderType: Text.NativeRendering
} }
}
RadioButton Cura.ScrollableTextArea
{
id: allowSendButton
text: catalog.i18nc("@text:window", "Allow sending this data to Ultimaker and help us improve Cura")
exclusiveGroup: group
onClicked:
{ {
baseDialog.allowSendData = checked; anchors
} {
} top: headerText.bottom
} topMargin: UM.Theme.getSize("default_margin").height
bottom: parent.bottom
bottomMargin: UM.Theme.getSize("default_margin").height
left: parent.left
right: parent.right
}
Item textArea.text: manager.getExampleData()
{ textArea.readOnly: true
id: buttonRow
anchors.bottom: parent.bottom
width: parent.width
anchors.bottomMargin: UM.Theme.getSize("default_margin").height
UM.I18nCatalog { id: catalog; name: "cura" }
Button
{
anchors.right: parent.right
text: catalog.i18nc("@action:button", "OK")
onClicked:
{
baseDialog.accepted()
baseDialog.hide()
} }
} }
Button Column // Radio buttons for agree and disagree
{ {
id: radioButtonsRow
anchors.left: parent.left anchors.left: parent.left
text: catalog.i18nc("@action:button", "Cancel") anchors.right: parent.right
onClicked: anchors.bottom: buttonRow.top
anchors.bottomMargin: UM.Theme.getSize("default_margin").height
Cura.RadioButton
{ {
baseDialog.rejected() id: dontSendButton
baseDialog.hide() text: catalog.i18nc("@text:window", "I don't want to send this data")
onClicked:
{
baseDialog.allowSendData = !checked
}
}
Cura.RadioButton
{
id: allowSendButton
text: catalog.i18nc("@text:window", "Allow sending this data to Ultimaker and help us improve Cura")
onClicked:
{
baseDialog.allowSendData = checked
}
}
}
Item // Bottom buttons
{
id: buttonRow
anchors.bottom: parent.bottom
anchors.left: parent.left
anchors.right: parent.right
height: childrenRect.height
Cura.PrimaryButton
{
anchors.right: parent.right
text: catalog.i18nc("@action:button", "OK")
onClicked:
{
manager.setSendSliceInfo(allowSendData)
baseDialog.hide()
}
}
Cura.SecondaryButton
{
anchors.left: parent.left
text: catalog.i18nc("@action:button", "Cancel")
onClicked:
{
baseDialog.hide()
}
} }
} }
} }

View File

@ -62,7 +62,7 @@ class SliceInfo(QObject, Extension):
def showMoreInfoDialog(self): def showMoreInfoDialog(self):
if self._more_info_dialog is None: if self._more_info_dialog is None:
self._more_info_dialog = self._createDialog("MoreInfoWindow.qml") self._more_info_dialog = self._createDialog("MoreInfoWindow.qml")
self._more_info_dialog.open() self._more_info_dialog.show()
def _createDialog(self, qml_name): def _createDialog(self, qml_name):
Logger.log("d", "Creating dialog [%s]", qml_name) Logger.log("d", "Creating dialog [%s]", qml_name)

View File

@ -559,9 +559,15 @@ class Toolbox(QObject, Extension):
if self._download_reply: if self._download_reply:
try: try:
self._download_reply.downloadProgress.disconnect(self._onDownloadProgress) self._download_reply.downloadProgress.disconnect(self._onDownloadProgress)
except TypeError: # Raised when the method is not connected to the signal yet. except (TypeError, RuntimeError): # Raised when the method is not connected to the signal yet.
pass # Don't need to disconnect. pass # Don't need to disconnect.
self._download_reply.abort() try:
self._download_reply.abort()
except RuntimeError:
# In some cases the garbage collector is a bit to agressive, which causes the dowload_reply
# to be deleted (especially if the machine has been put to sleep). As we don't know what exactly causes
# this (The issue probably lives in the bowels of (py)Qt somewhere), we can only catch and ignore it.
pass
self._download_reply = None self._download_reply = None
self._download_request = None self._download_request = None
self.setDownloadProgress(0) self.setDownloadProgress(0)

View File

@ -140,7 +140,7 @@ Item
{ {
id: printerConfiguration id: printerConfiguration
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
buildplate: printer ? "Glass" : null // 'Glass' as a default buildplate: printer ? catalog.i18nc("@label", "Glass") : null // 'Glass' as a default
configurations: configurations:
{ {
var configs = [] var configs = []

View File

@ -286,7 +286,7 @@ class UM3OutputDevicePlugin(OutputDevicePlugin):
self.refreshConnections() self.refreshConnections()
def _checkManualDevice(self, address): def _checkManualDevice(self, address: str) -> None:
# Check if a UM3 family device exists at this address. # Check if a UM3 family device exists at this address.
# If a printer responds, it will replace the preliminary printer created above # If a printer responds, it will replace the preliminary printer created above
# origin=manual is for tracking back the origin of the call # origin=manual is for tracking back the origin of the call
@ -307,7 +307,8 @@ class UM3OutputDevicePlugin(OutputDevicePlugin):
# - Something went wrong with checking the amount of printers the cluster has! # - Something went wrong with checking the amount of printers the cluster has!
# - Couldn't find printer at the address when trying to add it manually. # - Couldn't find printer at the address when trying to add it manually.
if address in self._manual_instances: if address in self._manual_instances:
self.removeManualDeviceSignal.emit(self.getPluginId(), "", address) key = "manual:" + address
self.removeManualDevice(key, address)
return return
if "system" in reply_url: if "system" in reply_url:

View File

@ -226,6 +226,9 @@ class USBPrinterOutputDevice(PrinterOutputDevice):
except SerialTimeoutException: except SerialTimeoutException:
Logger.log("w", "Timeout when sending command to printer via USB.") Logger.log("w", "Timeout when sending command to printer via USB.")
self._command_received.set() self._command_received.set()
except SerialException:
Logger.logException("w", "An unexpected exception occurred while writing to the serial.")
self.setConnectionState(ConnectionState.Error)
def _update(self): def _update(self):
while self._connection_state == ConnectionState.Connected and self._serial is not None: while self._connection_state == ConnectionState.Connected and self._serial is not None:
@ -371,10 +374,17 @@ class USBPrinterOutputDevice(PrinterOutputDevice):
self._sendCommand("N%d%s*%d" % (self._gcode_position, line, checksum)) self._sendCommand("N%d%s*%d" % (self._gcode_position, line, checksum))
progress = (self._gcode_position / len(self._gcode)) print_job = self._printers[0].activePrintJob
try:
progress = self._gcode_position / len(self._gcode)
except ZeroDivisionError:
# There is nothing to send!
if print_job is not None:
print_job.updateState("error")
return
elapsed_time = int(time() - self._print_start_time) elapsed_time = int(time() - self._print_start_time)
print_job = self._printers[0].activePrintJob
if print_job is None: if print_job is None:
controller = GenericOutputController(self) controller = GenericOutputController(self)
controller.setCanUpdateFirmware(True) controller.setCanUpdateFirmware(True)

View File

@ -44,7 +44,7 @@
}, },
"machine_end_gcode": "machine_end_gcode":
{ {
"default_value": ";End GCode\nM104 S0 ;extruder heater off \nM140 S0 ;heated bed heater off (if you have it)\nG91 ;relative positioning\nG1 E-1 F300 ;retract the filament a bit before lifting the nozzle, to release some of the pressure\nG1 Z+0.5 E-5 X-20 Y-20 F{travel_speed} ;move Z up a bit and retract filament even more\nG28 X0 Y0 ;move X/Y to min endstops, so the head is out of the way\nG28 Z0\nM84 ;steppers off\nG90 ;absolute positioning\n;{profile_string}" "default_value": ";End GCode\nM104 S0 ;extruder heater off \nM140 S0 ;heated bed heater off (if you have it)\nG91 ;relative positioning\nG1 E-1 F300 ;retract the filament a bit before lifting the nozzle, to release some of the pressure\nG1 Z+0.5 E-5 X-20 Y-20 F{speed_travel} ;move Z up a bit and retract filament even more\nG28 X0 Y0 ;move X/Y to min endstops, so the head is out of the way\nG28 Z0\nM84 ;steppers off\nG90 ;absolute positioning\n;{profile_string}"
} }
} }
} }

View File

@ -44,7 +44,7 @@
}, },
"machine_end_gcode": "machine_end_gcode":
{ {
"default_value": ";End GCode\nM104 S0 ;extruder heater off \nM140 S0 ;heated bed heater off (if you have it)\nG91 ;relative positioning\nG1 E-1 F300 ;retract the filament a bit before lifting the nozzle, to release some of the pressure\nG1 Z+0.5 E-5 X-20 Y-20 F{travel_speed} ;move Z up a bit and retract filament even more\nG28 X0 Y0 ;move X/Y to min endstops, so the head is out of the way\nG28 Z0\nM84 ;steppers off\nG90 ;absolute positioning\n;{profile_string}" "default_value": ";End GCode\nM104 S0 ;extruder heater off \nM140 S0 ;heated bed heater off (if you have it)\nG91 ;relative positioning\nG1 E-1 F300 ;retract the filament a bit before lifting the nozzle, to release some of the pressure\nG1 Z+0.5 E-5 X-20 Y-20 F{speed_travel} ;move Z up a bit and retract filament even more\nG28 X0 Y0 ;move X/Y to min endstops, so the head is out of the way\nG28 Z0\nM84 ;steppers off\nG90 ;absolute positioning\n;{profile_string}"
} }
} }
} }

View File

@ -43,7 +43,7 @@
}, },
"machine_end_gcode": "machine_end_gcode":
{ {
"default_value": ";End GCode\nM104 S0 ;extruder heater off \nM140 S0 ;heated bed heater off (if you have it)\nG91 ;relative positioning\nG1 E-1 F300 ;retract the filament a bit before lifting the nozzle, to release some of the pressure\nG1 Z+0.5 E-5 X-20 Y-20 F{travel_speed} ;move Z up a bit and retract filament even more\nG28 X0 Y0 ;move X/Y to min endstops, so the head is out of the way\nG28 Z0\nM84 ;steppers off\nG90 ;absolute positioning\n;{profile_string}" "default_value": ";End GCode\nM104 S0 ;extruder heater off \nM140 S0 ;heated bed heater off (if you have it)\nG91 ;relative positioning\nG1 E-1 F300 ;retract the filament a bit before lifting the nozzle, to release some of the pressure\nG1 Z+0.5 E-5 X-20 Y-20 F{speed_travel} ;move Z up a bit and retract filament even more\nG28 X0 Y0 ;move X/Y to min endstops, so the head is out of the way\nG28 Z0\nM84 ;steppers off\nG90 ;absolute positioning\n;{profile_string}"
} }
} }
} }

View File

@ -211,7 +211,7 @@ UM.MainWindow
for (var i = 0; i < drop.urls.length; i++) for (var i = 0; i < drop.urls.length; i++)
{ {
var filename = drop.urls[i]; var filename = drop.urls[i];
if (filename.endsWith(".curapackage")) if (filename.toLowerCase().endsWith(".curapackage"))
{ {
// Try to install plugin & close. // Try to install plugin & close.
CuraApplication.getPackageManager().installPackageViaDragAndDrop(filename); CuraApplication.getPackageManager().installPackageViaDragAndDrop(filename);

View File

@ -25,13 +25,17 @@ Button
property var outputDevice: null property var outputDevice: null
property var printerTypesList: [] property var printerTypesList: []
// Indicates if only to update the printer types list when this button is checked
property bool updatePrinterTypesOnlyWhenChecked: true
property var updatePrinterTypesFunction: updatePrinterTypesList property var updatePrinterTypesFunction: updatePrinterTypesList
// This function converts the printer type string to another string. // This function converts the printer type string to another string.
property var printerTypeLabelConversionFunction: Cura.MachineManager.getAbbreviatedMachineName property var printerTypeLabelConversionFunction: Cura.MachineManager.getAbbreviatedMachineName
function updatePrinterTypesList() function updatePrinterTypesList()
{ {
printerTypesList = (outputDevice != null) ? outputDevice.uniquePrinterTypes : [] var to_update = (updatePrinterTypesOnlyWhenChecked && checked) || !updatePrinterTypesOnlyWhenChecked
printerTypesList = (to_update && outputDevice != null) ? outputDevice.uniquePrinterTypes : []
} }
contentItem: Item contentItem: Item

View File

@ -97,6 +97,8 @@ Item
printerTypeLabelAutoFit: true printerTypeLabelAutoFit: true
// update printer types for all items in the list
updatePrinterTypesOnlyWhenChecked: false
updatePrinterTypesFunction: updateMachineTypes updatePrinterTypesFunction: updateMachineTypes
// show printer type as it is // show printer type as it is
printerTypeLabelConversionFunction: function(value) { return value } printerTypeLabelConversionFunction: function(value) { return value }

View File

@ -69,16 +69,14 @@ Item
width: parent.width width: parent.width
anchors.top: explainLabel.bottom anchors.top: explainLabel.bottom
TextField Cura.TextField
{ {
id: hostnameField id: hostnameField
width: (parent.width / 2) | 0
height: addPrinterButton.height
anchors.verticalCenter: addPrinterButton.verticalCenter anchors.verticalCenter: addPrinterButton.verticalCenter
anchors.left: parent.left anchors.left: parent.left
height: addPrinterButton.height
anchors.right: addPrinterButton.left
anchors.margins: UM.Theme.getSize("default_margin").width anchors.margins: UM.Theme.getSize("default_margin").width
font: UM.Theme.getFont("default")
selectByMouse: true
validator: RegExpValidator validator: RegExpValidator
{ {
@ -89,11 +87,11 @@ Item
onAccepted: addPrinterButton.clicked() onAccepted: addPrinterButton.clicked()
} }
Cura.PrimaryButton Cura.SecondaryButton
{ {
id: addPrinterButton id: addPrinterButton
anchors.top: parent.top anchors.top: parent.top
anchors.right: parent.right anchors.left: hostnameField.right
anchors.margins: UM.Theme.getSize("default_margin").width anchors.margins: UM.Theme.getSize("default_margin").width
text: catalog.i18nc("@button", "Add") text: catalog.i18nc("@button", "Add")
@ -198,7 +196,10 @@ Item
{ {
if (UM.OutputDeviceManager.hasManualDevice) if (UM.OutputDeviceManager.hasManualDevice)
{ {
typeText.text = UM.OutputDeviceManager.manualDeviceProperty("printer_type") const type_id = UM.OutputDeviceManager.manualDeviceProperty("printer_type")
var readable_type = Cura.MachineManager.getMachineTypeNameFromId(type_id)
readable_type = (readable_type != "") ? readable_type : catalog.i18nc("@label", "Unknown")
typeText.text = readable_type
firmwareText.text = UM.OutputDeviceManager.manualDeviceProperty("firmware_version") firmwareText.text = UM.OutputDeviceManager.manualDeviceProperty("firmware_version")
addressText.text = UM.OutputDeviceManager.manualDeviceProperty("address") addressText.text = UM.OutputDeviceManager.manualDeviceProperty("address")
} }
@ -240,7 +241,7 @@ Item
id: backButton id: backButton
anchors.left: parent.left anchors.left: parent.left
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
text: catalog.i18nc("@button", "Cancel") text: catalog.i18nc("@button", "Back")
onClicked: base.showPreviousPage() onClicked: base.showPreviousPage()
} }

View File

@ -70,7 +70,6 @@ Item
onClicked: onClicked:
{ {
CuraApplication.writeToLog("i", "User declined the User Agreement.") CuraApplication.writeToLog("i", "User declined the User Agreement.")
base.endWizard()
CuraApplication.closeApplication() // NOTE: Hard exit, don't use if anything needs to be saved! CuraApplication.closeApplication() // NOTE: Hard exit, don't use if anything needs to be saved!
} }
} }

View File

@ -27,8 +27,10 @@ Item
renderType: Text.NativeRendering renderType: Text.NativeRendering
} }
Rectangle Cura.ScrollableTextArea
{ {
id: whatsNewTextArea
anchors.top: titleLabel.bottom anchors.top: titleLabel.bottom
anchors.bottom: getStartedButton.top anchors.bottom: getStartedButton.top
anchors.topMargin: UM.Theme.getSize("wide_margin").height anchors.topMargin: UM.Theme.getSize("wide_margin").height
@ -36,27 +38,12 @@ Item
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
border.color: "#dfdfdf" ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
border.width: UM.Theme.getSize("default_lining").width
ScrollView textArea.text: CuraApplication.getTextManager().getChangeLogText()
{ textArea.textFormat: Text.RichText
anchors.fill: parent textArea.wrapMode: Text.WordWrap
anchors.margins: UM.Theme.getSize("default_lining").width textArea.readOnly: true
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
TextArea
{
id: whatsNewTextArea
text: CuraApplication.getTextManager().getChangeLogText()
textFormat: Text.RichText
wrapMode: Text.WordWrap
readOnly: true
font: UM.Theme.getFont("default")
renderType: Text.NativeRendering
}
}
} }
Cura.PrimaryButton Cura.PrimaryButton

View File

@ -25,12 +25,16 @@ Rectangle
Label Label
{ {
id: notificationLabel id: notificationLabel
anchors.centerIn: parent
anchors.fill: parent anchors.fill: parent
color: UM.Theme.getColor("primary_text") color: UM.Theme.getColor("primary_text")
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
font: UM.Theme.getFont("small") font: UM.Theme.getFont("default")
renderType: Text.NativeRendering renderType: Text.NativeRendering
// This is a bit of a hack, but we don't really have enough room for 2 characters (eg 9+). The default font
// does have a tad bit to much spacing. So instead of adding a whole new font, we just modify it a bit for this
// specific instance.
Component.onCompleted: font.letterSpacing = -1
} }
} }

View File

@ -27,6 +27,7 @@ RadioButton
implicitWidth: UM.Theme.getSize("radio_button").width implicitWidth: UM.Theme.getSize("radio_button").width
implicitHeight: UM.Theme.getSize("radio_button").height implicitHeight: UM.Theme.getSize("radio_button").height
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
anchors.alignWhenCentered: false
radius: width / 2 radius: width / 2
border.width: UM.Theme.getSize("default_lining").width border.width: UM.Theme.getSize("default_lining").width
border.color: radioButton.hovered ? UM.Theme.getColor("small_button_text") : UM.Theme.getColor("small_button_text_hover") border.color: radioButton.hovered ? UM.Theme.getColor("small_button_text") : UM.Theme.getColor("small_button_text_hover")

View File

@ -0,0 +1,32 @@
// Copyright (c) 2019 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.10
import QtQuick.Controls 2.3
import UM 1.3 as UM
import Cura 1.1 as Cura
//
// Cura-style TextArea with scrolls
//
ScrollView
{
property alias textArea: _textArea
TextArea
{
id: _textArea
font: UM.Theme.getFont("default")
textFormat: TextEdit.PlainText
renderType: Text.NativeRendering
selectByMouse: true
background: Rectangle // Border
{
border.color: UM.Theme.getColor("lining")
border.width: UM.Theme.getSize("default_lining").width
}
}
}

View File

@ -48,12 +48,22 @@ TextField
background: Rectangle background: Rectangle
{ {
id: backgroundRectangle id: backgroundRectangle
anchors.fill: parent anchors.fill: parent
anchors.margins: Math.round(UM.Theme.getSize("default_lining").width) anchors.margins: Math.round(UM.Theme.getSize("default_lining").width)
radius: UM.Theme.getSize("setting_control_radius").width radius: UM.Theme.getSize("setting_control_radius").width
border.color: UM.Theme.getColor("setting_control_border") border.color:
{
color: UM.Theme.getColor("setting_control") if (!textField.enabled)
{
return UM.Theme.getColor("setting_control_disabled_border")
}
if (textField.hovered || textField.activeFocus)
{
return UM.Theme.getColor("setting_control_border_highlight")
}
return UM.Theme.getColor("setting_control_border")
}
} }
} }

View File

@ -31,6 +31,7 @@ CheckBox 1.0 CheckBox.qml
ComboBox 1.0 ComboBox.qml ComboBox 1.0 ComboBox.qml
NotificationIcon 1.0 NotificationIcon.qml NotificationIcon 1.0 NotificationIcon.qml
RadioButton 1.0 RadioButton.qml RadioButton 1.0 RadioButton.qml
Scrollable 1.0 Scrollable.qml
TabButton 1.0 TabButton.qml TabButton 1.0 TabButton.qml
TextField 1.0 TextField.qml TextField 1.0 TextField.qml

View File

@ -604,7 +604,7 @@
"toolbox_action_button": [8.0, 2.5], "toolbox_action_button": [8.0, 2.5],
"toolbox_loader": [2.0, 2.0], "toolbox_loader": [2.0, 2.0],
"notification_icon": [1.4, 1.4], "notification_icon": [1.5, 1.5],
"avatar_image": [6.8, 6.8], "avatar_image": [6.8, 6.8],