1
0
mirror of https://github.com/KDE/latte-dock.git synced 2025-01-13 05:17:48 +03:00

fix indicators special download button

--update also Default layout to something
upgraded
This commit is contained in:
Michail Vourlakos 2021-05-05 17:08:36 +03:00
parent 321a6ba512
commit 27e1619cf0
3 changed files with 48 additions and 10 deletions

View File

@ -52,6 +52,7 @@ Rectangle {
property bool comboBoxForcePressed: false
property bool comboBoxPopUpAlignRight: true
property bool comboBoxButtonIsTransparent: false
property bool comboBoxButtonIsVisible: true
property int comboBoxMinimumPopUpWidth: 150
property int comboBoxPopupTextHorizontalAlignment: Text.AlignLeft
property string comboBoxEnabledRole: ""
@ -61,6 +62,8 @@ Rectangle {
property string comboBoxIconOnlyWhenHoveredRole: ""
property string comboBoxIsSeparatorRole: ""
readonly property bool isButtonIndicatingMenuPopup: buttonIsTriggeringMenu && !comboBoxButtonIsVisible && mainComboBox.popup.visible
signal iconClicked(int index);
onExclusiveGroupChanged: {
@ -80,7 +83,7 @@ Rectangle {
LayoutMirroring.enabled: false
enabled: buttonEnabled
checked: root.checked || (buttonIsTriggeringMenu && mainComboBox.popup.visible)
visible: buttonIsTransparent ? 0 : 1
opacity: buttonIsTransparent && !isButtonIndicatingMenuPopup ? 0 : 1
/*workaround in order to replicate the proper Buttons Exclusive Group Behavior*/
checkable: root.checkable && !parent.exclusiveGroup
@ -124,6 +127,7 @@ Rectangle {
height: parent.height
enabled: comboBoxEnabled
visible: comboBoxButtonIsVisible
enabledRole: comboBoxEnabledRole
iconRole: comboBoxIconRole
@ -155,7 +159,7 @@ Rectangle {
text: buttonText
font: mainButton.font
color: buttonIsTransparent ? theme.textColor : theme.buttonTextColor
visible: root.checkable
visible: root.checkable || (mainButton.opacity === 0)
elide: Text.ElideRight
horizontalAlignment: Text.AlignHCenter

View File

@ -29,11 +29,13 @@ LatteComponents.ComboBoxButton{
id: custom
checkable: true
buttonToolTip: custom.type === "download:" ? i18n("Download indicator styles from the internet") :
i18n("Use %1 style for your indicators", buttonText)
buttonToolTip: custom.type === "install:" ? i18n("Install indicators from KDE Online Store or local files") :
i18n("Use %1 style for your indicators", buttonText)
buttonIsTransparent: true
buttonIsTriggeringMenu: true
comboBoxButtonIsTransparent: true
comboBoxButtonIsVisible: latteView.indicator.customPluginsCount > 0
comboBoxTextRole: "name"
comboBoxIconRole: "icon"
@ -69,7 +71,7 @@ LatteComponents.ComboBoxButton{
custom.updateButtonInformation();
}
}
}
}
Connections{
target: custom.button
@ -116,17 +118,15 @@ LatteComponents.ComboBoxButton{
}
function onButtonIsPressed() {
if (custom.type === "download:") {
latteView.indicator.downloadIndicator();
} else {
if (custom.type !== "install:") {
latteView.indicator.type = custom.type;
}
}
function updateButtonInformation() {
if (latteView.indicator.customPluginsCount === 0) {
custom.buttonText = i18n("Download");
custom.type = "download:";
custom.buttonText = i18n("Install...");
custom.type = "install:";
custom.checkable = false;
} else {
custom.checkable = true;

View File

@ -3,17 +3,23 @@ RightButton;NoModifier=org.kde.latte.contextmenu
[Containments][1]
activityId=
byPassWM=false
dockWindowBehavior=true
enableKWinEdges=true
formfactor=2
immutability=1
isPreferredForShortcuts=false
lastScreen=-1
layoutId=
location=4
name=Default Dock
onPrimary=true
plugin=org.kde.latte.containment
raiseOnActivityChange=false
raiseOnDesktopChange=false
timerHide=700
timerShow=200
viewType=0
visibility=2
wallpaperplugin=org.kde.image
@ -21,6 +27,9 @@ wallpaperplugin=org.kde.image
immutability=1
plugin=org.kde.latte.plasmoid
[Containments][1][Applets][2][Configuration]
PreloadWeight=0
[Containments][1][Applets][2][Configuration][General]
isInLatteDock=true
launchers59=applications:firefox.desktop,applications:org.kde.dolphin.desktop
@ -29,21 +38,46 @@ launchers59=applications:firefox.desktop,applications:org.kde.dolphin.desktop
immutability=1
plugin=org.kde.plasma.analogclock
[Containments][1][Applets][3][Configuration]
PreloadWeight=0
[Containments][1][ConfigDialog]
DialogHeight=600
DialogWidth=586
[Containments][1][Configuration]
PreloadWeight=0
[Containments][1][General]
advanced=false
alignmentUpgraded=true
appletOrder=2;3
configurationSticker=true
panelSize=10
shadowOpacity=60
shadowSize=45
shadows=All
shadowsUpgraded=true
showGlow=false
tasksUpgraded=true
titleTooltips=false
zoomLevel=17
[Containments][1][Indicator]
customType=
enabled=true
type=org.kde.latte.default
[LayoutSettings]
activities=
backgroundStyle=0
color=blue
customBackground=
customTextColor=
icon=
lastUsedActivity=
launchers=
popUpMargin=-1
preferredForShortcutsTouched=false
showInMenu=true
version=2