Summary:
Combines settings of SNI icons and plasmoids in one list. Ability to disable whole section is removed.
Initial idea was proposed by Nicolas Fella (D22176).
BUG: 360307
FIXED-IN: 5.18.0
{F7880936}
Test Plan:
1. Disable/enable plasmoids
2. Set Shown/Hidden for plasmoid
3. Set shortcut for plasmoid
4. Previously hidden categories are shown
5. Show all icons and revert
6. Set Auto/Shown/Hidden for SNI icons
Reviewers: #plasma_workspaces, #plasma, davidedmundson, broulik, ngraham, mart
Reviewed By: #plasma_workspaces, #plasma, ngraham, mart
Subscribers: ahiemstra, mart, meven, nicolasfella, plasma-devel, ngraham
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D26586
wilder-5.18
parent
505ce9929b
commit
e2bfeb160b
9 changed files with 238 additions and 343 deletions
@ -1,123 +0,0 @@ |
||||
/* |
||||
* Copyright 2013 Sebastian Kügler <sebas@kde.org> |
||||
* Copyright 2014 Marco Martin <mart@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 2.010-1301, USA. |
||||
*/ |
||||
|
||||
import QtQuick 2.0 |
||||
import QtQuick.Controls 2.3 as QtControls |
||||
import QtQuick.Layouts 1.0 as QtLayouts |
||||
|
||||
import org.kde.kquickcontrolsaddons 2.0 |
||||
import org.kde.kirigami 2.5 as Kirigami |
||||
|
||||
Item { |
||||
id: iconsPage |
||||
|
||||
signal configurationChanged |
||||
|
||||
width: childrenRect.width |
||||
height: childrenRect.height |
||||
implicitWidth: mainColumn.implicitWidth |
||||
implicitHeight: pageColumn.implicitHeight |
||||
|
||||
property alias cfg_applicationStatusShown: applicationStatus.checked |
||||
property alias cfg_communicationsShown: communications.checked |
||||
property alias cfg_systemServicesShown: systemServices.checked |
||||
property alias cfg_hardwareControlShown: hardwareControl.checked |
||||
property alias cfg_miscellaneousShown: miscellaneous.checked |
||||
property var cfg_extraItems: [] |
||||
|
||||
QtControls.CheckBox { |
||||
id: dummyCheckbox |
||||
visible: false |
||||
} |
||||
|
||||
Kirigami.FormLayout { |
||||
id: pageColumn |
||||
anchors { |
||||
left: parent.left |
||||
right: parent.right |
||||
} |
||||
|
||||
Item { |
||||
Kirigami.FormData.isSection: true |
||||
Kirigami.FormData.label: i18n("Categories") |
||||
} |
||||
|
||||
QtControls.CheckBox { |
||||
id: applicationStatus |
||||
text: i18n("Application Status") |
||||
} |
||||
QtControls.CheckBox { |
||||
id: communications |
||||
text: i18n("Communications") |
||||
} |
||||
QtControls.CheckBox { |
||||
id: systemServices |
||||
text: i18n("System Services") |
||||
} |
||||
QtControls.CheckBox { |
||||
id: hardwareControl |
||||
text: i18n("Hardware Control") |
||||
} |
||||
QtControls.CheckBox { |
||||
id: miscellaneous |
||||
text: i18n("Miscellaneous") |
||||
} |
||||
|
||||
|
||||
Item { |
||||
Kirigami.FormData.isSection: true |
||||
Kirigami.FormData.label: i18n("Extra Items") |
||||
} |
||||
|
||||
Repeater { |
||||
model: plasmoid.nativeInterface.availablePlasmoids |
||||
delegate: QtControls.CheckBox { |
||||
QtLayouts.Layout.minimumWidth: childrenRect.width |
||||
checked: cfg_extraItems.indexOf(itemId) != -1 |
||||
implicitWidth: itemLayout.width + itemLayout.x |
||||
onCheckedChanged: { |
||||
var index = cfg_extraItems.indexOf(itemId); |
||||
if (checked) { |
||||
if (index === -1) { |
||||
cfg_extraItems.push(itemId); |
||||
} |
||||
} else { |
||||
if (index > -1) { |
||||
cfg_extraItems.splice(index, 1); |
||||
} |
||||
} |
||||
configurationChanged() // qml cannot detect changes inside an Array |
||||
} |
||||
QtLayouts.RowLayout { |
||||
id: itemLayout |
||||
anchors.verticalCenter: parent.verticalCenter |
||||
x: dummyCheckbox.width |
||||
QIconItem { |
||||
icon: model.decoration |
||||
width: Kirigami.Units.iconSizes.small |
||||
height: width |
||||
} |
||||
QtControls.Label { |
||||
text: model.display |
||||
} |
||||
} |
||||
} |
||||
} |
||||
} |
||||
} |
||||
Loading…
Reference in new issue