Commit 4be54997 authored by Luca Carlon's avatar Luca Carlon
Browse files

Add a combo box to select the size of systray popups.

parent fcb522f8
Pipeline #145264 passed with stage
in 5 minutes and 32 seconds
......@@ -37,6 +37,10 @@
<label>Whether the popup should remain open when another window is activated</label>
<default>false</default>
</entry>
<entry name="plasmoidSize" type="int">
<label>The size of the popup containing the plasmoid</label>
<default>10</default>
</entry>
</group>
</kcfg>
......
......@@ -14,6 +14,7 @@ import org.kde.kirigami 2.13 as Kirigami
ColumnLayout {
property bool cfg_scaleIconsToFit
property int cfg_iconSpacing
property int cfg_plasmoidSize
Kirigami.FormLayout {
Layout.fillHeight: true
......@@ -81,5 +82,38 @@ ColumnLayout {
text: i18nc("@info:usagetip under a combobox when tablet mode is on", "Automatically set to Large when in tablet mode")
font: PlasmaCore.Theme.smallestFont
}
QQC2.ComboBox {
Kirigami.FormData.label: i18nc("@label:listbox The size of the plasmoid popup", "Popup size:")
model: [
{
"label": i18nc("@item:inlistbox Popup size", "Small"),
"plasmoidSize": 10
},
{
"label": i18nc("@item:inlistbox Popup size", "Normal"),
"plasmoidSize": 13
},
{
"label": i18nc("@item:inlistbox Popup size", "Large"),
"plasmoidSize": 16
}
]
textRole: "label"
enabled: !Kirigami.Settings.tabletMode
currentIndex: {
if (Kirigami.Settings.tabletMode)
return 1; // Small
switch (cfg_plasmoidSize) {
case 10: return 0; // Small
case 13: return 1; // Normal
case 16: return 2; // Large
}
}
onActivated: cfg_plasmoidSize = model[currentIndex]["plasmoidSize"]
}
}
}
......@@ -18,8 +18,9 @@ import org.kde.plasma.extras 2.0 as PlasmaExtras
Item {
id: popup
//set width/height to avoid useless Dialog resize
readonly property int defaultWidth: PlasmaCore.Units.gridUnit * 24
readonly property int defaultHeight: PlasmaCore.Units.gridUnit * 24
readonly property int sizeFactor: plasmoid.configuration.plasmoidSize ?? 1
readonly property int defaultWidth: PlasmaCore.Units.gridUnit * 24 * sizeFactor/10
readonly property int defaultHeight: PlasmaCore.Units.gridUnit * 24 * sizeFactor/10
width: defaultWidth
Layout.minimumWidth: defaultWidth
......
Supports Markdown
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