Commit 7ef47a72 authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇
Browse files

[Clipboard plasmoid] Improved barcode selection button

Right-align the menu to the button and keep the button highlighted while it is open.

Differential Revision: https://phabricator.kde.org/D10562
parent 53ed39aa
......@@ -18,6 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*********************************************************************/
import QtQuick 2.0
import QtQuick.Layouts 1.1
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.kquickcontrolsaddons 2.0
......@@ -56,10 +57,18 @@ ColumnLayout {
PlasmaComponents.ContextMenu {
id: menu
visualParent: configureButton
placement: PlasmaCore.Types.BottomPosedLeftAlignedPopup
onStatusChanged: {
if (status == PlasmaComponents.DialogStatus.Closed) {
configureButton.checked = false;
}
}
function change(type) {
barcodeView.barcodeType = type;
barcodeView.show(barcodeView.uuid);
}
PlasmaComponents.MenuItem {
text: i18n("QR Code")
checkable: true
......@@ -87,9 +96,10 @@ ColumnLayout {
}
PlasmaComponents.ToolButton {
id: configureButton
checkable: true
iconSource: "configure"
tooltip: i18n("Change the barcode type")
onClicked: menu.open(0, configureButton.height)
onClicked: menu.openRelative()
}
}
QImageItem {
......
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