mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-05-02 00:34:26 +08:00
Merge branch '4.11'
This commit is contained in:
commit
15fcad454d
@ -51,7 +51,7 @@ Item
|
|||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
color: UM.Theme.getColor("monitor_icon_primary")
|
color: UM.Theme.getColor("monitor_icon_primary")
|
||||||
height: UM.Theme.getSize("medium_button_icon").width
|
height: UM.Theme.getSize("medium_button_icon").width
|
||||||
source: "../svg/icons/Buildplate.svg"
|
source: UM.Theme.getIcon("Buildplate")
|
||||||
width: height
|
width: height
|
||||||
visible: buildplate
|
visible: buildplate
|
||||||
}
|
}
|
||||||
|
@ -202,7 +202,7 @@ Button
|
|||||||
Cura.IconWithText
|
Cura.IconWithText
|
||||||
{
|
{
|
||||||
id: buildplateLabel
|
id: buildplateLabel
|
||||||
source: UM.Theme.getIcon("buildplate")
|
source: UM.Theme.getIcon("Buildplate")
|
||||||
text:
|
text:
|
||||||
{
|
{
|
||||||
if (configuration === null)
|
if (configuration === null)
|
||||||
|
@ -172,7 +172,7 @@ Item
|
|||||||
anchors.horizontalCenter: communityColumn.horizontalCenter
|
anchors.horizontalCenter: communityColumn.horizontalCenter
|
||||||
fillMode: Image.PreserveAspectFit
|
fillMode: Image.PreserveAspectFit
|
||||||
width: UM.Theme.getSize("welcome_wizard_cloud_content_image").width
|
width: UM.Theme.getSize("welcome_wizard_cloud_content_image").width
|
||||||
source: UM.Theme.getIcon("PrinterTriple", "medium")
|
source: UM.Theme.getIcon("Group")
|
||||||
sourceSize.width: width
|
sourceSize.width: width
|
||||||
sourceSize.height: height
|
sourceSize.height: height
|
||||||
}
|
}
|
||||||
|
0
plugins/UM3NetworkPrinting/resources/svg/icons/Buildplate.svg → resources/themes/cura-light/icons/default/Buildplate.svg
Executable file → Normal file
0
plugins/UM3NetworkPrinting/resources/svg/icons/Buildplate.svg → resources/themes/cura-light/icons/default/Buildplate.svg
Executable file → Normal file
Before Width: | Height: | Size: 323 B After Width: | Height: | Size: 323 B |
3
resources/themes/cura-light/icons/default/Group.svg
Normal file
3
resources/themes/cura-light/icons/default/Group.svg
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path d="M19.2 11.72C19.7181 11.0963 20.0012 10.3108 20 9.5C20 8.57174 19.6313 7.6815 18.9749 7.02513C18.3185 6.36875 17.4283 6 16.5 6C15.5717 6 14.6815 6.36875 14.0251 7.02513C13.3687 7.6815 13 8.57174 13 9.5C12.9988 10.3108 13.2819 11.0963 13.8 11.72C13.3779 11.9508 12.9907 12.2403 12.65 12.58C12.2038 11.3631 11.334 10.3477 10.2 9.72C10.7181 9.09633 11.0012 8.31079 11 7.5C11 6.57174 10.6313 5.6815 9.97487 5.02513C9.3185 4.36875 8.42826 4 7.5 4C6.57174 4 5.6815 4.36875 5.02513 5.02513C4.36875 5.6815 4 6.57174 4 7.5C3.99884 8.31079 4.28192 9.09633 4.8 9.72C3.94933 10.1945 3.24111 10.888 2.74877 11.7285C2.25643 12.569 1.9979 13.5259 2 14.5V20H4V14.5C4 13.5717 4.36875 12.6815 5.02513 12.0251C5.6815 11.3687 6.57174 11 7.5 11C8.42826 11 9.3185 11.3687 9.97487 12.0251C10.6313 12.6815 11 13.5717 11 14.5V20H13V16.5C13 15.5717 13.3687 14.6815 14.0251 14.0251C14.6815 13.3687 15.5717 13 16.5 13C17.4283 13 18.3185 13.3687 18.9749 14.0251C19.6313 14.6815 20 15.5717 20 16.5V20H22V16.5C22.0021 15.5259 21.7436 14.569 21.2512 13.7285C20.7589 12.888 20.0507 12.1945 19.2 11.72ZM6 7.5C6 7.20333 6.08797 6.91332 6.2528 6.66664C6.41762 6.41997 6.65189 6.22771 6.92598 6.11418C7.20006 6.00065 7.50166 5.97094 7.79264 6.02882C8.08361 6.0867 8.35088 6.22956 8.56066 6.43934C8.77044 6.64912 8.9133 6.91639 8.97118 7.20736C9.02906 7.49834 8.99935 7.79994 8.88582 8.07403C8.77229 8.34811 8.58003 8.58238 8.33336 8.7472C8.08668 8.91203 7.79667 9 7.5 9C7.30294 9.00026 7.10777 8.96164 6.92566 8.88636C6.74356 8.81107 6.57809 8.70059 6.43875 8.56125C6.29941 8.42191 6.18893 8.25644 6.11365 8.07434C6.03836 7.89223 5.99974 7.69706 6 7.5ZM15 9.5C15 9.20333 15.088 8.91332 15.2528 8.66665C15.4176 8.41997 15.6519 8.22771 15.926 8.11418C16.2001 8.00065 16.5017 7.97094 16.7926 8.02882C17.0836 8.0867 17.3509 8.22956 17.5607 8.43934C17.7704 8.64912 17.9133 8.91639 17.9712 9.20736C18.0291 9.49834 17.9993 9.79994 17.8858 10.074C17.7723 10.3481 17.58 10.5824 17.3334 10.7472C17.0867 10.912 16.7967 11 16.5 11C16.3029 11.0003 16.1078 10.9616 15.9257 10.8864C15.7436 10.8111 15.5781 10.7006 15.4388 10.5612C15.2994 10.4219 15.1889 10.2564 15.1136 10.0743C15.0384 9.89223 14.9997 9.69706 15 9.5Z" fill="#000E1A"/>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 2.2 KiB |
5
resources/themes/cura-light/icons/default/Play.svg
Normal file
5
resources/themes/cura-light/icons/default/Play.svg
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
||||||
|
<path d="M5,20V4c0-0.8,0.9-1.3,1.5-0.9l13,8c0.6,0.4,0.6,1.3,0,1.7l-13,8C5.9,21.3,5,20.8,5,20z M7,5.8v12.4
|
||||||
|
L17.1,12L7,5.8z"/>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 247 B |
@ -306,5 +306,97 @@
|
|||||||
"translate": {
|
"translate": {
|
||||||
"new_icon": "ArrowFourWay",
|
"new_icon": "ArrowFourWay",
|
||||||
"size": "default"
|
"size": "default"
|
||||||
|
},
|
||||||
|
"buildplate": {
|
||||||
|
"new_icon": "Buildplate",
|
||||||
|
"size": "default"
|
||||||
|
},
|
||||||
|
"basic": {
|
||||||
|
"new_icon": "PrintQuality",
|
||||||
|
"size": "default"
|
||||||
|
},
|
||||||
|
"category_shield": {
|
||||||
|
"new_icon": "Shield",
|
||||||
|
"size": "default"
|
||||||
|
},
|
||||||
|
"category_unknown": {
|
||||||
|
"new_icon": "Sputnik",
|
||||||
|
"size": "default"
|
||||||
|
},
|
||||||
|
"cross2": {
|
||||||
|
"new_icon": "CancelBlock",
|
||||||
|
"size": "default"
|
||||||
|
},
|
||||||
|
"drop_down_button": {
|
||||||
|
"new_icon": "ChevronSingleDown",
|
||||||
|
"size": "default"
|
||||||
|
},
|
||||||
|
"group": {
|
||||||
|
"new_icon": "Group",
|
||||||
|
"size": "default"
|
||||||
|
},
|
||||||
|
"link": {
|
||||||
|
"new_icon": "Link",
|
||||||
|
"size": "default"
|
||||||
|
},
|
||||||
|
"play": {
|
||||||
|
"new_icon": "Play",
|
||||||
|
"size": "default"
|
||||||
|
},
|
||||||
|
"print_time": {
|
||||||
|
"new_icon": "Clock",
|
||||||
|
"size": "default"
|
||||||
|
},
|
||||||
|
"printer_cloud_connected": {
|
||||||
|
"new_icon": "CloudBadge",
|
||||||
|
"size": "low"
|
||||||
|
},
|
||||||
|
"printer_cloud_not_available": {
|
||||||
|
"new_icon": "CloudBadge",
|
||||||
|
"size": "low"
|
||||||
|
},
|
||||||
|
"printer_connected": {
|
||||||
|
"new_icon": "CheckBlueBG",
|
||||||
|
"size": "low"
|
||||||
|
},
|
||||||
|
"printsetup": {
|
||||||
|
"new_icon": "Sliders",
|
||||||
|
"size": "default"
|
||||||
|
},
|
||||||
|
"quick": {
|
||||||
|
"new_icon": "Quick",
|
||||||
|
"size": "default"
|
||||||
|
},
|
||||||
|
"scale_max": {
|
||||||
|
"new_icon": "ScaleMax",
|
||||||
|
"size": "default"
|
||||||
|
},
|
||||||
|
"setting_per_object": {
|
||||||
|
"new_icon": "MeshType",
|
||||||
|
"size": "default"
|
||||||
|
},
|
||||||
|
"star_empty": {
|
||||||
|
"new_icon": "Star",
|
||||||
|
"size": "default"
|
||||||
|
},
|
||||||
|
"star_filled": {
|
||||||
|
"new_icon": "StarFilled",
|
||||||
|
"size": "default"
|
||||||
|
},
|
||||||
|
"ulti": {
|
||||||
|
"new_icon": "PrintQuality",
|
||||||
|
"size": "default"
|
||||||
|
},
|
||||||
|
"view_xray": {
|
||||||
|
"new_icon": "CancelBlock",
|
||||||
|
"size": "default"
|
||||||
|
},
|
||||||
|
"view_normal": {
|
||||||
|
"new_icon": "Infill0",
|
||||||
|
"size": "default"
|
||||||
|
},
|
||||||
|
"viewmode": {
|
||||||
|
"new_icon": "Eye",
|
||||||
|
"size": "default"
|
||||||
}
|
}
|
||||||
}
|
}
|
33
tests/TestThemes.py
Normal file
33
tests/TestThemes.py
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
# Copyright (c) 2021 Ultimaker B.V.
|
||||||
|
# Cura is released under the terms of the LGPLv3 or higher.
|
||||||
|
|
||||||
|
import json # To parse the deprecated icons files.
|
||||||
|
import os # To find the theme folders.
|
||||||
|
import pytest
|
||||||
|
|
||||||
|
theme_base = os.path.join(os.path.split(__file__)[0], "..", "resources", "themes")
|
||||||
|
theme_paths = [os.path.join(theme_base, theme_folder) for theme_folder in os.listdir(theme_base) if os.path.isdir(os.path.join(theme_base, theme_folder))]
|
||||||
|
|
||||||
|
@pytest.mark.parametrize("theme_path", theme_paths)
|
||||||
|
def test_deprecatedIconsExist(theme_path: str) -> None:
|
||||||
|
icons_folder = os.path.join(theme_path, "icons")
|
||||||
|
deprecated_icons_file = os.path.join(icons_folder, "deprecated_icons.json")
|
||||||
|
if not os.path.exists(deprecated_icons_file):
|
||||||
|
return # No deprecated icons file, there is nothing to go wrong.
|
||||||
|
|
||||||
|
# Find out which icons exist in this theme file.
|
||||||
|
existing_icons = {}
|
||||||
|
for size in [subfolder for subfolder in os.listdir(icons_folder) if os.path.isdir(os.path.join(icons_folder, subfolder))]:
|
||||||
|
existing_icons[size] = set(os.path.splitext(fname)[0] for fname in os.listdir(os.path.join(icons_folder, size)))
|
||||||
|
|
||||||
|
with open(deprecated_icons_file) as f:
|
||||||
|
deprecated_icons = json.load(f)
|
||||||
|
|
||||||
|
for entry in deprecated_icons.values():
|
||||||
|
assert "new_icon" in entry # For each deprecated icon we must know which icon replaced it.
|
||||||
|
new_icon = entry["new_icon"]
|
||||||
|
assert "size" in entry
|
||||||
|
size = entry["size"]
|
||||||
|
|
||||||
|
assert size in existing_icons # The replacement icon must have a size that exists.
|
||||||
|
assert new_icon in existing_icons[size] # The new icon must exist for that size.
|
Loading…
x
Reference in New Issue
Block a user