From c39498c60fdb5a5ecebc48819397c0387749d088 Mon Sep 17 00:00:00 2001 From: Ad5001 Date: Sat, 26 Oct 2024 05:55:34 +0200 Subject: [PATCH] Finally got rid of the camelCase2Readable Utils function. --- .../definitionDomain.svg} | 0 .../destinationDomain.svg} | 0 assets/icons/properties/displayMode.svg | 1 + assets/icons/properties/displayStyle.svg | 1 + .../Expression.svg => properties/expression.svg} | 0 .../custom/Gain.svg => properties/gain.svg} | 0 assets/icons/properties/labelPosition.svg | 1 + assets/icons/properties/labelX.svg | 1 + assets/icons/properties/om_0.svg | 1 + .../custom/Pass.svg => properties/pass.svg} | 0 assets/icons/properties/phase.svg | 1 + assets/icons/properties/pointStyle.svg | 1 + .../custom/Rounding.svg => properties/rounding.svg} | 0 assets/icons/properties/targetElement.svg | 1 + assets/icons/properties/targetValuePosition.svg | 1 + assets/icons/properties/text.svg | 1 + assets/icons/properties/unit.svg | 1 + assets/icons/properties/x.svg | 1 + assets/icons/properties/y.svg | 1 + assets/icons/settings/custom/Display Mode.svg | 1 - assets/icons/settings/custom/Display Style.svg | 1 - assets/icons/settings/custom/Label Position.svg | 1 - assets/icons/settings/custom/Label X.svg | 1 - assets/icons/settings/custom/Phase.svg | 1 - assets/icons/settings/custom/Point Style.svg | 1 - assets/icons/settings/custom/Target Element.svg | 1 - .../icons/settings/custom/Target Value Position.svg | 1 - assets/icons/settings/custom/Text.svg | 1 - assets/icons/settings/custom/Unit.svg | 1 - assets/icons/settings/custom/X.svg | 1 - assets/icons/settings/custom/Y.svg | 1 - assets/icons/settings/custom/ω_0.svg | 1 - common/src/utils.mjs | 12 ------------ runtime-pyside6/LogarithmPlotter/logarithmplotter.py | 2 +- .../ObjectLists/Editor/CustomPropertyList.qml | 12 ++++++------ 35 files changed, 20 insertions(+), 32 deletions(-) rename assets/icons/{settings/custom/Definition Domain.svg => properties/definitionDomain.svg} (100%) rename assets/icons/{settings/custom/Destination Domain.svg => properties/destinationDomain.svg} (100%) create mode 120000 assets/icons/properties/displayMode.svg create mode 120000 assets/icons/properties/displayStyle.svg rename assets/icons/{settings/custom/Expression.svg => properties/expression.svg} (100%) rename assets/icons/{settings/custom/Gain.svg => properties/gain.svg} (100%) create mode 120000 assets/icons/properties/labelPosition.svg create mode 120000 assets/icons/properties/labelX.svg create mode 120000 assets/icons/properties/om_0.svg rename assets/icons/{settings/custom/Pass.svg => properties/pass.svg} (100%) create mode 120000 assets/icons/properties/phase.svg create mode 120000 assets/icons/properties/pointStyle.svg rename assets/icons/{settings/custom/Rounding.svg => properties/rounding.svg} (100%) create mode 120000 assets/icons/properties/targetElement.svg create mode 120000 assets/icons/properties/targetValuePosition.svg create mode 120000 assets/icons/properties/text.svg create mode 120000 assets/icons/properties/unit.svg create mode 120000 assets/icons/properties/x.svg create mode 120000 assets/icons/properties/y.svg delete mode 120000 assets/icons/settings/custom/Display Mode.svg delete mode 120000 assets/icons/settings/custom/Display Style.svg delete mode 120000 assets/icons/settings/custom/Label Position.svg delete mode 120000 assets/icons/settings/custom/Label X.svg delete mode 120000 assets/icons/settings/custom/Phase.svg delete mode 120000 assets/icons/settings/custom/Point Style.svg delete mode 120000 assets/icons/settings/custom/Target Element.svg delete mode 120000 assets/icons/settings/custom/Target Value Position.svg delete mode 120000 assets/icons/settings/custom/Text.svg delete mode 120000 assets/icons/settings/custom/Unit.svg delete mode 120000 assets/icons/settings/custom/X.svg delete mode 120000 assets/icons/settings/custom/Y.svg delete mode 120000 assets/icons/settings/custom/ω_0.svg diff --git a/assets/icons/settings/custom/Definition Domain.svg b/assets/icons/properties/definitionDomain.svg similarity index 100% rename from assets/icons/settings/custom/Definition Domain.svg rename to assets/icons/properties/definitionDomain.svg diff --git a/assets/icons/settings/custom/Destination Domain.svg b/assets/icons/properties/destinationDomain.svg similarity index 100% rename from assets/icons/settings/custom/Destination Domain.svg rename to assets/icons/properties/destinationDomain.svg diff --git a/assets/icons/properties/displayMode.svg b/assets/icons/properties/displayMode.svg new file mode 120000 index 0000000..41b711b --- /dev/null +++ b/assets/icons/properties/displayMode.svg @@ -0,0 +1 @@ +../common/appearance.svg \ No newline at end of file diff --git a/assets/icons/properties/displayStyle.svg b/assets/icons/properties/displayStyle.svg new file mode 120000 index 0000000..41b711b --- /dev/null +++ b/assets/icons/properties/displayStyle.svg @@ -0,0 +1 @@ +../common/appearance.svg \ No newline at end of file diff --git a/assets/icons/settings/custom/Expression.svg b/assets/icons/properties/expression.svg similarity index 100% rename from assets/icons/settings/custom/Expression.svg rename to assets/icons/properties/expression.svg diff --git a/assets/icons/settings/custom/Gain.svg b/assets/icons/properties/gain.svg similarity index 100% rename from assets/icons/settings/custom/Gain.svg rename to assets/icons/properties/gain.svg diff --git a/assets/icons/properties/labelPosition.svg b/assets/icons/properties/labelPosition.svg new file mode 120000 index 0000000..3e4c849 --- /dev/null +++ b/assets/icons/properties/labelPosition.svg @@ -0,0 +1 @@ +../common/arrow.svg \ No newline at end of file diff --git a/assets/icons/properties/labelX.svg b/assets/icons/properties/labelX.svg new file mode 120000 index 0000000..4eecad3 --- /dev/null +++ b/assets/icons/properties/labelX.svg @@ -0,0 +1 @@ +../common/position.svg \ No newline at end of file diff --git a/assets/icons/properties/om_0.svg b/assets/icons/properties/om_0.svg new file mode 120000 index 0000000..e4130be --- /dev/null +++ b/assets/icons/properties/om_0.svg @@ -0,0 +1 @@ +../common/angle.svg \ No newline at end of file diff --git a/assets/icons/settings/custom/Pass.svg b/assets/icons/properties/pass.svg similarity index 100% rename from assets/icons/settings/custom/Pass.svg rename to assets/icons/properties/pass.svg diff --git a/assets/icons/properties/phase.svg b/assets/icons/properties/phase.svg new file mode 120000 index 0000000..e4130be --- /dev/null +++ b/assets/icons/properties/phase.svg @@ -0,0 +1 @@ +../common/angle.svg \ No newline at end of file diff --git a/assets/icons/properties/pointStyle.svg b/assets/icons/properties/pointStyle.svg new file mode 120000 index 0000000..41b711b --- /dev/null +++ b/assets/icons/properties/pointStyle.svg @@ -0,0 +1 @@ +../common/appearance.svg \ No newline at end of file diff --git a/assets/icons/settings/custom/Rounding.svg b/assets/icons/properties/rounding.svg similarity index 100% rename from assets/icons/settings/custom/Rounding.svg rename to assets/icons/properties/rounding.svg diff --git a/assets/icons/properties/targetElement.svg b/assets/icons/properties/targetElement.svg new file mode 120000 index 0000000..659962b --- /dev/null +++ b/assets/icons/properties/targetElement.svg @@ -0,0 +1 @@ +../common/target.svg \ No newline at end of file diff --git a/assets/icons/properties/targetValuePosition.svg b/assets/icons/properties/targetValuePosition.svg new file mode 120000 index 0000000..4eecad3 --- /dev/null +++ b/assets/icons/properties/targetValuePosition.svg @@ -0,0 +1 @@ +../common/position.svg \ No newline at end of file diff --git a/assets/icons/properties/text.svg b/assets/icons/properties/text.svg new file mode 120000 index 0000000..280f9ad --- /dev/null +++ b/assets/icons/properties/text.svg @@ -0,0 +1 @@ +../common/label.svg \ No newline at end of file diff --git a/assets/icons/properties/unit.svg b/assets/icons/properties/unit.svg new file mode 120000 index 0000000..e4130be --- /dev/null +++ b/assets/icons/properties/unit.svg @@ -0,0 +1 @@ +../common/angle.svg \ No newline at end of file diff --git a/assets/icons/properties/x.svg b/assets/icons/properties/x.svg new file mode 120000 index 0000000..4eecad3 --- /dev/null +++ b/assets/icons/properties/x.svg @@ -0,0 +1 @@ +../common/position.svg \ No newline at end of file diff --git a/assets/icons/properties/y.svg b/assets/icons/properties/y.svg new file mode 120000 index 0000000..4eecad3 --- /dev/null +++ b/assets/icons/properties/y.svg @@ -0,0 +1 @@ +../common/position.svg \ No newline at end of file diff --git a/assets/icons/settings/custom/Display Mode.svg b/assets/icons/settings/custom/Display Mode.svg deleted file mode 120000 index 7a5ba45..0000000 --- a/assets/icons/settings/custom/Display Mode.svg +++ /dev/null @@ -1 +0,0 @@ -../../common/appearance.svg \ No newline at end of file diff --git a/assets/icons/settings/custom/Display Style.svg b/assets/icons/settings/custom/Display Style.svg deleted file mode 120000 index 7a5ba45..0000000 --- a/assets/icons/settings/custom/Display Style.svg +++ /dev/null @@ -1 +0,0 @@ -../../common/appearance.svg \ No newline at end of file diff --git a/assets/icons/settings/custom/Label Position.svg b/assets/icons/settings/custom/Label Position.svg deleted file mode 120000 index 43aa15f..0000000 --- a/assets/icons/settings/custom/Label Position.svg +++ /dev/null @@ -1 +0,0 @@ -../../common/arrow.svg \ No newline at end of file diff --git a/assets/icons/settings/custom/Label X.svg b/assets/icons/settings/custom/Label X.svg deleted file mode 120000 index 6b40925..0000000 --- a/assets/icons/settings/custom/Label X.svg +++ /dev/null @@ -1 +0,0 @@ -../../common/position.svg \ No newline at end of file diff --git a/assets/icons/settings/custom/Phase.svg b/assets/icons/settings/custom/Phase.svg deleted file mode 120000 index 21699e9..0000000 --- a/assets/icons/settings/custom/Phase.svg +++ /dev/null @@ -1 +0,0 @@ -../../common/angle.svg \ No newline at end of file diff --git a/assets/icons/settings/custom/Point Style.svg b/assets/icons/settings/custom/Point Style.svg deleted file mode 120000 index 7a5ba45..0000000 --- a/assets/icons/settings/custom/Point Style.svg +++ /dev/null @@ -1 +0,0 @@ -../../common/appearance.svg \ No newline at end of file diff --git a/assets/icons/settings/custom/Target Element.svg b/assets/icons/settings/custom/Target Element.svg deleted file mode 120000 index 50124dc..0000000 --- a/assets/icons/settings/custom/Target Element.svg +++ /dev/null @@ -1 +0,0 @@ -../../common/target.svg \ No newline at end of file diff --git a/assets/icons/settings/custom/Target Value Position.svg b/assets/icons/settings/custom/Target Value Position.svg deleted file mode 120000 index 6b40925..0000000 --- a/assets/icons/settings/custom/Target Value Position.svg +++ /dev/null @@ -1 +0,0 @@ -../../common/position.svg \ No newline at end of file diff --git a/assets/icons/settings/custom/Text.svg b/assets/icons/settings/custom/Text.svg deleted file mode 120000 index 69be9e1..0000000 --- a/assets/icons/settings/custom/Text.svg +++ /dev/null @@ -1 +0,0 @@ -../../common/label.svg \ No newline at end of file diff --git a/assets/icons/settings/custom/Unit.svg b/assets/icons/settings/custom/Unit.svg deleted file mode 120000 index 21699e9..0000000 --- a/assets/icons/settings/custom/Unit.svg +++ /dev/null @@ -1 +0,0 @@ -../../common/angle.svg \ No newline at end of file diff --git a/assets/icons/settings/custom/X.svg b/assets/icons/settings/custom/X.svg deleted file mode 120000 index 6b40925..0000000 --- a/assets/icons/settings/custom/X.svg +++ /dev/null @@ -1 +0,0 @@ -../../common/position.svg \ No newline at end of file diff --git a/assets/icons/settings/custom/Y.svg b/assets/icons/settings/custom/Y.svg deleted file mode 120000 index 6b40925..0000000 --- a/assets/icons/settings/custom/Y.svg +++ /dev/null @@ -1 +0,0 @@ -../../common/position.svg \ No newline at end of file diff --git a/assets/icons/settings/custom/ω_0.svg b/assets/icons/settings/custom/ω_0.svg deleted file mode 120000 index 21699e9..0000000 --- a/assets/icons/settings/custom/ω_0.svg +++ /dev/null @@ -1 +0,0 @@ -../../common/angle.svg \ No newline at end of file diff --git a/common/src/utils.mjs b/common/src/utils.mjs index 0e451f4..5c51f62 100644 --- a/common/src/utils.mjs +++ b/common/src/utils.mjs @@ -401,18 +401,6 @@ export function parseName(str, removeUnallowed = true) { return str } -/** - * Transforms camel case strings to a space separated one. - * - * @deprecated - * @param {string} label - Camel case to parse - * @returns {string} Parsed label. - */ -export function camelCase2readable(label) { - let parsed = parseName(label, false) - return parsed.charAt(0).toLatinUppercase() + parsed.slice(1).replace(/([A-Z])/g, " $1") -} - /** * Creates a randomized color string. * @returns {string} diff --git a/runtime-pyside6/LogarithmPlotter/logarithmplotter.py b/runtime-pyside6/LogarithmPlotter/logarithmplotter.py index 115083a..c4c16b9 100644 --- a/runtime-pyside6/LogarithmPlotter/logarithmplotter.py +++ b/runtime-pyside6/LogarithmPlotter/logarithmplotter.py @@ -104,7 +104,7 @@ def get_platform_qt_style(os) -> str: def register_icon_directories() -> None: icon_fallbacks = QIcon.fallbackSearchPaths() base_icon_path = path.join(logarithmplotter_path, "qml", "eu", "ad5001", "LogarithmPlotter", "icons") - paths = [["common"], ["objects"], ["history"], ["settings"], ["settings", "custom"]] + paths = [["common"], ["objects"], ["history"], ["settings"], ["properties"]] for p in paths: icon_fallbacks.append(path.realpath(path.join(base_icon_path, *p))) QIcon.setFallbackSearchPaths(icon_fallbacks) diff --git a/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/ObjectLists/Editor/CustomPropertyList.qml b/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/ObjectLists/Editor/CustomPropertyList.qml index 1ca75e4..49cea8e 100644 --- a/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/ObjectLists/Editor/CustomPropertyList.qml +++ b/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/ObjectLists/Editor/CustomPropertyList.qml @@ -74,7 +74,7 @@ Repeater { Setting.ExpressionEditor { height: 30 label: propertyLabel - icon: `settings/custom/${propertyIcon}.svg` + icon: `properties/${propertyIcon}.svg` defValue: JS.Utils.simplifyExpression(obj[propertyName].toEditableString()) self: obj.name variables: propertyType.variables @@ -99,7 +99,7 @@ Repeater { Setting.TextSetting { height: 30 label: propertyLabel - icon: `settings/custom/${propertyIcon}.svg` + icon: `properties/${propertyIcon}.svg` min: propertyType == "int" ? 0 : -Infinity isInt: propertyType == "int" isDouble: propertyType == "number" @@ -159,7 +159,7 @@ Repeater { CheckBox { height: 20 text: propertyLabel - //icon: `settings/custom/${propertyIcon}.svg` + //icon: `properties/${propertyIcon}.svg` checked: { //if(obj[propertyName] == null) { @@ -185,7 +185,7 @@ Repeater { Setting.ComboBoxSetting { height: 30 label: propertyLabel - icon: `settings/custom/${propertyIcon}.svg` + icon: `properties/${propertyIcon}.svg` // True to select an object of type, false for enums. property bool selectObjMode: paramTypeIn(propertyType, ['ObjectType']) property bool isRealObject: !selectObjMode || (propertyType.objType != "ExecutableObject" && propertyType.objType != "DrawableObject") @@ -246,7 +246,7 @@ Repeater { Setting.ListSetting { label: propertyLabel - //icon: `settings/custom/${propertyIcon}.svg` + //icon: `properties/${propertyIcon}.svg` dictionaryMode: paramTypeIn(propertyType, ['Dict']) keyType: dictionaryMode ? propertyType.keyType : 'string' valueType: propertyType.valueType @@ -283,7 +283,7 @@ Repeater { property string propertyName: modelData[0] property var propertyType: modelData[1] property string propertyLabel: qsTranslate('prop',propertyName) - property string propertyIcon: JS.Utils.camelCase2readable(propertyName) + property string propertyIcon: propertyName sourceComponent: { if(propertyName.startsWith('comment'))