Commit 331b9a9c authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇 Committed by Nate Graham
Browse files

[Clipboard Applet] Remember last used barcode type

parent fad6830b
Pipeline #147927 passed with stage
in 10 minutes and 42 seconds
<?xml version="1.0" encoding="UTF-8"?>
<kcfg xmlns="http://www.kde.org/standards/kcfg/1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0
http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" >
<kcfgfile name=""/>
<group name="General">
<entry name="barcodeType" type="Int">
<default>1</default><!-- Prison::BarcodeType::QRCode -->
</entry>
</group>
</kcfg>
......@@ -9,6 +9,7 @@ import QtQuick.Layouts 1.1
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents // For ContextMenu
import org.kde.plasma.components 3.0 as PlasmaComponents3
import org.kde.plasma.plasmoid 2.0
import org.kde.kquickcontrolsaddons 2.0
import org.kde.plasma.extras 2.0 as PlasmaExtras
......@@ -69,6 +70,7 @@ ColumnLayout {
});
menuItem.clicked.connect(() => {
barcodeItem.barcodeType = item.type;
Plasmoid.configuration.barcodeType = item.type;
});
menu.addMenuItem(menuItem);
});
......@@ -96,7 +98,7 @@ ColumnLayout {
id: barcodeItem
readonly property bool valid: implicitWidth > 0 && implicitHeight > 0 && implicitWidth <= width && implicitHeight <= height
anchors.fill: parent
barcodeType: Prison.Barcode.QRCode
barcodeType: Plasmoid.configuration.barcodeType
// Cannot set visible to false as we need it to re-render when changing its size
opacity: valid ? 1 : 0
}
......
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