From 2f81ffab97fb46f7e18e14e0a5a3b9e3ad5c3f07 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Thu, 28 Mar 2019 23:53:29 +0200 Subject: [PATCH] enable custom types from combobox --- .../contents/controls/CustomIndicatorButton.qml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/shell/package/contents/controls/CustomIndicatorButton.qml b/shell/package/contents/controls/CustomIndicatorButton.qml index cb3bf15d9..d908eede8 100644 --- a/shell/package/contents/controls/CustomIndicatorButton.qml +++ b/shell/package/contents/controls/CustomIndicatorButton.qml @@ -65,6 +65,8 @@ LatteComponents.ComboBoxButton{ latteView.indicator.addIndicator(); } else if (item.pluginId === "download:") { latteView.indicator.downloadIndicator(); + } else { + latteView.indicator.type = item.pluginId; } custom.updateButtonInformation(); @@ -77,8 +79,16 @@ LatteComponents.ComboBoxButton{ custom.checkable = false; } else { custom.checkable = true; - custom.buttonText = actionsModel.get(0).name; - custom.type = actionsModel.get(0).pluginId; + + var curCustomIndex = latteView.indicator.customPluginIds.indexOf(latteView.indicator.customType); + + if (curCustomIndex>=0) { + custom.buttonText = actionsModel.get(curCustomIndex).name; + custom.type = actionsModel.get(curCustomIndex).pluginId; + } else { + custom.buttonText = actionsModel.get(0).name; + custom.type = actionsModel.get(0).pluginId; + } } }