aerothemeplasma/plasma/plasmoids/io.gitgud.wackyideas.SevenStart/contents/ui/ConfigGeneral.qml

181 lines
6.1 KiB
QML
Raw Normal View History

2023-09-27 17:50:10 +00:00
/***************************************************************************
* Copyright (C) 2014 by Eike Hein <hein@kde.org> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . *
***************************************************************************/
2024-08-09 01:20:25 +00:00
import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Dialogs
import QtQuick.Layouts
2023-09-27 17:50:10 +00:00
import org.kde.plasma.core 2.0 as PlasmaCore
2024-08-09 01:20:25 +00:00
import org.kde.plasma.components 3.0 as PlasmaComponents
import org.kde.kcmutils as KCM
2023-09-27 17:50:10 +00:00
import org.kde.draganddrop 2.0 as DragDrop
2024-08-09 01:20:25 +00:00
import org.kde.kirigami 2.3 as Kirigami
import org.kde.plasma.plasmoid 2.0
2023-09-27 17:50:10 +00:00
2024-08-09 01:20:25 +00:00
import org.kde.iconthemes as KIconThemes
2023-09-27 17:50:10 +00:00
import org.kde.plasma.private.kicker 0.1 as Kicker
2024-08-09 01:20:25 +00:00
KCM.SimpleKCM {
2023-09-27 17:50:10 +00:00
id: configGeneral
width: childrenRect.width
height: childrenRect.height
2024-08-09 01:20:25 +00:00
property string cfg_icon: Plasmoid.configuration.icon
2023-09-27 17:50:10 +00:00
2024-08-09 01:20:25 +00:00
property bool cfg_useCustomButtonImage: Plasmoid.configuration.useCustomButtonImage
2023-09-27 17:50:10 +00:00
2024-08-09 01:20:25 +00:00
property string cfg_customButtonImage: Plasmoid.configuration.customButtonImage
property string cfg_customButtonImageHover: Plasmoid.configuration.customButtonImageHover
property string cfg_customButtonImageActive: Plasmoid.configuration.customButtonImageActive
2023-09-27 17:50:10 +00:00
property alias cfg_showRecentsView: showRecentsView.checked
property alias cfg_appNameFormat: appNameFormat.currentIndex
property alias cfg_switchCategoriesOnHover: switchCategoriesOnHover.checked
property alias cfg_stickOutOrb: stickOutOrb.checked
property alias cfg_useExtraRunners: useExtraRunners.checked
property alias cfg_numberRows: numberRows.value
2024-08-09 01:20:25 +00:00
component CustomGroupBox: GroupBox {
id: gbox
label: Label {
id: lbl
x: gbox.leftPadding + 2
y: lbl.implicitHeight/2-gbox.bottomPadding-1
width: lbl.implicitWidth
text: gbox.title
elide: Text.ElideRight
Rectangle {
anchors.fill: parent
anchors.leftMargin: -2
anchors.rightMargin: -2
color: Kirigami.Theme.backgroundColor
z: -1
}
}
background: Rectangle {
y: gbox.topPadding - gbox.bottomPadding*2
width: parent.width
height: parent.height - gbox.topPadding + gbox.bottomPadding*2
color: "transparent"
border.color: "#d5dfe5"
radius: 3
}
}
2023-09-27 17:50:10 +00:00
ColumnLayout {
anchors.left: parent.left
anchors.right: parent.right
2024-08-09 01:20:25 +00:00
anchors.leftMargin: Kirigami.Units.gridUnit*4
anchors.rightMargin: Kirigami.Units.gridUnit*4
2023-09-27 17:50:10 +00:00
2024-08-09 01:20:25 +00:00
CustomGroupBox {
id: orbGroup
title: i18n("Orb texture")
Layout.fillWidth: true
2023-09-27 17:50:10 +00:00
IconPicker {
id: iconPickerNormal
currentIcon: cfg_customButtonImage
defaultIcon: ""
2024-08-09 01:20:25 +00:00
onIconChanged: iconName => { cfg_customButtonImage = iconName; }
anchors.right: parent.right
anchors.left: parent.left
2023-09-27 17:50:10 +00:00
}
2024-08-09 01:20:25 +00:00
}
CustomGroupBox {
2023-09-27 17:50:10 +00:00
Layout.fillWidth: true
title: i18n("Behavior")
2024-08-09 01:20:25 +00:00
//flat: false
2023-09-27 17:50:10 +00:00
ColumnLayout {
2024-08-09 01:20:25 +00:00
2023-09-27 17:50:10 +00:00
RowLayout {
2024-08-09 01:20:25 +00:00
visible: false
2023-09-27 17:50:10 +00:00
Label {
text: i18n("Show applications as:")
}
ComboBox {
id: appNameFormat
Layout.fillWidth: true
model: [i18n("Name only"), i18n("Description only"), i18n("Name (Description)"), i18n("Description (Name)")]
}
}
CheckBox {
id: switchCategoriesOnHover
2024-08-09 01:20:25 +00:00
visible: false
2023-09-27 17:50:10 +00:00
text: i18n("Switch categories on hover")
}
2024-08-09 01:20:25 +00:00
CheckBox {
id: useExtraRunners
visible: false
text: i18n("Expand search to bookmarks, files and emails")
}
2023-09-27 17:50:10 +00:00
CheckBox {
id: stickOutOrb
text: i18n("Force constant orb size")
}
CheckBox {
2024-08-09 01:20:25 +00:00
id: showRecentsView
text: i18n("Show recent programs")
2023-09-27 17:50:10 +00:00
}
RowLayout{
Layout.fillWidth: true
2024-08-09 01:20:25 +00:00
Label {
Layout.leftMargin: Kirigami.Units.smallSpacing
text: i18n("Number of rows:")
2023-09-27 17:50:10 +00:00
}
2024-08-09 01:20:25 +00:00
SpinBox{
id: numberRows
from: 10
to: 15
2023-09-27 17:50:10 +00:00
}
}
}
}
2024-08-09 01:20:25 +00:00
}
Component.onCompleted: {
if(Plasmoid.configuration.stickOutOrb) Plasmoid.setTransparentWindow();
}
Component.onDestruction: {
if(Plasmoid.configuration.stickOutOrb) Plasmoid.setTransparentWindow();
2023-09-27 17:50:10 +00:00
}
}