diff --git a/applets/taskmanager/package/contents/config/config.qml b/applets/taskmanager/package/contents/config/config.qml --- a/applets/taskmanager/package/contents/config/config.qml +++ b/applets/taskmanager/package/contents/config/config.qml @@ -23,8 +23,13 @@ ConfigModel { ConfigCategory { - name: i18n("General") - icon: "preferences-system-windows" - source: "ConfigGeneral.qml" + name: i18n("Appearance") + icon: "preferences-desktop-color" + source: "ConfigAppearance.qml" + } + ConfigCategory { + name: i18n("Behavior") + icon: "preferences-desktop" + source: "ConfigBehavior.qml" } } diff --git a/applets/taskmanager/package/contents/ui/ConfigAppearance.qml b/applets/taskmanager/package/contents/ui/ConfigAppearance.qml new file mode 100644 --- /dev/null +++ b/applets/taskmanager/package/contents/ui/ConfigAppearance.qml @@ -0,0 +1,121 @@ +/*************************************************************************** + * Copyright (C) 2013 by Eike Hein * + * * + * 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 . * + ***************************************************************************/ + +import QtQuick 2.0 +import QtQuick.Controls 2.5 +import QtQuick.Layouts 1.12 +import org.kde.kirigami 2.4 as Kirigami + +import org.kde.plasma.core 2.0 as PlasmaCore + +Item { + width: childrenRect.width + height: childrenRect.height + + readonly property bool plasmaPaAvailable: Qt.createComponent("PulseAudio.qml").status === Component.Ready + + property bool plasmoidVertical: (plasmoid.formFactor == PlasmaCore.Types.Vertical) + + property alias cfg_showToolTips: showToolTips.checked + property alias cfg_highlightWindows: highlightWindows.checked + property alias cfg_smartLaunchersEnabled: smartLaunchers.checked + property bool cfg_indicateAudioStreams + property alias cfg_iconSize: iconSize.value + property alias cfg_maxStripes: maxStripes.value + property alias cfg_forceStripes: forceStripes.checked + + Kirigami.FormLayout { + anchors.left: parent.left + anchors.right: parent.right + + CheckBox { + id: showToolTips + Kirigami.FormData.label: i18n ("General:") + text: i18n("Show tooltips") + } + + CheckBox { + id: highlightWindows + text: i18n("Highlight windows when hovering over tasks") + } + + CheckBox { + id: smartLaunchers + text: i18n("Show progress and status information in task buttons") + } + + CheckBox { + id: indicateAudioStreams + text: i18n("Mark applications that play audio") + checked: cfg_indicateAudioStreams && plasmaPaAvailable + onCheckedChanged: cfg_indicateAudioStreams = checked + enabled: plasmaPaAvailable + } + + Item { + Kirigami.FormData.isSection: true + visible: plasmoidVertical + } + + Slider { + id: iconSize + visible: plasmoidVertical + Kirigami.FormData.label: i18n("Icon size:") + Layout.fillWidth: true + from: 0 + to: 5 + stepSize: 1 + } + + RowLayout { + visible: plasmoidVertical + Layout.fillWidth: true + + Label { + text: i18n("Small") + Layout.alignment: Qt.AlignLeft + } + + Item { + Layout.fillWidth: true + } + + Label { + text: i18n("Large") + Layout.alignment: Qt.AlignRight + } + } + + Item { + Kirigami.FormData.isSection: true + } + + SpinBox { + id: maxStripes + Kirigami.FormData.label: plasmoidVertical ? i18n("Maximum columns:") : i18n("Maximum rows:") + from: 1 + } + + CheckBox { + id: forceStripes + text: plasmoidVertical ? i18n("Always arrange tasks in as many rows as columns") : i18n("Always arrange tasks in as many columns as rows") + enabled: maxStripes.value > 1 + } + } +} diff --git a/applets/taskmanager/package/contents/ui/ConfigBehavior.qml b/applets/taskmanager/package/contents/ui/ConfigBehavior.qml new file mode 100644 --- /dev/null +++ b/applets/taskmanager/package/contents/ui/ConfigBehavior.qml @@ -0,0 +1,150 @@ +/*************************************************************************** + * Copyright (C) 2013 by Eike Hein * + * * + * 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 . * + ***************************************************************************/ + +import QtQuick 2.0 +import QtQuick.Controls 1.4 as QQC1 +import QtQuick.Controls 2.5 +import QtQuick.Layouts 1.12 +import org.kde.kirigami 2.4 as Kirigami + +import org.kde.plasma.core 2.0 as PlasmaCore + +Item { + width: childrenRect.width + height: childrenRect.height + + property alias cfg_groupingStrategy: groupingStrategy.currentIndex + property alias cfg_groupPopups: groupPopups.checked + property alias cfg_onlyGroupWhenFull: onlyGroupWhenFull.checked + property alias cfg_sortingStrategy: sortingStrategy.currentIndex + property alias cfg_separateLaunchers: separateLaunchers.checked + property alias cfg_middleClickAction: middleClickAction.currentIndex + property alias cfg_wheelEnabled: wheelEnabled.checked + property alias cfg_showOnlyCurrentScreen: showOnlyCurrentScreen.checked + property alias cfg_showOnlyCurrentDesktop: showOnlyCurrentDesktop.checked + property alias cfg_showOnlyCurrentActivity: showOnlyCurrentActivity.checked + property alias cfg_showOnlyMinimized: showOnlyMinimized.checked + + Kirigami.FormLayout { + anchors.left: parent.left + anchors.right: parent.right + + // TODO: port to QQC2 version once we've fixed https://bugs.kde.org/show_bug.cgi?id=403153 + QQC1.ComboBox { + id: groupingStrategy + visible: (plasmoid.pluginName != "org.kde.plasma.icontasks") + Kirigami.FormData.label: i18n("Group:") + Layout.fillWidth: true + model: [i18n("Do not group"), i18n("By program name")] + } + + CheckBox { + id: groupPopups + visible: (plasmoid.pluginName != "org.kde.plasma.icontasks") + text: i18n("Open groups in popups") + enabled: groupingStrategy.currentIndex > 0 + } + + RowLayout { + visible: (plasmoid.pluginName != "org.kde.plasma.icontasks") + + // Indent the option as it depends on the previous one + Item { + width: units.largeSpacing + } + + CheckBox { + id: onlyGroupWhenFull + text: i18n("Group only when the Task Manager is full") + enabled: groupingStrategy.currentIndex > 0 && groupPopups.checked + } + } + + Item { + Kirigami.FormData.isSection: true + visible: (plasmoid.pluginName != "org.kde.plasma.icontasks") + } + + // TODO: port to QQC2 version once we've fixed https://bugs.kde.org/show_bug.cgi?id=403153 + QQC1.ComboBox { + id: sortingStrategy + visible: (plasmoid.pluginName != "org.kde.plasma.icontasks") + Kirigami.FormData.label: i18n("Sort:") + Layout.fillWidth: true + model: [i18n("Do not sort"), i18n("Manually"), i18n("Alphabetically"), i18n("By desktop"), i18n("By activity")] + } + + CheckBox { + id: separateLaunchers + visible: (plasmoid.pluginName != "org.kde.plasma.icontasks") + text: i18n("Keep launchers separate") + enabled: sortingStrategy.currentIndex == 1 + } + + Item { + Kirigami.FormData.isSection: true + visible: (plasmoid.pluginName != "org.kde.plasma.icontasks") + } + + // TODO: port to QQC2 version once we've fixed https://bugs.kde.org/show_bug.cgi?id=403153 + QQC1.ComboBox { + id: middleClickAction + Kirigami.FormData.label: i18n("On middle-click:") + Layout.fillWidth: true + model: [ + i18nc("The click action", "None"), + i18n("Close window or group"), + i18n("New instance"), + i18n("Minimize/Restore window or group"), + i18nc("When clicking it would toggle grouping windows of a specific app", "Group/Ungroup") + ] + } + + CheckBox { + id: wheelEnabled + text: i18n("Cycle through tasks with mouse wheel") + } + + Item { + Kirigami.FormData.isSection: true + } + + CheckBox { + id: showOnlyCurrentScreen + Kirigami.FormData.label: i18n("Filter:") + text: i18n("Show only tasks from the current screen") + } + + CheckBox { + id: showOnlyCurrentDesktop + text: i18n("Show only tasks from the current desktop") + } + + CheckBox { + id: showOnlyCurrentActivity + text: i18n("Show only tasks from the current activity") + } + + CheckBox { + id: showOnlyMinimized + visible: (plasmoid.pluginName != "org.kde.plasma.icontasks") + text: i18n("Show only tasks that are minimized") + } + } +} diff --git a/applets/taskmanager/package/contents/ui/ConfigGeneral.qml b/applets/taskmanager/package/contents/ui/ConfigGeneral.qml deleted file mode 100644 --- a/applets/taskmanager/package/contents/ui/ConfigGeneral.qml +++ /dev/null @@ -1,285 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2013 by Eike Hein * - * * - * 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 . * - ***************************************************************************/ - -import QtQuick 2.0 -import QtQuick.Controls 1.0 -import QtQuick.Layouts 1.0 - -import org.kde.plasma.core 2.0 as PlasmaCore - -Item { - width: childrenRect.width - height: childrenRect.height - - property bool vertical: (plasmoid.formFactor == PlasmaCore.Types.Vertical) - - readonly property bool plasmaPaAvailable: Qt.createComponent("PulseAudio.qml").status === Component.Ready - - property alias cfg_forceStripes: forceStripes.checked - property alias cfg_iconSize: iconSize.value - property alias cfg_showToolTips: showToolTips.checked - property alias cfg_wheelEnabled: wheelEnabled.checked - property alias cfg_highlightWindows: highlightWindows.checked - property alias cfg_smartLaunchersEnabled: smartLaunchers.checked - property bool cfg_indicateAudioStreams - property alias cfg_maxStripes: maxStripes.value - property alias cfg_groupingStrategy: groupingStrategy.currentIndex - property alias cfg_middleClickAction: middleClickAction.currentIndex - property alias cfg_groupPopups: groupPopups.checked - property alias cfg_onlyGroupWhenFull: onlyGroupWhenFull.checked - property alias cfg_sortingStrategy: sortingStrategy.currentIndex - property alias cfg_separateLaunchers: separateLaunchers.checked - property alias cfg_showOnlyCurrentScreen: showOnlyCurrentScreen.checked - property alias cfg_showOnlyCurrentDesktop: showOnlyCurrentDesktop.checked - property alias cfg_showOnlyCurrentActivity: showOnlyCurrentActivity.checked - property alias cfg_showOnlyMinimized: showOnlyMinimized.checked - - ColumnLayout { - anchors.left: parent.left - GroupBox { - Layout.fillWidth: true - - title: i18n("Arrangement") - flat: true - - GridLayout { - columns: 4 - Layout.fillWidth: true - - Label { - text: vertical ? i18n("Maximum columns:") : i18n("Maximum rows:") - } - - SpinBox { - id: maxStripes - minimumValue: 1 - Layout.columnSpan: 3 - } - - CheckBox { - id: forceStripes - Layout.column: 1 - Layout.row: 1 - text: vertical ? i18n("Always arrange tasks in rows of as many columns") : i18n("Always arrange tasks in columns of as many rows") - enabled: maxStripes.value > 1 - Layout.columnSpan: 3 - } - - Label { - visible: vertical - text: i18n("Icon size:") - } - - Label { - visible: vertical - text: i18n("Small") - } - - Slider { - Layout.fillWidth: true - visible: vertical - id: iconSize - - minimumValue: 0 - maximumValue: 5 - stepSize: 1 - - tickmarksEnabled: true - } - - Label { - visible: vertical - text: i18n("Large") - } - - } - } - - GroupBox { - Layout.fillWidth: true - - title: i18n("Behavior") - flat: true - - ColumnLayout { - Layout.fillWidth: true - - CheckBox { - id: showToolTips - text: i18n("Show tooltips") - } - - CheckBox { - id: wheelEnabled - text: i18n("Cycle through tasks with mouse wheel") - } - - CheckBox { - id: highlightWindows - text: i18n("Highlight windows") - } - - CheckBox { - id: smartLaunchers - Layout.fillWidth: true - text: i18n("Show progress and status information in task buttons") - } - - CheckBox { - id: indicateAudioStreams - Layout.fillWidth: true - text: i18n("Mark applications that play audio") - checked: cfg_indicateAudioStreams && plasmaPaAvailable - onCheckedChanged: cfg_indicateAudioStreams = checked - enabled: plasmaPaAvailable - } - - RowLayout { - Label { - text: i18n("On middle-click:") - } - - ComboBox { - id: middleClickAction - Layout.fillWidth: true - model: [ - i18nc("The click action", "None"), - i18n("Close Window or Group"), - i18n("New Instance"), - i18n("Minimize/Restore Window or Group"), - i18nc("When clicking it would toggle grouping windows of a specific app", "Group/Ungroup") - ] - } - } - } - } - - GroupBox { - Layout.fillWidth: true - - title: i18n("Grouping and Sorting") - flat: true - - visible: (plasmoid.pluginName != "org.kde.plasma.icontasks") - - ColumnLayout { - GridLayout { - columns: 3 - Label { - Layout.fillWidth: true - text: i18n("Sorting:") - horizontalAlignment: Text.AlignRight - } - - ComboBox { - id: sortingStrategy - Layout.fillWidth: true - model: [i18n("Do Not Sort"), i18n("Manually"), i18n("Alphabetically"), i18n("By Desktop"), i18n("By Activity")] - } - - CheckBox { - id: separateLaunchers - Layout.column: 1 - Layout.row: 1 - Layout.columnSpan: 2 - text: i18n("Keep launchers separate") - enabled: sortingStrategy.currentIndex == 1 - } - - Label { - Layout.fillWidth: true - Layout.row: 2 - Layout.column: 0 - text: i18n("Grouping:") - horizontalAlignment: Text.AlignRight - } - - ComboBox { - id: groupingStrategy - Layout.row: 2 - Layout.column: 1 - Layout.fillWidth: true - model: [i18n("Do Not Group"), i18n("By Program Name")] - } - - CheckBox { - id: groupPopups - Layout.column: 1 - Layout.row: 3 - Layout.columnSpan: 2 - text: i18n("Open groups in popups") - enabled: groupingStrategy.currentIndex > 0 - } - - Item { - width: childrenRect.width - height: childrenRect.height - - Layout.column: 1 - Layout.row: 4 - Layout.columnSpan: 2 - - CheckBox { - id: onlyGroupWhenFull - anchors.left: parent.left - anchors.leftMargin: units.gridUnit - text: i18n("Only group when the task manager is full") - enabled: groupingStrategy.currentIndex > 0 && groupPopups.checked - } - } - } - - } - } - - GroupBox { - Layout.fillWidth: true - - title: i18n("Filters") - flat: true - - ColumnLayout { - Layout.fillWidth: true - - CheckBox { - id: showOnlyCurrentScreen - text: i18n("Show only tasks from the current screen") - } - - CheckBox { - id: showOnlyCurrentDesktop - text: i18n("Show only tasks from the current desktop") - } - - CheckBox { - id: showOnlyCurrentActivity - text: i18n("Show only tasks from the current activity") - } - - CheckBox { - id: showOnlyMinimized - - visible: (plasmoid.pluginName != "org.kde.plasma.icontasks") - - text: i18n("Show only tasks that are minimized") - } - } - } - } -}