Commit 097ad69d authored by Benjamin Port's avatar Benjamin Port
Browse files

Add immutability to KCM Icons

Summary: Add immutability to KCM Icons, disable theme delegate and not the whole grid in order to allow user to change icon size if not immutable too

Test Plan: Add [$i] to kdeglobals key

Reviewers: #plasma, ervin, ngraham, crossi, meven

Subscribers: broulik, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D26045
parent 9dacd46f
...@@ -110,7 +110,7 @@ QtControls.Popup { ...@@ -110,7 +110,7 @@ QtControls.Popup {
to: sizes.length - 1 to: sizes.length - 1
stepSize: 1.0 stepSize: 1.0
snapMode: QtControls.Slider.SnapAlways snapMode: QtControls.Slider.SnapAlways
enabled: sizes.length > 0 enabled: sizes.length > 0 && !kcm.iconsSettings.isImmutable(iconTypeList.currentItem.configKey)
onMoved: { onMoved: {
kcm.iconsSettings[iconTypeList.currentItem.configKey] = iconSizeSlider.sizes[iconSizeSlider.value] || 0 kcm.iconsSettings[iconTypeList.currentItem.configKey] = iconSizeSlider.sizes[iconSizeSlider.value] || 0
......
...@@ -36,8 +36,10 @@ KCM.GridViewKCM { ...@@ -36,8 +36,10 @@ KCM.GridViewKCM {
view.model: kcm.iconsModel view.model: kcm.iconsModel
view.currentIndex: kcm.pluginIndex(kcm.iconsSettings.theme) view.currentIndex: kcm.pluginIndex(kcm.iconsSettings.theme)
enabled: !kcm.downloadingFile enabled: !kcm.downloadingFile
view.enabled: !kcm.iconsSettings.isImmutable("Theme")
DropArea { DropArea {
enabled: !kcm.iconsSettings.isImmutable("Theme")
anchors.fill: parent anchors.fill: parent
onEntered: { onEntered: {
if (!drag.hasUrls) { if (!drag.hasUrls) {
...@@ -242,6 +244,7 @@ KCM.GridViewKCM { ...@@ -242,6 +244,7 @@ KCM.GridViewKCM {
} }
QtControls.Button { QtControls.Button {
enabled: !kcm.iconsSettings.isImmutable("Theme")
id: installFromFileButton id: installFromFileButton
text: i18n("Install from File...") text: i18n("Install from File...")
icon.name: "document-import" icon.name: "document-import"
...@@ -249,6 +252,7 @@ KCM.GridViewKCM { ...@@ -249,6 +252,7 @@ KCM.GridViewKCM {
} }
QtControls.Button { QtControls.Button {
enabled: !kcm.iconsSettings.isImmutable("Theme")
text: i18n("Get New Icons...") text: i18n("Get New Icons...")
icon.name: "get-hot-new-stuff" icon.name: "get-hot-new-stuff"
onClicked: kcm.getNewStuff(this) onClicked: kcm.getNewStuff(this)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment