diff --git a/plugins/Marketplace/LicenseModel.py b/plugins/Marketplace/LicenseModel.py index cb85b33430..199ddc9ee0 100644 --- a/plugins/Marketplace/LicenseModel.py +++ b/plugins/Marketplace/LicenseModel.py @@ -11,7 +11,6 @@ class LicenseModel(QObject): dialogTitleChanged = pyqtSignal() packageNameChanged = pyqtSignal() licenseTextChanged = pyqtSignal() - iconChanged = pyqtSignal() def __init__(self, decline_button_text: str = DEFAULT_DECLINE_BUTTON_TEXT) -> None: super().__init__() @@ -19,7 +18,6 @@ class LicenseModel(QObject): self._dialogTitle = "" self._license_text = "" self._package_name = "" - self._icon_url = "" self._decline_button_text = decline_button_text @pyqtProperty(str, constant = True) @@ -42,14 +40,6 @@ class LicenseModel(QObject): self._package_name = name self.packageNameChanged.emit() - @pyqtProperty(str, notify=iconChanged) - def iconUrl(self) -> str: - return self._icon_url - - def setIconUrl(self, url: str): - self._icon_url = url - self.iconChanged.emit() - @pyqtProperty(str, notify=licenseTextChanged) def licenseText(self) -> str: return self._license_text diff --git a/plugins/Marketplace/PackageList.py b/plugins/Marketplace/PackageList.py index d50e19d514..e41d28721c 100644 --- a/plugins/Marketplace/PackageList.py +++ b/plugins/Marketplace/PackageList.py @@ -136,9 +136,8 @@ class PackageList(ListModel): canInstallChanged = pyqtSignal(str, bool) - def _openLicenseDialog(self, plugin_name: str, license_content: str, icon_url: str) -> None: + def _openLicenseDialog(self, plugin_name: str, license_content: str) -> None: Logger.debug(f"Prompting license for {plugin_name}") - self._license_model.setIconUrl(icon_url) self._license_model.setPackageName(plugin_name) self._license_model.setLicenseText(license_content) self._license_dialog.show() @@ -180,8 +179,7 @@ class PackageList(ListModel): # Open actual dialog package = self.getPackageModel(package_id) plugin_name = package.displayName - icon_url = package.iconUrl - self._openLicenseDialog(plugin_name, license_content, icon_url) + self._openLicenseDialog(plugin_name, license_content) else: # Otherwise continue the installation self._install(package_id, package_path, update) diff --git a/plugins/Marketplace/resources/qml/LicenseDialog.qml b/plugins/Marketplace/resources/qml/LicenseDialog.qml index 9219f4ed32..0640379895 100644 --- a/plugins/Marketplace/resources/qml/LicenseDialog.qml +++ b/plugins/Marketplace/resources/qml/LicenseDialog.qml @@ -20,7 +20,6 @@ UM.Dialog width: minimumWidth height: minimumHeight backgroundColor: UM.Theme.getColor("main_background") - margin: screenScaleFactor * 10 ColumnLayout { @@ -29,49 +28,32 @@ UM.Dialog UM.I18nCatalog{id: catalog; name: "cura"} - Label - { - id: licenseHeader - Layout.fillWidth: true - text: catalog.i18nc("@label", "You need to accept the license to install the package") - color: UM.Theme.getColor("text") - wrapMode: Text.Wrap - renderType: Text.NativeRendering - } - Row { - id: packageRow - Layout.fillWidth: true height: childrenRect.height spacing: UM.Theme.getSize("default_margin").width leftPadding: UM.Theme.getSize("narrow_margin").width - Image + UM.RecolorImage { - id: icon - width: 30 * screenScaleFactor - height: width - sourceSize.width: width - sourceSize.height: height - fillMode: Image.PreserveAspectFit - source: licenseModel.iconUrl || "../../images/placeholder.svg" - mipmap: true + width: UM.Theme.getSize("marketplace_large_icon").width + height: UM.Theme.getSize("marketplace_large_icon").height + color: UM.Theme.getColor("text") + source: UM.Theme.getIcon("Certificate", "high") } Label { - id: packageName - text: licenseModel.packageName + text: catalog.i18nc("@text", "Please read and agree with the plugin licence.") color: UM.Theme.getColor("text") - font.bold: true + font: UM.Theme.getFont("large") anchors.verticalCenter: icon.verticalCenter - height: contentHeight + height: UM.Theme.getSize("marketplace_large_icon").height + verticalAlignment: Qt.AlignVCenter wrapMode: Text.Wrap renderType: Text.NativeRendering } - } Cura.ScrollableTextArea @@ -90,9 +72,6 @@ UM.Dialog [ Cura.PrimaryButton { - leftPadding: UM.Theme.getSize("dialog_primary_button_padding").width - rightPadding: UM.Theme.getSize("dialog_primary_button_padding").width - text: licenseModel.acceptButtonText onClicked: { handler.onLicenseAccepted() } } @@ -102,7 +81,6 @@ UM.Dialog [ Cura.SecondaryButton { - id: declineButton text: licenseModel.declineButtonText onClicked: { handler.onLicenseDeclined() } } diff --git a/resources/themes/cura-light/icons/high/Certificate.svg b/resources/themes/cura-light/icons/high/Certificate.svg new file mode 100644 index 0000000000..b588bddd8b --- /dev/null +++ b/resources/themes/cura-light/icons/high/Certificate.svg @@ -0,0 +1,3 @@ + + + diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index 149bfab308..8e9db0e9fe 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -686,6 +686,8 @@ "welcome_wizard_content_image_big": [18, 15], "welcome_wizard_cloud_content_image": [4, 4], - "banner_icon_size": [2.0, 2.0] + "banner_icon_size": [2.0, 2.0], + + "marketplace_large_icon": [4.0, 4.0] } }