mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-25 23:53:56 -06:00
Merge branch '5.0' of github.com:Ultimaker/Cura
This commit is contained in:
commit
02a2facb86
4 changed files with 29 additions and 6 deletions
|
@ -206,7 +206,7 @@ class ContainerManager(QObject):
|
||||||
if os.path.exists(file_url):
|
if os.path.exists(file_url):
|
||||||
result = QMessageBox.question(None, catalog.i18nc("@title:window", "File Already Exists"),
|
result = QMessageBox.question(None, catalog.i18nc("@title:window", "File Already Exists"),
|
||||||
catalog.i18nc("@label Don't translate the XML tag <filename>!", "The file <filename>{0}</filename> already exists. Are you sure you want to overwrite it?").format(file_url))
|
catalog.i18nc("@label Don't translate the XML tag <filename>!", "The file <filename>{0}</filename> already exists. Are you sure you want to overwrite it?").format(file_url))
|
||||||
if result == QMessageBox.ButtonRole.NoRole:
|
if result == QMessageBox.StandardButton.No:
|
||||||
return {"status": "cancelled", "message": "User cancelled"}
|
return {"status": "cancelled", "message": "User cancelled"}
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -139,7 +139,7 @@ class CuraContainerRegistry(ContainerRegistry):
|
||||||
if os.path.exists(file_name):
|
if os.path.exists(file_name):
|
||||||
result = QMessageBox.question(None, catalog.i18nc("@title:window", "File Already Exists"),
|
result = QMessageBox.question(None, catalog.i18nc("@title:window", "File Already Exists"),
|
||||||
catalog.i18nc("@label Don't translate the XML tag <filename>!", "The file <filename>{0}</filename> already exists. Are you sure you want to overwrite it?").format(file_name))
|
catalog.i18nc("@label Don't translate the XML tag <filename>!", "The file <filename>{0}</filename> already exists. Are you sure you want to overwrite it?").format(file_name))
|
||||||
if result == QMessageBox.ButtonRole.NoRole:
|
if result == QMessageBox.StandardButton.No:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
profile_writer = self._findProfileWriter(extension, description)
|
profile_writer = self._findProfileWriter(extension, description)
|
||||||
|
|
|
@ -480,7 +480,7 @@ class CloudOutputDeviceManager:
|
||||||
if remove_printers_ids == all_ids:
|
if remove_printers_ids == all_ids:
|
||||||
question_content = self.i18n_catalog.i18nc("@label", "You are about to remove all printers from Cura. This action cannot be undone.\nAre you sure you want to continue?")
|
question_content = self.i18n_catalog.i18nc("@label", "You are about to remove all printers from Cura. This action cannot be undone.\nAre you sure you want to continue?")
|
||||||
result = QMessageBox.question(None, question_title, question_content)
|
result = QMessageBox.question(None, question_title, question_content)
|
||||||
if result == QMessageBox.ButtonRole.NoRole:
|
if result == QMessageBox.StandardButton.No:
|
||||||
return
|
return
|
||||||
|
|
||||||
for machine_cloud_id in self.reported_device_ids:
|
for machine_cloud_id in self.reported_device_ids:
|
||||||
|
|
|
@ -87,11 +87,25 @@ Cura.MenuItem
|
||||||
Popup
|
Popup
|
||||||
{
|
{
|
||||||
id: menuPopup
|
id: menuPopup
|
||||||
x: parent.width - UM.Theme.getSize("default_lining").width
|
|
||||||
y: -UM.Theme.getSize("default_lining").width
|
|
||||||
width: materialTypesList.width + padding * 2
|
width: materialTypesList.width + padding * 2
|
||||||
height: materialTypesList.height + padding * 2
|
height: materialTypesList.height + padding * 2
|
||||||
|
|
||||||
|
property var flipped: false
|
||||||
|
|
||||||
|
x: parent.width - UM.Theme.getSize("default_lining").width
|
||||||
|
y: {
|
||||||
|
// Checks if popup is more than halfway down the screen AND further than 400 down (this avoids popup going off the top of screen)
|
||||||
|
// If it is then the popup will push up instead of down
|
||||||
|
// This fixes the popups appearing bellow the bottom of the screen.
|
||||||
|
|
||||||
|
if (materialBrandMenu.parent.height / 2 < parent.y && parent.y > 400) {
|
||||||
|
flipped = true
|
||||||
|
return -UM.Theme.getSize("default_lining").width - height + UM.Theme.getSize("menu").height
|
||||||
|
}
|
||||||
|
flipped = false
|
||||||
|
return -UM.Theme.getSize("default_lining").width
|
||||||
|
}
|
||||||
|
|
||||||
padding: background.border.width
|
padding: background.border.width
|
||||||
// Nasty hack to ensure that we can keep track if the popup contains the mouse.
|
// Nasty hack to ensure that we can keep track if the popup contains the mouse.
|
||||||
// Since we also want a hover for the sub items (and these events are sent async)
|
// Since we also want a hover for the sub items (and these events are sent async)
|
||||||
|
@ -128,11 +142,14 @@ Cura.MenuItem
|
||||||
//With a custom MouseArea, we can prevent the events from being accepted.
|
//With a custom MouseArea, we can prevent the events from being accepted.
|
||||||
delegate: Rectangle
|
delegate: Rectangle
|
||||||
{
|
{
|
||||||
|
id: brandMaterialBase
|
||||||
height: UM.Theme.getSize("menu").height
|
height: UM.Theme.getSize("menu").height
|
||||||
width: UM.Theme.getSize("menu").width
|
width: UM.Theme.getSize("menu").width
|
||||||
|
|
||||||
color: materialTypeButton.containsMouse ? UM.Theme.getColor("background_2") : UM.Theme.getColor("background_1")
|
color: materialTypeButton.containsMouse ? UM.Theme.getColor("background_2") : UM.Theme.getColor("background_1")
|
||||||
|
|
||||||
|
property var isFlipped: menuPopup.flipped
|
||||||
|
|
||||||
RowLayout
|
RowLayout
|
||||||
{
|
{
|
||||||
spacing: 0
|
spacing: 0
|
||||||
|
@ -225,7 +242,13 @@ Cura.MenuItem
|
||||||
width: materialColorsList.width + padding * 2
|
width: materialColorsList.width + padding * 2
|
||||||
height: materialColorsList.height + padding * 2
|
height: materialColorsList.height + padding * 2
|
||||||
x: parent.width
|
x: parent.width
|
||||||
y: -UM.Theme.getSize("default_lining").width
|
y: {
|
||||||
|
// If flipped the popup should push up rather than down from the parent
|
||||||
|
if (brandMaterialBase.isFlipped) {
|
||||||
|
return -height + UM.Theme.getSize("menu").height + UM.Theme.getSize("default_lining").width
|
||||||
|
}
|
||||||
|
return -UM.Theme.getSize("default_lining").width
|
||||||
|
}
|
||||||
|
|
||||||
property int itemHovered: 0
|
property int itemHovered: 0
|
||||||
padding: background.border.width
|
padding: background.border.width
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue