diff --git a/containment/package/contents/ui/layouts/indicator/Bridge.qml b/containment/package/contents/ui/layouts/indicator/Bridge.qml index 41f2cf5f..06351d7e 100644 --- a/containment/package/contents/ui/layouts/indicator/Bridge.qml +++ b/containment/package/contents/ui/layouts/indicator/Bridge.qml @@ -1,79 +1,81 @@ /* * Copyright 2019 Michail Vourlakos * * This file is part of Latte-Dock * * Latte-Dock 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. * * Latte-Dock 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, see . */ import QtQuick 2.7 import org.kde.latte 0.2 as Latte Item{ id: indicatorBridge anchors.fill: parent readonly property bool active: true /* Indicators Properties in order use them*/ readonly property bool isTask: false readonly property bool isApplet: false readonly property bool isEmptySpace: true /*since 0.9.3*/ readonly property bool isLauncher: false readonly property bool isStartup: false readonly property bool isWindow: false readonly property bool isActive: false readonly property bool isGroup: false readonly property bool isHovered: false readonly property bool isMinimized: false readonly property bool isPressed: mainArea.pressed readonly property bool inAttention: false readonly property bool inRemoving: false readonly property bool isSquare: false readonly property bool hasActive: false readonly property bool hasMinimized: false readonly property bool hasShown: false readonly property int windowsCount: 0 readonly property int windowsMinimizedCount: 0 readonly property int currentIconSize: root.iconSize readonly property int maxIconSize: root.maxIconSize readonly property real scaleFactor: 1 readonly property real panelOpacity: root.currentPanelOpacity readonly property color shadowColor: root.appShadowColorSolid readonly property bool animationsEnabled: root.animationsEnabled readonly property real durationTime: root.durationTime readonly property bool progressVisible: false /*since 0.9.2*/ readonly property real progress: 0 /*since 0.9.2*/ + readonly property int screenEdgeMargin: 0 /*since 0.10*/ + readonly property bool usePlasmaTabsStyle: !indicators.enabledForApplets readonly property QtObject palette: colorizerManager.applyTheme //!icon colors property color iconBackgroundColor: "brown" property color iconGlowColor: "pink" //! grouped options readonly property Item shared: indicators readonly property QtObject configuration: indicators.configuration readonly property QtObject resources: indicators.resources } diff --git a/containment/package/contents/ui/layouts/indicator/Loader.qml b/containment/package/contents/ui/layouts/indicator/Loader.qml index 5d6bd5ad..a9c8ffdd 100644 --- a/containment/package/contents/ui/layouts/indicator/Loader.qml +++ b/containment/package/contents/ui/layouts/indicator/Loader.qml @@ -1,43 +1,43 @@ /* * Copyright 2019 Michail Vourlakos * * This file is part of Latte-Dock * * Latte-Dock 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. * * Latte-Dock 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, see . */ import QtQuick 2.7 import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.latte 0.2 as Latte Loader { id: indicatorLoader anchors.fill: parent active: level.bridge && level.bridge.active && (level.isBackground || (level.isForeground && indicators.info.providesFrontLayer)) sourceComponent: indicators.indicatorComponent //! Communications !// property Item level Connections { target: mainArea enabled: indicators.info.needsMouseEventCoordinates onPressed: level.mousePressed(mouse.x, mouse.y, mouse.button); - onMouseReleased: level.mouseReleased(mouse.x, mouse.y, mouse.button); + onReleased: level.mouseReleased(mouse.x, mouse.y, mouse.button); } } diff --git a/shell/package/contents/configuration/LatteDockConfiguration.qml b/shell/package/contents/configuration/LatteDockConfiguration.qml index 4cc7aee6..eed5e2bd 100644 --- a/shell/package/contents/configuration/LatteDockConfiguration.qml +++ b/shell/package/contents/configuration/LatteDockConfiguration.qml @@ -1,700 +1,700 @@ /* * Copyright 2016 Smith AR * Michail Vourlakos * * This file is part of Latte-Dock * * Latte-Dock 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. * * Latte-Dock 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, see . */ import QtQuick 2.7 import QtQuick.Controls 1.4 import QtQuick.Layouts 1.3 import QtGraphicalEffects 1.0 import QtQuick.Window 2.2 import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.components 2.0 as PlasmaComponents import org.kde.plasma.components 3.0 as PlasmaComponents3 import org.kde.plasma.extras 2.0 as PlasmaExtras import QtQuick.Controls.Styles.Plasma 2.0 as Styles import org.kde.plasma.plasmoid 2.0 import org.kde.kquickcontrolsaddons 2.0 as KQuickControlAddons import org.kde.latte 0.2 as Latte import org.kde.latte.components 1.0 as LatteComponents import "pages" as Pages import "../controls" as LatteExtraControls FocusScope { id: dialog readonly property bool basicLevel: viewConfig.complexity === Latte.Types.BasicSettings readonly property bool advancedLevel: viewConfig.complexity === Latte.Types.AdvancedSettings readonly property bool expertLevel: viewConfig.complexity === Latte.Types.ExpertSettings readonly property bool highLevel: advancedLevel || expertLevel readonly property bool inConfigureAppletsMode: plasmoid.configuration.inConfigureAppletsMode || !Latte.WindowSystem.compositingActive //! max size based on screen resolution //! TODO: if we can access availableScreenGeometry.height this can be improved, currently //! we use 100px. or 50px. in order to give space for othe views to be shown and to have also //! some space around the settings window property int maxHeight: plasmoid.formFactor === PlasmaCore.Types.Horizontal ? viewConfig.availableScreenGeometry.height - (latteView.editThickness - latteView.normalThickness) - 16 : viewConfig.availableScreenGeometry.height - 2 * units.largeSpacing property int maxWidth: 0.6 * latteView.screenGeometry.width //! propose size based on font size property int proposedWidth: 0.82 * proposedHeight + units.smallSpacing * 2 property int proposedHeight: 36 * theme.mSize(theme.defaultFont).height //! chosen size to be applied, if the user has set or not a different scale for the settings window property int chosenWidth: userScaleWidth !== 1 ? userScaleWidth * proposedWidth : proposedWidth property int chosenHeight: userScaleHeight !== 1 ? userScaleHeight * heightLevel * proposedHeight : heightLevel * proposedHeight readonly property int optionsWidth: appliedWidth - units.smallSpacing * 10 //! user set scales based on its preference, e.g. 96% of the proposed size property real userScaleWidth: 1 property real userScaleHeight: 1 readonly property real heightLevel: (dialog.expertLevel ? 100 : 1) onHeightChanged: viewConfig.syncGeometry(); //! applied size in order to not be out of boundaries //! width can be between 200px - maxWidth //! height can be between 400px - maxHeight property int appliedWidth: Math.min(maxWidth, Math.max(200, chosenWidth)) property int appliedHeight: Math.min(maxHeight, Math.max(400, chosenHeight)) width: appliedWidth height: appliedHeight Layout.minimumWidth: width Layout.minimumHeight: height LayoutMirroring.enabled: Qt.application.layoutDirection === Qt.RightToLeft LayoutMirroring.childrenInherit: true readonly property bool viewIsPanel: latteView.type === Latte.Types.PanelView property bool panelIsVertical: plasmoid.formFactor === PlasmaCore.Types.Vertical property int subGroupSpacing: units.largeSpacing + units.smallSpacing * 1.5 property color bC: theme.backgroundColor property color transparentBackgroundColor: Qt.rgba(bC.r, bC.g, bC.b, 0.7) onHighLevelChanged: { //! switch to appearancePage when effectsPage becomes hidden because //! advancedLevel was disabled by the user if (!highLevel && tabGroup.currentTab === effectsPage) { tabGroup.currentTab = appearancePage; tabBar.currentTab = appearanceTabBtn; } } Component.onCompleted: { updateScales(); } Connections { target: latteView.positioner onCurrentScreenNameChanged: dialog.updateScales(); } function updateScales() { userScaleWidth = universalSettings.screenWidthScale(latteView.positioner.currentScreenName); userScaleHeight = universalSettings.screenHeightScale(latteView.positioner.currentScreenName); } PlasmaCore.FrameSvgItem{ anchors.fill: parent imagePath: "dialogs/background" enabledBorders: viewConfig.enabledBorders } MouseArea{ id: backgroundMouseArea anchors.fill: parent hoverEnabled: true property bool blockWheel: false property bool updatingWidthScale: false property bool updatingHeightScale: false property bool wheelTriggeredOnce: false property real scaleStep: 0.04 onWheel: { var metaModifier = (wheel.modifiers & Qt.MetaModifier); var ctrlModifier = (wheel.modifiers & Qt.ControlModifier); if (blockWheel || !(metaModifier || ctrlModifier)){ return; } updatingWidthScale = metaModifier || (dialog.expertLevel && ctrlModifier); updatingHeightScale = !dialog.expertLevel && ctrlModifier; blockWheel = true; wheelTriggeredOnce = true; scrollDelayer.start(); var angle = wheel.angleDelta.y / 8; //positive direction if (angle > 12) { var scales; if (updatingWidthScale) { userScaleWidth = userScaleWidth + scaleStep; } if (updatingHeightScale) { userScaleHeight = userScaleHeight + scaleStep; } universalSettings.setScreenScales(latteView.positioner.currentScreenName, userScaleWidth, userScaleHeight); viewConfig.syncGeometry(); //negative direction } else if (angle < -12) { if (updatingWidthScale) { userScaleWidth = userScaleWidth - scaleStep; } if (updatingHeightScale) { userScaleHeight = userScaleHeight - scaleStep; } universalSettings.setScreenScales(latteView.positioner.currentScreenName, userScaleWidth, userScaleHeight); viewConfig.syncGeometry(); } } } PlasmaComponents.Button { id: backgroundMouseAreaTooltip anchors.fill: parent opacity: 0 - tooltip: i18n("You can use Ctrl/Meta + Scroll Wheel to alter the window size") + //tooltip: i18n("You can use Ctrl/Meta + Scroll Wheel to alter the window size") onHoveredChanged: { if (!hovered) { backgroundMouseArea.wheelTriggeredOnce = false; } } } PlasmaComponents.Label{ anchors.top: parent.top anchors.horizontalCenter: parent.horizontalCenter text: backgroundMouseArea.updatingWidthScale ? i18nc("view settings width scale","Width scale at %0%").arg(userScaleWidth * 100) : i18nc("view settings height scale","Height scale at %0%").arg(userScaleHeight * 100) visible: backgroundMouseAreaTooltip.hovered && backgroundMouseArea.wheelTriggeredOnce } //! A timer is needed in order to handle also touchpads that probably //! send too many signals very fast. This way the signals per sec are limited. //! The user needs to have a steady normal scroll in order to not //! notice a annoying delay Timer{ id: scrollDelayer interval: 75 onTriggered: backgroundMouseArea.blockWheel = false; } ColumnLayout { id: content Layout.minimumWidth: width Layout.minimumHeight: calculatedHeight Layout.preferredWidth: width Layout.preferredHeight: calculatedHeight width: (dialog.appliedWidth - units.smallSpacing * 2) anchors.horizontalCenter: parent.horizontalCenter anchors.top: parent.top spacing: units.smallSpacing property int calculatedHeight: header.height + headerSpacer.height+ tabBar.height + pagesBackground.height + actionButtons.height + spacing * 3 Keys.onPressed: { if (event.key === Qt.Key_Escape) { viewConfig.hideConfigWindow(); } } Component.onCompleted: forceActiveFocus(); RowLayout { id: header Layout.fillWidth: true spacing: 0 Item { Layout.alignment: Qt.AlignLeft | Qt.AlignTop Layout.fillWidth: false Layout.topMargin: units.smallSpacing Layout.preferredWidth: width Layout.preferredHeight: height width: Qt.application.layoutDirection !== Qt.RightToLeft ? logo.width + latteTxt.width + units.smallSpacing : logo.width + units.smallSpacing height: logo.height Latte.IconItem { id: logo width: Math.round(1.4 * latteTxtMetrics.font.pixelSize) height: width smooth: true source: "latte-dock" // animated: true usesPlasmaTheme: false active: aboutArea.hovered } PlasmaComponents.Label { id: latteTxtMetrics text: i18n("Latte") width: 0 font.pointSize: 2 * theme.defaultFont.pointSize visible: false } PlasmaCore.SvgItem{ id: latteTxt width: 2.2 * height height: 0.4 * latteTxtMetrics.font.pixelSize visible: Qt.application.layoutDirection !== Qt.RightToLeft anchors.left: logo.right anchors.verticalCenter: logo.verticalCenter svg: PlasmaCore.Svg{ imagePath: universalSettings.trademarkIconPath() } } PlasmaComponents.Button{ id: aboutArea //! Used as tooltip anchors.fill: parent opacity: 0 tooltip: i18n("Open Latte settings window") onPressedChanged: { if (pressed) { layoutsManager.showLatteSettingsDialog(Latte.Types.PreferencesPage) } } } Rectangle { anchors.top: parent.bottom anchors.horizontalCenter: parent.horizontalCenter anchors.topMargin: 2 width: parent.width + 4 height: 2 color: theme.highlightColor visible: aboutArea.hovered } } Item{ id: headerSpacer Layout.minimumHeight: complexitySettings.height + 2*units.smallSpacing } ColumnLayout { PlasmaComponents.ToolButton { id: pinButton Layout.fillWidth: false Layout.fillHeight: false Layout.preferredWidth: width Layout.preferredHeight: height Layout.alignment: Qt.AlignRight | Qt.AlignVCenter Layout.bottomMargin: units.smallSpacing //!avoid editMode box shadow Layout.topMargin: units.smallSpacing * 2 Layout.rightMargin: units.smallSpacing iconSource: "window-pin" checkable: true width: Math.round(units.gridUnit * 1.25) height: width property bool inStartup: true onClicked: { plasmoid.configuration.configurationSticker = checked viewConfig.setSticker(checked) } Component.onCompleted: { checked = plasmoid.configuration.configurationSticker viewConfig.setSticker(plasmoid.configuration.configurationSticker) } } RowLayout { id: complexitySettings Layout.fillWidth: true Layout.rightMargin: units.smallSpacing * 2 Layout.alignment: Qt.AlignRight | Qt.AlignTop PlasmaComponents.Label { Layout.fillWidth: true Layout.alignment: Qt.AlignRight } PlasmaComponents.Label { id: complexityLbl Layout.alignment: Qt.AlignRight // opacity: dialog.basicLevel ? basicOpacity : 1 //! TODO: the term here is not accurate because the expert settings mode //! is used currently. In the future this term will be rethought if //! it must remain or be changed text: i18nc("advanced settings", "Advanced") readonly property real textColorBrightness: colorBrightness(theme.textColor) readonly property real basicOpacity: textColorBrightness > 127 ? 0.7 : 0.3 color: { if (dialog.basicLevel) { return textColorBrightness > 127 ? Qt.darker(theme.textColor, 1.4) : Qt.lighter(theme.textColor, 2.8); } return theme.textColor; } function colorBrightness(color) { return colorBrightnessFromRGB(color.r * 255, color.g * 255, color.b * 255); } // formula for brightness according to: // https://www.w3.org/TR/AERT/#color-contrast function colorBrightnessFromRGB(r, g, b) { return (r * 299 + g * 587 + b * 114) / 1000 } MouseArea { id: complexityMouseArea anchors.fill: parent hoverEnabled: true onClicked: { complexitySwitch.checked = !complexitySwitch.checked; } } } LatteComponents.Switch { id: complexitySwitch checked: (viewConfig.complexity === Latte.Types.ExpertSettings) onCheckedChanged: { if (checked) { viewConfig.complexity = Latte.Types.ExpertSettings; } else { viewConfig.complexity = Latte.Types.BasicSettings; } } } } } } PlasmaComponents.TabBar { id: tabBar Layout.fillWidth: true Layout.maximumWidth: (dialog.appliedWidth - units.smallSpacing * 2) PlasmaComponents.TabButton { id: behaviorTabBtn text: i18n("Behavior") tab: behaviorPage } PlasmaComponents.TabButton { id: appearanceTabBtn text: i18n("Appearance") tab: appearancePage } PlasmaComponents.TabButton { id: effectsTabBtn text: i18n("Effects") tab: effectsPage visible: dialog.highLevel } PlasmaComponents.TabButton { id: tasksTabBtn text: i18n("Tasks") tab: tasksPage visible: latteView.latteTasksArePresent } } Rectangle { id: pagesBackground Layout.fillWidth: true Layout.fillHeight: false Layout.minimumWidth: dialog.appliedWidth - units.smallSpacing * 4 Layout.minimumHeight: height Layout.maximumHeight: height width: dialog.appliedWidth - units.smallSpacing * 3 height: availableFreeHeight + units.smallSpacing * 4 color: transparentBackgroundColor border.width: 1 border.color: theme.backgroundColor //fix the height binding loop when showing the configuration window property int availableFreeHeight: dialog.appliedHeight - header.height - headerSpacer.height - tabBar.height - actionButtons.height - 2 * units.smallSpacing PlasmaExtras.ScrollArea { id: scrollArea anchors.fill: parent verticalScrollBarPolicy: Qt.ScrollBarAsNeeded horizontalScrollBarPolicy: Qt.ScrollBarAlwaysOff flickableItem.flickableDirection: Flickable.VerticalFlick PlasmaComponents.TabGroup { id: tabGroup width: currentTab.Layout.maximumWidth height: currentTab.Layout.maximumHeight Pages.BehaviorConfig { id: behaviorPage } Pages.AppearanceConfig { id: appearancePage } Pages.EffectsConfig { id: effectsPage } Pages.TasksConfig { id: tasksPage } } } } RowLayout { id: actionButtons Layout.fillWidth: true Layout.alignment: Qt.AlignHCenter | Qt.AlignBottom spacing: units.largeSpacing Connections{ target: latteView.layout onViewsCountChanged: actionButtons.updateEnabled(); } function updateEnabled() { var screenFreeEdges = latteView.layout.qmlFreeEdges(latteView.positioner.currentScreenId); actionsComboBtn.buttonEnabled = screenFreeEdges.length > 0; if (actionsModel.count > 0) { actionsModel.get(0).enabled = actionsComboBtn.buttonEnabled; } removeView.enabled = latteView.layout.viewsCount>1 /*&& !(latteView.layout.viewsWithTasks()===1 && latteView.tasksPresent())*/ } LatteComponents.ComboBoxButton { id: actionsComboBtn Layout.fillWidth: true implicitWidth: removeView.implicitWidth implicitHeight: removeView.implicitHeight buttonEnabled: true buttonText: i18n("New Dock") buttonIconSource: "list-add" buttonToolTip: i18n("Add a new dock") comboBoxEnabled: true comboBoxBlankSpaceForEmptyIcons: true comboBoxPopUpAlignRight: Qt.application.layoutDirection === Qt.RightToLeft comboBoxEnabledRole: "enabled" comboBoxTextRole: "name" comboBoxIconRole: "icon" comboBoxMinimumPopUpWidth: actionsModel.count > 1 ? dialog.width / 2 : 150 property var centralLayoutsNames: [] property var sharedLayoutsNames: [] Component.onCompleted: { comboBox.model = actionsModel; actionButtons.updateEnabled(); } ListModel { id: actionsModel } Connections{ target: actionsComboBtn.comboBox Component.onCompleted:{ actionsComboBtn.addModel(); actionButtons.updateEnabled(); } onActivated: { if (index==0) { latteView.copyView(); } else if (index>=1) { var layouts = actionsComboBtn.sharedLayoutsNames.concat(actionsComboBtn.centralLayoutsNames); latteView.positioner.hideDockDuringMovingToLayout(layouts[index-1]); } actionsComboBtn.comboBox.currentIndex = -1; } onEnabledChanged: { if (enabled) { actionsComboBtn.addModel(); } else { actionsComboBtn.emptyModel(); } } } Connections{ target: actionsComboBtn.button onClicked: latteView.layout.addNewView(); } Connections{ target: latteView onTypeChanged: actionsComboBtn.updateCopyText() } function addModel() { actionsModel.clear(); var copy = {actionId: 'copy:', enabled: true, name: '', icon: 'edit-copy'}; actionsModel.append(copy); updateCopyText(); var tempCentralLayouts = layoutsManager.centralLayoutsNames(); var tempSharedLayouts = layoutsManager.sharedLayoutsNames(); if (tempSharedLayouts.length > 0) { var curIndex = tempSharedLayouts.indexOf(latteView.layout.name); if (curIndex >=0) { tempSharedLayouts.splice(curIndex,1); } sharedLayoutsNames = tempSharedLayouts; var icon = "document-share"; for(var i=0; i 0) { var curIndex = tempCentralLayouts.indexOf(latteView.layout.name); if (curIndex >=0) { tempCentralLayouts.splice(curIndex,1); } centralLayoutsNames = tempCentralLayouts; var iconArrow = Qt.application.layoutDirection === Qt.RightToLeft ? 'arrow-left' : 'arrow-right'; for(var i=0; i 1 ? 1 : 0 tooltip: i18n("Remove current dock") onClicked: latteView.removeView() } PlasmaComponents.Button { id: closeButton Layout.fillWidth: true text: i18n("Close") iconSource: "dialog-close" tooltip: i18n("Close settings window") onClicked: viewConfig.hideConfigWindow(); } } } //! HACK FOR X11 environments //! show an inner shadow similar to Latte::View editShadow in order to //! not break the visual user experience LatteExtraControls.InnerShadow{ width: plasmoid.formFactor === PlasmaCore.Types.Horizontal ? dialog.width + 2*shadowSize : shadowSize height: plasmoid.formFactor === PlasmaCore.Types.Horizontal ? shadowSize : dialog.height + 2*shadowSize shadowSize: latteView.effects.editShadow shadowOpacity: Math.max(0.35, maxOpacity) shadowDirection: plasmoid.location visible: !Latte.WindowSystem.isPlatformWayland && Latte.WindowSystem.compositingActive && latteView.effects.settingsMaskSubtracted readonly property real maxOpacity: Latte.WindowSystem.compositingActive && !plasmoid.configuration.inConfigureAppletsMode ? plasmoid.configuration.editBackgroundOpacity : 1 } } diff --git a/shell/package/contents/configuration/pages/BehaviorConfig.qml b/shell/package/contents/configuration/pages/BehaviorConfig.qml index 4457db71..7f52c848 100644 --- a/shell/package/contents/configuration/pages/BehaviorConfig.qml +++ b/shell/package/contents/configuration/pages/BehaviorConfig.qml @@ -1,793 +1,809 @@ /* * Copyright 2016 Smith AR * Michail Vourlakos * * This file is part of Latte-Dock * * Latte-Dock 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. * * Latte-Dock 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, see . */ import QtQuick 2.0 import QtQuick.Controls 1.4 import QtQuick.Layouts 1.3 import QtGraphicalEffects 1.0 import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.components 2.0 as PlasmaComponents import org.kde.plasma.components 3.0 as PlasmaComponents3 import org.kde.plasma.plasmoid 2.0 import org.kde.latte 0.2 as Latte import org.kde.latte.components 1.0 as LatteComponents import "../../controls" as LatteExtraControls PlasmaComponents.Page { Layout.maximumWidth: content.width + content.Layout.leftMargin * 2 Layout.maximumHeight: content.height + units.smallSpacing * 2 ColumnLayout { id: content width: (dialog.appliedWidth - units.smallSpacing * 2) - Layout.leftMargin * 2 spacing: dialog.subGroupSpacing anchors.horizontalCenter: parent.horizontalCenter Layout.leftMargin: units.smallSpacing * 2 //! BEGIN: Inline Dock/Panel Type, it is used only when the secondary window //! overlaps the main dock config window ColumnLayout { Layout.fillWidth: true spacing: units.smallSpacing Layout.topMargin: units.smallSpacing visible: dialog.highLevel && viewConfig.showInlineProperties LatteComponents.Header { text: i18n("Type") } LatteExtraControls.TypeSelection{ id: viewTypeSelection horizontal: true } } //! END: Inline Dock/Panel Type //! BEGIN: Location ColumnLayout { Layout.fillWidth: true spacing: units.smallSpacing Layout.topMargin: units.smallSpacing LatteComponents.Header { text: screenRow.visible ? i18n("Screen") : i18n("Location") } Connections { target: universalSettings onScreensCountChanged: screenRow.updateScreens() } RowLayout { id: screenRow Layout.fillWidth: true Layout.leftMargin: units.smallSpacing * 2 Layout.rightMargin: units.smallSpacing * 3 spacing: 2 visible: true function updateScreens() { if (universalSettings.screens.length > 1) { screenRow.visible = true; } else { screenRow.visible = false; } screensModel.clear(); var primary = {name: i18n("On Primary"), icon: 'favorites'}; screensModel.append(primary); //check if the screen exists, it is used in cases Latte is moving //the view automatically to primaryScreen in order for the user //to has always a view with tasks shown var screenExists = false for (var i = 0; i < universalSettings.screens.length; i++) { if (universalSettings.screens[i].name === latteView.positioner.currentScreenName) { screenExists = true; } } if (!screenExists && !latteView.onPrimary) { var scr = {name: latteView.positioner.currentScreenName, icon: 'view-fullscreen'}; screensModel.append(scr); } for (var i = 0; i < universalSettings.screens.length; i++) { var scr = {name: universalSettings.screens[i].name, icon: 'view-fullscreen'}; screensModel.append(scr); } if (latteView.onPrimary) { screenCmb.currentIndex = 0; } else { screenCmb.currentIndex = screenCmb.findScreen(latteView.positioner.currentScreenName); } console.log(latteView.positioner.currentScreenName); } Connections{ target: viewConfig onShowSignal: screenRow.updateScreens(); } ListModel { id: screensModel } LatteComponents.ComboBox { id: screenCmb Layout.fillWidth: true model: screensModel textRole: "name" iconRole: "icon" Component.onCompleted: screenRow.updateScreens(); onActivated: { var succeed = false; if (index === 0) { succeed = latteView.positioner.setCurrentScreen("primary"); if (succeed) { latteView.onPrimary = true; } else if (!latteView.onPrimary){ console.log("the edge is already occupied!!!"); currentIndex = findScreen(latteView.positioner.currentScreenName); } } else if (index>0 && (index !== findScreen(latteView.positioner.currentScreenName) || latteView.onPrimary)) { console.log("current index changed!!! :"+ index); console.log("screen must be changed..."); succeed = latteView.positioner.setCurrentScreen(textAt(index)); if(succeed) { latteView.onPrimary = false; } else { console.log("the edge is already occupied!!!"); currentIndex = findScreen(latteView.positioner.currentScreenName); } } } function findScreen(scrName) { for(var i=0; i=0); topEdgeBtn.edgeIsFree = (edges.indexOf(topEdgeBtn.edge)>=0); leftEdgeBtn.edgeIsFree = (edges.indexOf(leftEdgeBtn.edge)>=0); rightEdgeBtn.edgeIsFree = (edges.indexOf(rightEdgeBtn.edge)>=0); } PlasmaComponents.Button { id: bottomEdgeBtn Layout.minimumWidth: parent.buttonSize Layout.maximumWidth: Layout.minimumWidth text: i18nc("bottom location", "Bottom") iconSource: "arrow-down" checked: latteView.location === edge checkable: true enabled: checked || edgeIsFree exclusiveGroup: locationGroup property bool edgeIsFree: true readonly property int edge: PlasmaCore.Types.BottomEdge } PlasmaComponents.Button { id: leftEdgeBtn Layout.minimumWidth: parent.buttonSize Layout.maximumWidth: Layout.minimumWidth text: i18nc("left location", "Left") iconSource: "arrow-left" checked: latteView.location === edge checkable: true enabled: checked || edgeIsFree exclusiveGroup: locationGroup property bool edgeIsFree: true readonly property int edge: PlasmaCore.Types.LeftEdge } PlasmaComponents.Button { id: topEdgeBtn Layout.minimumWidth: parent.buttonSize Layout.maximumWidth: Layout.minimumWidth text: i18nc("top location", "Top") iconSource: "arrow-up" checked: latteView.location === edge checkable: true enabled: checked || edgeIsFree exclusiveGroup: locationGroup property bool edgeIsFree: true readonly property int edge: PlasmaCore.Types.TopEdge } PlasmaComponents.Button { id: rightEdgeBtn Layout.minimumWidth: parent.buttonSize Layout.maximumWidth: Layout.minimumWidth text: i18nc("right location", "Right") iconSource: "arrow-right" checked: latteView.location === edge checkable: true enabled: checked || edgeIsFree exclusiveGroup: locationGroup property bool edgeIsFree: true readonly property int edge: PlasmaCore.Types.RightEdge } } } //! END: Location //! BEGIN: Alignment ColumnLayout { Layout.fillWidth: true spacing: units.smallSpacing LatteComponents.Header { text: i18n("Alignment") } RowLayout { id: alignmentRow Layout.fillWidth: true Layout.leftMargin: units.smallSpacing * 2 Layout.rightMargin: units.smallSpacing * 2 LayoutMirroring.enabled: false spacing: 2 readonly property int panelPosition: plasmoid.configuration.panelPosition readonly property int buttonSize: (dialog.optionsWidth - (spacing * 3)) / 4 ExclusiveGroup { id: alignmentGroup onCurrentChanged: { if (current.checked) plasmoid.configuration.panelPosition = current.position } } PlasmaComponents.Button { Layout.minimumWidth: parent.buttonSize Layout.maximumWidth: Layout.minimumWidth text: panelIsVertical ? i18nc("top alignment", "Top") : i18nc("left alignment", "Left") iconSource: panelIsVertical ? "format-align-vertical-top" : "format-justify-left" checked: parent.panelPosition === position checkable: true exclusiveGroup: alignmentGroup property int position: panelIsVertical ? Latte.Types.Top : Latte.Types.Left } PlasmaComponents.Button { Layout.minimumWidth: parent.buttonSize Layout.maximumWidth: Layout.minimumWidth text: i18nc("center alignment", "Center") iconSource: panelIsVertical ? "format-align-vertical-center" : "format-justify-center" checked: parent.panelPosition === position checkable: true exclusiveGroup: alignmentGroup property int position: Latte.Types.Center } PlasmaComponents.Button { Layout.minimumWidth: parent.buttonSize Layout.maximumWidth: Layout.minimumWidth text: panelIsVertical ? i18nc("bottom alignment", "Bottom") : i18nc("right alignment", "Right") iconSource: panelIsVertical ? "format-align-vertical-bottom" : "format-justify-right" checked: parent.panelPosition === position checkable: true exclusiveGroup: alignmentGroup property int position: panelIsVertical ? Latte.Types.Bottom : Latte.Types.Right } PlasmaComponents.Button { Layout.minimumWidth: parent.buttonSize Layout.maximumWidth: Layout.minimumWidth text: i18nc("justify alignment", "Justify") iconSource: "format-justify-fill" checked: parent.panelPosition === position checkable: true exclusiveGroup: alignmentGroup property int position: Latte.Types.Justify } } } //! END: Alignment //! BEGIN: Visibility ColumnLayout { Layout.fillWidth: true spacing: units.smallSpacing LatteComponents.Header { text: i18n("Visibility") } GridLayout { width: parent.width rowSpacing: 1 columnSpacing: 2 Layout.leftMargin: units.smallSpacing * 2 Layout.rightMargin: units.smallSpacing * 2 columns: 2 property int mode: latteView.visibility.mode readonly property int buttonSize: (dialog.optionsWidth - (columnSpacing)) / 2 ExclusiveGroup { id: visibilityGroup onCurrentChanged: { if (current.checked) latteView.visibility.mode = current.mode } } PlasmaComponents.Button { Layout.minimumWidth: parent.buttonSize Layout.maximumWidth: Layout.minimumWidth text: i18n("Always Visible") checked: parent.mode === mode checkable: true exclusiveGroup: visibilityGroup property int mode: Latte.Types.AlwaysVisible } PlasmaComponents.Button { Layout.minimumWidth: parent.buttonSize Layout.maximumWidth: Layout.minimumWidth text: i18n("Auto Hide") checked: parent.mode === mode checkable: true exclusiveGroup: visibilityGroup property int mode: Latte.Types.AutoHide } PlasmaComponents.Button { Layout.minimumWidth: parent.buttonSize Layout.maximumWidth: Layout.minimumWidth text: i18n("Dodge Active") checked: parent.mode === mode checkable: true exclusiveGroup: visibilityGroup property int mode: Latte.Types.DodgeActive } PlasmaComponents.Button { Layout.minimumWidth: parent.buttonSize Layout.maximumWidth: Layout.minimumWidth text: i18n("Dodge Maximized") checked: parent.mode === mode checkable: true exclusiveGroup: visibilityGroup property int mode: Latte.Types.DodgeMaximized } PlasmaComponents.Button { id: dodgeAllWindowsBtn Layout.minimumWidth: parent.buttonSize Layout.maximumWidth: Layout.minimumWidth text: i18n("Dodge All Windows") checked: parent.mode === mode checkable: true exclusiveGroup: visibilityGroup property int mode: Latte.Types.DodgeAllWindows } PlasmaComponents.Button { id: windowsGoBelowBtn Layout.minimumWidth: parent.buttonSize Layout.maximumWidth: Layout.minimumWidth text: i18n("Windows Go Below") checked: parent.mode === mode checkable: true exclusiveGroup: visibilityGroup property int mode: Latte.Types.WindowsGoBelow } } } //! END: Visibility //! BEGIN: Delay ColumnLayout { Layout.fillWidth: true spacing: units.smallSpacing enabled: !(latteView.visibility.mode === Latte.Types.AlwaysVisible || latteView.visibility.mode === Latte.Types.WindowsGoBelow) LatteComponents.Header { text: i18n("Delay") } Flow { width: dialog.optionsWidth Layout.minimumWidth: dialog.optionsWidth Layout.maximumWidth: dialog.optionsWidth Layout.leftMargin: units.smallSpacing * 2 Layout.rightMargin: units.smallSpacing * 2 Layout.topMargin: units.smallSpacing spacing: 2 readonly property bool overlap: showContainer.overlap || hideContainer.overlap Item { id: showContainer width: parent.overlap ? dialog.optionsWidth : oneLineWidth height: childrenRect.height implicitWidth: width implicitHeight: height readonly property bool overlap: oneLineWidth > dodgeAllWindowsBtn.width readonly property int oneLineWidth: Math.max(dodgeAllWindowsBtn.width, showTimerRow.width) RowLayout{ id: showTimerRow anchors.horizontalCenter: parent.horizontalCenter PlasmaComponents.Label { Layout.leftMargin: Qt.application.layoutDirection === Qt.RightToLeft ? units.smallSpacing : 0 Layout.rightMargin: Qt.application.layoutDirection === Qt.RightToLeft ? 0 : units.smallSpacing text: i18n("Show ") } LatteComponents.TextField { Layout.preferredWidth: width text: latteView.visibility.timerShow onValueChanged: { latteView.visibility.timerShow = value } } } } Item { id: hideContainer width: parent.overlap ? dialog.optionsWidth : oneLineWidth height: childrenRect.height implicitWidth: width implicitHeight: height readonly property bool overlap: oneLineWidth > windowsGoBelowBtn.width readonly property int oneLineWidth: Math.max(windowsGoBelowBtn.width, hideTimerRow.width) RowLayout { id: hideTimerRow anchors.horizontalCenter: parent.horizontalCenter PlasmaComponents.Label { Layout.leftMargin: Qt.application.layoutDirection === Qt.RightToLeft ? units.smallSpacing : 0 Layout.rightMargin: Qt.application.layoutDirection === Qt.RightToLeft ? 0 : units.smallSpacing text: i18n("Hide") } LatteComponents.TextField{ Layout.preferredWidth: width text: latteView.visibility.timerHide onValueChanged: { latteView.visibility.timerHide = value } } } } } } //! END: Delay //! BEGIN: Actions ColumnLayout { spacing: units.smallSpacing visible: dialog.expertLevel LatteComponents.Header { text: i18n("Actions") } ColumnLayout { + id: actionsPropertiesColumn Layout.leftMargin: units.smallSpacing * 2 Layout.rightMargin: units.smallSpacing * 2 spacing: 0 + readonly property int maxLabelWidth: Math.max(trackActiveLbl.implicitWidth, + mouseWheelLbl.implicitWidth, + leftBtnLbl.implicitWidth) + LatteComponents.SubHeader { - text: i18n("Empty Area") + text: i18n("Active Window") } ColumnLayout { RowLayout { Layout.topMargin: units.smallSpacing PlasmaComponents.Label { - id: mouseWheelLbl - text: i18n("Mouse wheel") + id: trackActiveLbl + Layout.minimumWidth: actionsPropertiesColumn.maxLabelWidth + Layout.maximumWidth: actionsPropertiesColumn.maxLabelWidth + text: i18n("Track From") } LatteComponents.ComboBox { - id: scrollAction + id: activeWindowFilterCmb Layout.fillWidth: true - model: [i18nc("none scroll actions", "None Action"), - i18n("Cycle Through Desktops"), - i18n("Cycle Through Activities"), - i18n("Cycle Through Tasks")] + model: [i18nc("track from current screen", "Current Screen"), + i18nc("track from all screens", "All Screens")] - currentIndex: plasmoid.configuration.scrollAction + currentIndex: plasmoid.configuration.activeWindowFilter onCurrentIndexChanged: { switch(currentIndex) { - case Latte.Types.ScrollNone: - plasmoid.configuration.scrollAction = Latte.Types.ScrollNone; - break; - case Latte.Types.ScrollDesktops: - plasmoid.configuration.scrollAction = Latte.Types.ScrollDesktops; - break; - case Latte.Types.ScrollActivities: - plasmoid.configuration.scrollAction = Latte.Types.ScrollActivities; + case Latte.Types.ActiveInCurrentScreen: + plasmoid.configuration.activeWindowFilter = Latte.Types.ActiveInCurrentScreen; break; - case Latte.Types.ScrollTasks: - plasmoid.configuration.scrollAction = Latte.Types.ScrollTasks; + case Latte.Types.ActiveFromAllScreens: + plasmoid.configuration.activeWindowFilter = Latte.Types.ActiveFromAllScreens; break; } } } } } LatteComponents.SubHeader { - text: i18n("Active Window") + text: i18n("Empty Area") } ColumnLayout { + RowLayout { + PlasmaComponents.Label { + id: leftBtnLbl + Layout.minimumWidth: actionsPropertiesColumn.maxLabelWidth + Layout.maximumWidth: actionsPropertiesColumn.maxLabelWidth + text: i18n("Left Button") + } + + PlasmaComponents.Button { + Layout.fillWidth: true + text: i18n("Drag Active Window") + checked: plasmoid.configuration.dragActiveWindowEnabled + checkable: true + tooltip: i18n("The user can use left mouse button to drag and maximized/restore last active window") + iconName: "transform-move" + + onClicked: { + plasmoid.configuration.dragActiveWindowEnabled = !plasmoid.configuration.dragActiveWindowEnabled; + } + } + } + RowLayout { Layout.topMargin: units.smallSpacing PlasmaComponents.Label { - Layout.minimumWidth: mouseWheelLbl.width - Layout.maximumWidth: mouseWheelLbl.width - text: i18n("Track From") + id: mouseWheelLbl + Layout.minimumWidth: actionsPropertiesColumn.maxLabelWidth + Layout.maximumWidth: actionsPropertiesColumn.maxLabelWidth + text: i18n("Mouse wheel") } LatteComponents.ComboBox { - id: activeWindowFilterCmb + id: scrollAction Layout.fillWidth: true - model: [i18nc("track from current screen", "Current Screen"), - i18nc("track from all screens", "All Screens")] + model: [i18nc("none scroll actions", "None Action"), + i18n("Cycle Through Desktops"), + i18n("Cycle Through Activities"), + i18n("Cycle Through Tasks")] - currentIndex: plasmoid.configuration.activeWindowFilter + currentIndex: plasmoid.configuration.scrollAction onCurrentIndexChanged: { switch(currentIndex) { - case Latte.Types.ActiveInCurrentScreen: - plasmoid.configuration.activeWindowFilter = Latte.Types.ActiveInCurrentScreen; + case Latte.Types.ScrollNone: + plasmoid.configuration.scrollAction = Latte.Types.ScrollNone; break; - case Latte.Types.ActiveFromAllScreens: - plasmoid.configuration.activeWindowFilter = Latte.Types.ActiveFromAllScreens; + case Latte.Types.ScrollDesktops: + plasmoid.configuration.scrollAction = Latte.Types.ScrollDesktops; + break; + case Latte.Types.ScrollActivities: + plasmoid.configuration.scrollAction = Latte.Types.ScrollActivities; + break; + case Latte.Types.ScrollTasks: + plasmoid.configuration.scrollAction = Latte.Types.ScrollTasks; break; } } } } - - LatteComponents.CheckBox { - Layout.maximumWidth: dialog.optionsWidth - Layout.topMargin: units.smallSpacing - text: i18n("Drag and maximize/restore active window") - checked: plasmoid.configuration.dragActiveWindowEnabled - tooltip: i18n("Drag/Maximize/Restore active window with double-click and dragging actions") - visible: dialog.highLevel - - onClicked: { - plasmoid.configuration.dragActiveWindowEnabled = !plasmoid.configuration.dragActiveWindowEnabled; - } - } } - LatteComponents.SubHeader { text: i18n("Items") } LatteComponents.CheckBoxesColumn { LatteComponents.CheckBox { id: titleTooltipsChk Layout.maximumWidth: dialog.optionsWidth text: i18n("Show title tooltips on hovering") tooltip: i18n("Show thinner tooltips produced by Latte for items.\nThese tooltips are not drawn when applets zoom effect is disabled"); checked: plasmoid.configuration.titleTooltips //enabled: plasmoid.configuration.zoomLevel > 0 onClicked: { plasmoid.configuration.titleTooltips = !plasmoid.configuration.titleTooltips; } } LatteComponents.CheckBox { id: mouseWheelChk Layout.maximumWidth: dialog.optionsWidth text: i18n("Activate through mouse wheel") checked: plasmoid.configuration.mouseWheelActions tooltip: i18n("Enable/Disable the mouse wheel action") visible: dialog.highLevel onClicked: { plasmoid.configuration.mouseWheelActions = checked } } LatteComponents.CheckBox { id: fittsLawChk Layout.maximumWidth: dialog.optionsWidth - text: i18n("Always use empty screen gap when in floating mode") + text: i18n("Always use screen gap from floating mode") checked: plasmoid.configuration.fittsLawIsRequested tooltip: i18n("When the dock or panel is in floating mode, the gap to the screen is also used by items") visible: dialog.highLevel enabled: !plasmoid.configuration.shrinkThickMargins && (plasmoid.configuration.screenEdgeMargin >= 0) onClicked: { plasmoid.configuration.fittsLawIsRequested = checked } } LatteComponents.CheckBox { Layout.maximumWidth: dialog.optionsWidth // Layout.maximumHeight: mouseWheelChk.height - text: i18n("🅰 Activate based on position through global shortcuts") + text: i18n("➊ Activate based on position through global shortcuts") checked: latteView.isPreferredForShortcuts || (!latteView.layout.preferredForShortcutsTouched && latteView.isHighestPriorityView()) tooltip: i18n("This view is used for based on position global shortcuts. Take note that only one view can have that option enabled for each layout") onClicked: { latteView.isPreferredForShortcuts = checked if (!latteView.layout.preferredForShortcutsTouched) { latteView.layout.preferredForShortcutsTouched = true } } } } } } //! END: Actions //! BEGIN: Adjust ColumnLayout { spacing: units.smallSpacing visible: dialog.expertLevel enabled: latteView.visibility.mode !== Latte.Types.AlwaysVisible && latteView.visibility.mode !== Latte.Types.WindowsGoBelow LatteComponents.Header { text: i18n("Environment") } LatteComponents.CheckBoxesColumn { Layout.leftMargin: units.smallSpacing * 2 Layout.rightMargin: units.smallSpacing * 2 LatteComponents.CheckBox { Layout.maximumWidth: dialog.optionsWidth text: i18n("Activate KWin edge after hiding") checked: latteView.visibility.enableKWinEdges tooltip: i18n("After the view becomes hidden, KWin is informed to track user feedback. For example an edge visual hint is shown whenever the mouse approaches the hidden view") enabled: !latteView.byPassWM onClicked: { latteView.visibility.enableKWinEdges = checked; } } LatteComponents.CheckBox { Layout.maximumWidth: dialog.optionsWidth text: i18n("Can be above fullscreen windows") checked: latteView.byPassWM tooltip: i18n("BypassWindowManagerHint flag for the window. The view will be above all windows even those set as 'Always On Top'") onCheckedChanged: { latteView.byPassWM = checked; } } LatteComponents.CheckBox { Layout.maximumWidth: dialog.optionsWidth text: i18n("Raise on desktop change") checked: latteView.visibility.raiseOnDesktop onClicked: { latteView.visibility.raiseOnDesktop = checked } } LatteComponents.CheckBox { Layout.maximumWidth: dialog.optionsWidth text: i18n("Raise on activity change") checked: latteView.visibility.raiseOnActivity onClicked: { latteView.visibility.raiseOnActivity = checked } } } } //! END: Adjust } } diff --git a/shell/package/contents/configuration/pages/TasksConfig.qml b/shell/package/contents/configuration/pages/TasksConfig.qml index 21c97b42..af1668eb 100644 --- a/shell/package/contents/configuration/pages/TasksConfig.qml +++ b/shell/package/contents/configuration/pages/TasksConfig.qml @@ -1,631 +1,631 @@ /* * Copyright 2016 Smith AR * Michail Vourlakos * * This file is part of Latte-Dock * * Latte-Dock 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. * * Latte-Dock 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, see . */ import QtQuick 2.7 import QtQuick.Controls 1.4 import QtQuick.Layouts 1.3 import QtGraphicalEffects 1.0 import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.components 2.0 as PlasmaComponents import org.kde.plasma.components 3.0 as PlasmaComponents3 import org.kde.plasma.plasmoid 2.0 import org.kde.latte 0.2 as Latte import org.kde.latte.components 1.0 as LatteComponents PlasmaComponents.Page { Layout.maximumWidth: content.width + content.Layout.leftMargin * 2 Layout.maximumHeight: content.height + units.smallSpacing * 2 property bool disableAllWindowsFunctionality: plasmoid.configuration.showWindowsOnlyFromLaunchers && plasmoid.configuration.activeIndicator === Latte.Types.NoneIndicator ColumnLayout { id: content width: (dialog.appliedWidth - units.smallSpacing * 2) - Layout.leftMargin * 2 spacing: dialog.subGroupSpacing anchors.horizontalCenter: parent.horizontalCenter Layout.leftMargin: units.smallSpacing * 2 Layout.rightMargin: units.smallSpacing * 2 //! BEGIN: Badges ColumnLayout { spacing: units.smallSpacing Layout.topMargin: units.smallSpacing visible: dialog.highLevel LatteComponents.Header { text: i18n("Badges") } LatteComponents.CheckBoxesColumn { Layout.leftMargin: units.smallSpacing * 2 Layout.rightMargin: units.smallSpacing * 2 LatteComponents.CheckBox { Layout.maximumWidth: dialog.optionsWidth text: i18n("Notifications from tasks") checked: plasmoid.configuration.showInfoBadge tooltip: i18n("Show unread messages or notifications from tasks") onClicked: { plasmoid.configuration.showInfoBadge = checked } } LatteComponents.CheckBox { Layout.maximumWidth: dialog.optionsWidth text: i18n("Progress information for tasks") checked: plasmoid.configuration.showProgressBadge tooltip: i18n("Show a progress animation for tasks e.g. when copying files with Dolphin") onClicked: { plasmoid.configuration.showProgressBadge = checked } } LatteComponents.CheckBox { Layout.maximumWidth: dialog.optionsWidth text: i18n("Audio playing from tasks") checked: plasmoid.configuration.showAudioBadge tooltip: i18n("Show audio playing from tasks") onClicked: { plasmoid.configuration.showAudioBadge = checked } } LatteComponents.CheckBox { Layout.maximumWidth: dialog.optionsWidth text: i18n("Prominent color for notification badge") checked: plasmoid.configuration.infoBadgeProminentColorEnabled enabled: plasmoid.configuration.showInfoBadge tooltip: i18n("Notification badge uses a more prominent background which is usually red") onClicked: { plasmoid.configuration.infoBadgeProminentColorEnabled = !plasmoid.configuration.infoBadgeProminentColorEnabled; } } LatteComponents.CheckBox { Layout.maximumWidth: dialog.optionsWidth text: i18n("Change volume when scrolling audio badge") checked: plasmoid.configuration.audioBadgeActionsEnabled enabled: plasmoid.configuration.showAudioBadge tooltip: i18n("The user is able to mute/unmute with click or change the volume with mouse wheel") onClicked: { plasmoid.configuration.audioBadgeActionsEnabled = checked } } } } //! END: Badges //! BEGIN: Tasks Interaction ColumnLayout { Layout.topMargin: dialog.basicLevel ? units.smallSpacing : 0 spacing: units.smallSpacing LatteComponents.Header { text: i18n("Interaction") } LatteComponents.CheckBoxesColumn { Layout.leftMargin: units.smallSpacing * 2 Layout.rightMargin: units.smallSpacing * 2 LatteComponents.CheckBox { Layout.maximumWidth: dialog.optionsWidth text: i18n("Add launchers only in the Tasks Area") checked: plasmoid.configuration.addLaunchersInTaskManager tooltip: i18n("Launchers are added only in the taskmanager and not as plasma applets") onClicked: { plasmoid.configuration.addLaunchersInTaskManager = checked; } } LatteComponents.CheckBox { id: windowActionsChk Layout.maximumWidth: dialog.optionsWidth text: i18n("Window actions in the context menu") checked: plasmoid.configuration.showWindowActions visible: dialog.highLevel enabled: !disableAllWindowsFunctionality onClicked: { plasmoid.configuration.showWindowActions = checked } } LatteComponents.CheckBox { id: unifyGlobalShortcutsChk Layout.maximumWidth: dialog.optionsWidth - text: i18n("🅰 Based on position shortcuts apply only for tasks") + text: i18n("➊ Based on position shortcuts apply only for tasks") checked: !plasmoid.configuration.unifiedGlobalShortcuts tooltip: i18n("Based on position global shortcuts are enabled only for tasks and not for applets") visible: dialog.highLevel enabled: latteView.isPreferredForShortcuts || (!latteView.layout.preferredForShortcutsTouched && latteView.isHighestPriorityView()) onClicked: { plasmoid.configuration.unifiedGlobalShortcuts = !checked } } } } //! END: Tasks Interaction //! BEGIN: Tasks Filters ColumnLayout { spacing: units.smallSpacing LatteComponents.Header { text: i18n("Filters") } LatteComponents.CheckBoxesColumn { Layout.leftMargin: units.smallSpacing * 2 Layout.rightMargin: units.smallSpacing * 2 LatteComponents.CheckBox { Layout.maximumWidth: dialog.optionsWidth text: i18n("Show only tasks from the current screen") checked: plasmoid.configuration.showOnlyCurrentScreen onClicked: { plasmoid.configuration.showOnlyCurrentScreen = checked } } LatteComponents.CheckBox { Layout.maximumWidth: dialog.optionsWidth text: i18n("Show only tasks from the current desktop") checked: plasmoid.configuration.showOnlyCurrentDesktop onClicked: { plasmoid.configuration.showOnlyCurrentDesktop = checked } } LatteComponents.CheckBox { Layout.maximumWidth: dialog.optionsWidth text: i18n("Show only tasks from the current activity") checked: plasmoid.configuration.showOnlyCurrentActivity onClicked: { plasmoid.configuration.showOnlyCurrentActivity = checked } } LatteComponents.CheckBox { Layout.maximumWidth: dialog.optionsWidth text: i18n("Show only tasks from launchers") checked: plasmoid.configuration.showWindowsOnlyFromLaunchers visible: dialog.highLevel onClicked: { plasmoid.configuration.showWindowsOnlyFromLaunchers = checked } } LatteComponents.CheckBox { Layout.maximumWidth: dialog.optionsWidth text: i18n("Group tasks of the same application") checked: plasmoid.configuration.groupTasksByDefault tooltip: i18n("By default group tasks of the same application") visible: dialog.highLevel onClicked: { plasmoid.configuration.groupTasksByDefault = checked } } } } //! END: Tasks Filters //! BEGIN: Launchers Group ColumnLayout { spacing: units.smallSpacing LatteComponents.Header { text: i18n("Launchers") } ColumnLayout { Layout.leftMargin: units.smallSpacing * 2 Layout.rightMargin: units.smallSpacing * 2 spacing: 0 LatteComponents.SubHeader { isFirstSubCategory: true text: i18nc("launchers group", "Group"); } RowLayout { Layout.fillWidth: true spacing: 2 property int group: plasmoid.configuration.launchersGroup readonly property int buttonsCount: layoutGroupButton.visible ? 3 : 2 readonly property int buttonSize: (dialog.optionsWidth - (spacing * buttonsCount-1)) / buttonsCount ExclusiveGroup { id: launchersGroup onCurrentChanged: { if (current.checked) { viewConfig.updateLaunchersForGroup(current.group); plasmoid.configuration.launchersGroup = current.group; } } } PlasmaComponents.Button { Layout.minimumWidth: parent.buttonSize Layout.maximumWidth: Layout.minimumWidth text: i18nc("unique launchers group","Unique") checked: parent.group === group checkable: true exclusiveGroup: launchersGroup tooltip: i18n("Use a unique set of launchers for this view which is independent from any other view") readonly property int group: Latte.Types.UniqueLaunchers } PlasmaComponents.Button { id: layoutGroupButton Layout.minimumWidth: parent.buttonSize Layout.maximumWidth: Layout.minimumWidth text: i18nc("layout launchers group","Layout") checked: parent.group === group checkable: true exclusiveGroup: launchersGroup tooltip: i18n("Use the current layout set of launchers for this latteView. This group provides launchers synchronization between different views in the same layout") //! it is shown only when the user has activated that option manually from the text layout file visible: plasmoid.configuration.launchersGroup === group readonly property int group: Latte.Types.LayoutLaunchers } PlasmaComponents.Button { Layout.minimumWidth: parent.buttonSize Layout.maximumWidth: Layout.minimumWidth text: i18nc("global launchers group","Global") checked: parent.group === group checkable: true exclusiveGroup: launchersGroup tooltip: i18n("Use the global set of launchers for this latteView. This group provides launchers synchronization between different views and between different layouts") readonly property int group: Latte.Types.GlobalLaunchers } } } } //! END: Launchers Group //! BEGIN: Scrolling ColumnLayout { spacing: units.smallSpacing visible: dialog.expertLevel LatteComponents.HeaderSwitch { id: scrollingHeader Layout.minimumWidth: dialog.optionsWidth + 2 *units.smallSpacing Layout.maximumWidth: Layout.minimumWidth Layout.minimumHeight: implicitHeight Layout.bottomMargin: units.smallSpacing enabled: Latte.WindowSystem.compositingActive checked: plasmoid.configuration.scrollTasksEnabled text: i18n("Scrolling") tooltip: i18n("Enable tasks scrolling when they overflow and exceed the available space"); onPressed: { plasmoid.configuration.scrollTasksEnabled = !plasmoid.configuration.scrollTasksEnabled;; } } ColumnLayout { Layout.leftMargin: units.smallSpacing * 2 Layout.rightMargin: units.smallSpacing * 2 spacing: 0 enabled: scrollingHeader.checked GridLayout { columns: 2 Layout.minimumWidth: dialog.optionsWidth Layout.maximumWidth: Layout.minimumWidth Layout.topMargin: units.smallSpacing PlasmaComponents.Label { Layout.fillWidth: true text: i18n("Manual") } LatteComponents.ComboBox { id: manualScrolling Layout.minimumWidth: leftClickAction.width Layout.maximumWidth: leftClickAction.width model: [i18nc("disabled manual scrolling", "Disabled scrolling"), dialog.panelIsVertical ? i18n("Only vertical scrolling") : i18n("Only horizontal scrolling"), i18n("Horizontal and vertical scrolling")] currentIndex: plasmoid.configuration.manualScrollTasksType onCurrentIndexChanged: plasmoid.configuration.manualScrollTasksType = currentIndex; } PlasmaComponents.Label { id: autoScrollText Layout.fillWidth: true text: i18n("Automatic") } LatteComponents.ComboBox { id: autoScrolling Layout.minimumWidth: leftClickAction.width Layout.maximumWidth: leftClickAction.width model: [ i18n("Disabled"), i18n("Enabled") ] currentIndex: plasmoid.configuration.autoScrollTasksEnabled onCurrentIndexChanged: { if (currentIndex === 0) { plasmoid.configuration.autoScrollTasksEnabled = false; } else { plasmoid.configuration.autoScrollTasksEnabled = true; } } } } } } //! END: Scolling //! BEGIN: Actions ColumnLayout { spacing: units.smallSpacing visible: dialog.expertLevel LatteComponents.Header { text: i18n("Actions") } ColumnLayout { Layout.leftMargin: units.smallSpacing * 2 Layout.rightMargin: units.smallSpacing * 2 spacing: 0 GridLayout { columns: 2 Layout.minimumWidth: dialog.optionsWidth Layout.maximumWidth: Layout.minimumWidth Layout.topMargin: units.smallSpacing enabled: !disableAllWindowsFunctionality PlasmaComponents.Label { id: leftClickLbl text: i18n("Left Click") } LatteComponents.ComboBox { id: leftClickAction Layout.fillWidth: true model: [i18nc("present windows action", "Present Windows"), i18n("Cycle Through Tasks"), i18n("Preview Windows")] currentIndex: { switch(plasmoid.configuration.leftClickAction) { case Latte.Types.PresentWindows: return 0; case Latte.Types.CycleThroughTasks: return 1; case Latte.Types.PreviewWindows: return 2; } return 0; } onCurrentIndexChanged: { switch(currentIndex) { case 0: plasmoid.configuration.leftClickAction = Latte.Types.PresentWindows; break; case 1: plasmoid.configuration.leftClickAction = Latte.Types.CycleThroughTasks; break; case 2: plasmoid.configuration.leftClickAction = Latte.Types.PreviewWindows; break; } } } PlasmaComponents.Label { id: middleClickText text: i18n("Middle Click") } LatteComponents.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"), i18n("Cycle Through Tasks"), i18n("Toggle Task Grouping") ] currentIndex: plasmoid.configuration.middleClickAction onCurrentIndexChanged: plasmoid.configuration.middleClickAction = currentIndex } PlasmaComponents.Label { text: i18n("Hover") } LatteComponents.ComboBox { id: hoverAction Layout.fillWidth: true model: [ i18nc("none action", "None"), i18n("Preview Windows"), i18n("Highlight Windows"), i18n("Preview and Highlight Windows"), ] currentIndex: { switch(plasmoid.configuration.hoverAction) { case Latte.Types.NoneAction: return 0; case Latte.Types.PreviewWindows: return 1; case Latte.Types.HighlightWindows: return 2; case Latte.Types.PreviewAndHighlightWindows: return 3; } return 0; } onCurrentIndexChanged: { switch(currentIndex) { case 0: plasmoid.configuration.hoverAction = Latte.Types.NoneAction; break; case 1: plasmoid.configuration.hoverAction = Latte.Types.PreviewWindows; break; case 2: plasmoid.configuration.hoverAction = Latte.Types.HighlightWindows; break; case 3: plasmoid.configuration.hoverAction = Latte.Types.PreviewAndHighlightWindows; break; } } } RowLayout { spacing: units.smallSpacing enabled: !disableAllWindowsFunctionality Layout.minimumWidth: middleClickText.width Layout.maximumWidth: middleClickText.width LatteComponents.ComboBox { id: modifier Layout.fillWidth: true model: ["Shift", "Ctrl", "Alt", "Meta"] currentIndex: plasmoid.configuration.modifier onCurrentIndexChanged: plasmoid.configuration.modifier = currentIndex } PlasmaComponents.Label { text: "+" } } RowLayout { spacing: units.smallSpacing enabled: !disableAllWindowsFunctionality readonly property int maxSize: 0.4 * dialog.optionsWidth LatteComponents.ComboBox { id: modifierClick Layout.preferredWidth: 0.7 * parent.maxSize Layout.maximumWidth: parent.maxSize model: [i18n("Left Click"), i18n("Middle Click"), i18n("Right Click")] currentIndex: plasmoid.configuration.modifierClick onCurrentIndexChanged: plasmoid.configuration.modifierClick = currentIndex } PlasmaComponents.Label { text: "=" } LatteComponents.ComboBox { id: modifierClickAction Layout.fillWidth: true model: [i18nc("The click action", "None"), i18n("Close Window or Group"), i18n("New Instance"), i18n("Minimize/Restore Window or Group"), i18n("Cycle Through Tasks"), i18n("Toggle Task Grouping")] currentIndex: plasmoid.configuration.modifierClickAction onCurrentIndexChanged: plasmoid.configuration.modifierClickAction = currentIndex } } } RowLayout { Layout.minimumWidth: dialog.optionsWidth Layout.maximumWidth: Layout.minimumWidth Layout.topMargin: units.smallSpacing spacing: units.smallSpacing enabled: !disableAllWindowsFunctionality } } } //! END: Actions //! BEGIN: Recycling ColumnLayout { spacing: units.smallSpacing visible: dialog.expertLevel LatteComponents.Header { text: i18n("Recycling") } PlasmaComponents.Button { Layout.minimumWidth: dialog.optionsWidth Layout.maximumWidth: Layout.minimumWidth Layout.leftMargin: units.smallSpacing * 2 Layout.rightMargin: units.smallSpacing * 2 Layout.topMargin: units.smallSpacing text: i18n("Remove Latte Tasks Applet") enabled: latteView.latteTasksArePresent tooltip: i18n("Remove Latte Tasks plasmoid") onClicked: { latteView.removeTasksPlasmoid(); } } } } }