diff --git a/containment/package/contents/ui/ConfigOverlay.qml b/containment/package/contents/ui/ConfigOverlay.qml index f7c7ade0..11e5c21e 100644 --- a/containment/package/contents/ui/ConfigOverlay.qml +++ b/containment/package/contents/ui/ConfigOverlay.qml @@ -1,511 +1,511 @@ /* * 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.Layouts 1.0 import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.components 2.0 as PlasmaComponents import org.kde.kquickcontrolsaddons 2.0 MouseArea { id: configurationArea z: 1000 anchors.fill: parent hoverEnabled: true cursorShape: { if (currentApplet && tooltip.visible && currentApplet.applet && (currentApplet.applet.pluginName === "org.kde.latte.spacer")) { return root.isHorizontal ? Qt.SizeHorCursor : Qt.SizeVerCursor; } return Qt.ArrowCursor; } property bool isResizingLeft: false property bool isResizingRight: false property Item currentApplet property Item previousCurrentApplet property int lastX property int lastY property int appletX property int appletY readonly property int spacerHandleSize: units.smallSpacing onHeightChanged: tooltip.visible = false; onWidthChanged: tooltip.visible = false; onPositionChanged: { if (pressed) { var padding = units.gridUnit * 3; if (currentApplet && (mouse.x < -padding || mouse.y < -padding || mouse.x > width + padding || mouse.y > height + padding)) { var newCont = plasmoid.containmentAt(mouse.x, mouse.y); if (newCont && newCont != plasmoid) { var newPos = newCont.mapFromApplet(plasmoid, mouse.x, mouse.y); newCont.addApplet(currentApplet.applet, newPos.x, newPos.y); root.dragOverlay.currentApplet = null; return; } } if(currentApplet){ if (plasmoid.formFactor === PlasmaCore.Types.Vertical) { currentApplet.y += (mouse.y - lastY); // handle.y = currentApplet.y; } else { currentApplet.x += (mouse.x - lastX); // handle.x = currentApplet.x; } } lastX = mouse.x; lastY = mouse.y; var relevantLayout = mapFromItem(layoutsContainer.mainLayout, 0, 0); var item = layoutsContainer.mainLayout.childAt(mouse.x-relevantLayout.x, mouse.y-relevantLayout.y); if (item && item !== placeHolder) { // placeHolder.width = item.width; // placeHolder.height = item.height; placeHolder.parent = configurationArea; var posInItem = mapToItem(item, mouse.x, mouse.y); if ((plasmoid.formFactor === PlasmaCore.Types.Vertical && posInItem.y < item.height/2) || (plasmoid.formFactor !== PlasmaCore.Types.Vertical && posInItem.x < item.width/2)) { root.layoutManager.insertBefore(item, placeHolder); } else { root.layoutManager.insertAfter(item, placeHolder); } } } else { var relevantLayout = mapFromItem(layoutsContainer.mainLayout,0,0); var item = layoutsContainer.mainLayout.childAt(mouse.x-relevantLayout.x, mouse.y-relevantLayout.y); if (root.dragOverlay && item && item !== lastSpacer) { root.dragOverlay.currentApplet = item; } else { currentApplet = null; root.dragOverlay.currentApplet = null; } } if (root.dragOverlay.currentApplet) { hideTimer.stop(); tooltip.visible = true; tooltip.raise(); } } onExited: hideTimer.restart(); onCurrentAppletChanged: { if(previousCurrentApplet && previousCurrentApplet.showZoomed) previousCurrentApplet.showZoomed = false; previousCurrentApplet = currentApplet; if (!currentApplet || !root.dragOverlay.currentApplet || (currentApplet && currentApplet.isInternalViewSplitter)) { hideTimer.restart(); return; } else if (currentApplet === ruler) { return; } if(currentApplet.showZoomed !== undefined) currentApplet.showZoomed = true; var relevantLayout = mapFromItem(layoutsContainer.mainLayout, 0, 0); handle.x = relevantLayout.x + currentApplet.x; handle.y = relevantLayout.y + currentApplet.y; handle.width = currentApplet.width; handle.height = currentApplet.height; lockButton.checked = currentApplet.lockZoom; repositionHandler.restart(); } onPressed: { if (!root.dragOverlay.currentApplet) { return; } /* if (currentApplet.applet.pluginName == "org.kde.plasma.panelspacer") { if (plasmoid.formFactor === PlasmaCore.Types.Vertical) { if ((mouse.y - handle.y) < spacerHandleSize) { configurationArea.isResizingLeft = true; configurationArea.isResizingRight = false; } else if ((mouse.y - handle.y) > (handle.height - spacerHandleSize)) { configurationArea.isResizingLeft = false; configurationArea.isResizingRight = true; } else { configurationArea.isResizingLeft = false; configurationArea.isResizingRight = false; } } else { if ((mouse.x - handle.x) < spacerHandleSize) { configurationArea.isResizingLeft = true; configurationArea.isResizingRight = false; } else if ((mouse.x - handle.x) > (handle.width - spacerHandleSize)) { configurationArea.isResizingLeft = false; configurationArea.isResizingRight = true; } else { configurationArea.isResizingLeft = false; configurationArea.isResizingRight = false; } } }*/ var relevantApplet = mapFromItem(currentApplet, 0, 0); appletX = mouse.x - relevantApplet.x; appletY = mouse.y - relevantApplet.y; lastX = mouse.x; lastY = mouse.y; placeHolder.width = currentApplet.width; placeHolder.height = currentApplet.height; handle.width = currentApplet.width; handle.height = currentApplet.height; root.layoutManager.insertBefore(currentApplet, placeHolder); currentApplet.parent = root; currentApplet.x = lastX-appletX; currentApplet.y = lastY-appletY; currentApplet.z = 900; } onReleased: { if (!root.dragOverlay.currentApplet) { return; } if(currentApplet && currentApplet.applet){ if (plasmoid.formFactor === PlasmaCore.Types.Vertical) { currentApplet.applet.configuration.length = handle.height; } else { currentApplet.applet.configuration.length = handle.width; } } configurationArea.isResizingLeft = false; configurationArea.isResizingRight = false; root.layoutManager.insertBefore(placeHolder, currentApplet); placeHolder.parent = configurationArea; currentApplet.z = 1; var relevantLayout = mapFromItem(layoutsContainer.mainLayout, 0, 0); handle.x = relevantLayout.x + currentApplet.x; handle.y = relevantLayout.y + currentApplet.y; // handle.width = currentApplet.width; // handle.height = currentApplet.height; root.layoutManager.save(); } onWheel: { if (currentApplet && (currentApplet.applet.pluginName !== "org.kde.latte.spacer")) { return } var angle = wheel.angleDelta.y / 8; if (angle > 12) currentApplet.latteSpacer.increaseLength(); else if (angle < 12) currentApplet.latteSpacer.decreaseLength(); } Item { id: placeHolder visible: configurationArea.containsMouse Layout.fillWidth: currentApplet ? currentApplet.Layout.fillWidth : false Layout.fillHeight: currentApplet ? currentApplet.Layout.fillHeight : false } //Because of the animations for the applets the handler can not catch up to //reposition itself when the currentApplet position or size changes. //This timer fixes that situation Timer { id: repositionHandler interval: 100 onTriggered: handle.updatePlacement(); } Timer { id: hideTimer interval: units.longDuration * 2 onTriggered: { if (!ruler.containsMouse && !tooltipMouseArea.containsMouse) { tooltip.visible = false; currentApplet = null; } } } Connections { target: currentApplet onXChanged: handle.updatePlacement(); onYChanged: handle.updatePlacement(); onWidthChanged: handle.updatePlacement(); onHeightChanged: handle.updatePlacement() } Item { id: handle visible: currentApplet && currentApplet !== ruler && (configurationArea.containsMouse || tooltipMouseArea.containsMouse) //BEGIN functions function updatePlacement(){ if(currentApplet && currentApplet !== ruler){ var transformChoords = root.mapFromItem(currentApplet, 0, 0) handle.x = transformChoords.x; handle.y = transformChoords.y; handle.width = currentApplet.width; handle.height = currentApplet.height; repositionHandler.restart(); } } //END functions Rectangle{ anchors.fill: parent color: theme.backgroundColor radius: 3 opacity: 0.5 } PlasmaCore.IconItem { source: "transform-move" width: Math.min(parent.width, parent.height) height: width anchors.centerIn: parent opacity: 0.5 } /* Rectangle { anchors { left: parent.left top: parent.top bottom: (plasmoid.formFactor !== PlasmaCore.Types.Vertical) ? parent.bottom : undefined right: (plasmoid.formFactor !== PlasmaCore.Types.Vertical) ? undefined : parent.right } visible: currentApplet && currentApplet.applet.pluginName == "org.kde.plasma.panelspacer" opacity: visible && !xAnim.running && !yAnim.running ? 1.0 : 0 width: configurationArea.spacerHandleSize height: configurationArea.spacerHandleSize color: theme.textColor Behavior on opacity { NumberAnimation { duration: units.longDuration easing.type: Easing.InOutQuad } } } Rectangle { anchors { right: parent.right top: (plasmoid.formFactor !== PlasmaCore.Types.Vertical) ? parent.top : undefined bottom: parent.bottom left: (plasmoid.formFactor !== PlasmaCore.Types.Vertical) ? undefined : parent.left } visible: currentApplet && currentApplet.applet.pluginName == "org.kde.plasma.panelspacer" opacity: visible && !xAnim.running && !yAnim.running ? 1.0 : 0 width: configurationArea.spacerHandleSize height: configurationArea.spacerHandleSize color: theme.textColor Behavior on opacity { NumberAnimation { duration: units.longDuration easing.type: Easing.InOutQuad } } }*/ Behavior on x { enabled: !configurationArea.pressed NumberAnimation { id: xAnim duration: units.longDuration easing.type: Easing.InOutQuad } } Behavior on y { id: yAnim enabled: !configurationArea.pressed NumberAnimation { duration: units.longDuration easing.type: Easing.InOutQuad } } Behavior on width { enabled: !configurationArea.pressed NumberAnimation { duration: units.longDuration easing.type: Easing.InOutQuad } } Behavior on height { enabled: !configurationArea.pressed NumberAnimation { duration: units.longDuration easing.type: Easing.InOutQuad } } Behavior on opacity { NumberAnimation { duration: units.longDuration easing.type: Easing.InOutQuad } } } PlasmaCore.Dialog { id: tooltip visualParent: currentApplet type: PlasmaCore.Dialog.Dock flags: Qt.WindowStaysOnTopHint | Qt.WindowDoesNotAcceptFocus | Qt.BypassWindowManagerHint | Qt.ToolTip location: plasmoid.location onVisualParentChanged: { if (visualParent && currentApplet && currentApplet !== ruler && (currentApplet.applet || currentApplet.isSeparator || currentApplet.isInternalViewSplitter)) { configureButton.visible = !currentApplet.isInternalViewSplitter && (currentApplet.applet.pluginName !== root.plasmoidName) && currentApplet.applet.action("configure") && currentApplet.applet.action("configure").enabled; closeButton.visible = !currentApplet.isInternalViewSplitter && currentApplet.applet.action("remove") && currentApplet.applet.action("remove").enabled && !(currentApplet.applet.pluginName===root.plasmoidName && dock && dock.docksWithTasks()===1 && dock.tasksPresent()); lockButton.visible = !currentApplet.isInternalViewSplitter && (currentApplet.applet.pluginName !== "org.kde.plasma.systemtray") && (currentApplet.applet.pluginName !== root.plasmoidName) && !currentApplet.isSeparator label.text = currentApplet.isInternalViewSplitter ? i18n("Justify Splitter") : currentApplet.applet.title; } else { if (currentApplet === ruler) { configureButton.visible = false; closeButton.visible = false; lockButton.visible = false; label.text = ruler.tooltip; tooltip.visible = true; } } } mainItem: MouseArea { id: tooltipMouseArea enabled: currentApplet width: handleRow.childrenRect.width + (2 * handleRow.spacing) height: Math.max(configureButton.height, label.contentHeight, closeButton.height) hoverEnabled: true LayoutMirroring.enabled: Qt.application.layoutDirection === Qt.RightToLeft LayoutMirroring.childrenInherit: true onEntered: hideTimer.stop(); onExited: hideTimer.restart(); Connections { target: ruler onContainsMouseChanged: { if (ruler.containsMouse) { configurationArea.currentApplet = ruler; } } } Row { id: handleRow anchors.horizontalCenter: parent.horizontalCenter spacing: 2*units.smallSpacing Row{ spacing: units.smallSpacing/2 PlasmaComponents.ToolButton { id: configureButton anchors.verticalCenter: parent.verticalCenter iconSource: "configure" tooltip: i18n("Configure applet") onClicked: { tooltip.visible = false; currentApplet.applet.action("configure").trigger(); } } PlasmaComponents.Label { id: label anchors.verticalCenter: parent.verticalCenter anchors.rightMargin: units.smallSpacing textFormat: Text.PlainText maximumLineCount: 1 //! update value of maxLength in tooltip Binding{ target: label property: "text" when: currentApplet === ruler value: ruler.tooltip } } PlasmaComponents.ToolButton{ id: lockButton checkable: true iconSource: checked ? "lock" : "unlock" tooltip: i18n("Lock/Unlock the parabolic effect for this applet") onCheckedChanged: { currentApplet.lockZoom = checked; root.layoutManager.saveLocks(); } } PlasmaComponents.ToolButton { id: closeButton anchors.verticalCenter: parent.verticalCenter - iconSource: "window-close" + iconSource: "delete" tooltip: i18n("Remove applet") onClicked: { tooltip.visible = false; if(currentApplet && currentApplet.applet) currentApplet.applet.action("remove").trigger(); } } } } } } } diff --git a/shell/package/contents/configuration/LatteDockConfiguration.qml b/shell/package/contents/configuration/LatteDockConfiguration.qml index c74624a4..09f73bf5 100644 --- a/shell/package/contents/configuration/LatteDockConfiguration.qml +++ b/shell/package/contents/configuration/LatteDockConfiguration.qml @@ -1,533 +1,533 @@ /* * 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.1 as Latte import "../controls" as LatteExtraControls FocusScope { id: dialog property int maxWidth: Math.max(34 * theme.defaultFont.pixelSize, 0.85 * height) width: maxWidth + units.smallSpacing * 2 height: Math.min(content.height + units.smallSpacing * 2, dock.screenGeometry.height - dock.normalThickness - 2*units.largeSpacing) //! for small resolutions we better limit the size of the settings in order to be shown properly Layout.minimumWidth: width Layout.minimumHeight: height LayoutMirroring.enabled: Qt.application.layoutDirection === Qt.RightToLeft LayoutMirroring.childrenInherit: true readonly property bool dockIsPanel: behaviorPage.dockTypeSelection.isPanel 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) PlasmaCore.FrameSvgItem{ anchors.fill: parent imagePath: "dialogs/background" enabledBorders: dockConfig.enabledBorders } ColumnLayout { id: content Layout.minimumWidth: width Layout.minimumHeight: calculatedHeight Layout.preferredWidth: width Layout.preferredHeight: calculatedHeight width: dialog.maxWidth 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) { dockConfig.hideConfigWindow(); } else if (event.key === Qt.Key_Left) { // if (tabGroup.currentTab === behaviorPage) { if (plasmoid.configuration.advanced) { tabGroup.currentTab = tweaksPage; tabBar.currentTab = tweaksTabBtn; } else if (tasksTabBtn.visible) { tabGroup.currentTab = tasksPage; tabBar.currentTab = tasksTabBtn; } else { tabGroup.currentTab = appearancePage; tabBar.currentTab = appearanceTabBtn; } } else if (tabGroup.currentTab === tweaksPage) { if (tasksTabBtn.visible) { tabGroup.currentTab = tasksPage; tabBar.currentTab = tasksTabBtn; } else { tabGroup.currentTab = appearancePage; tabBar.currentTab = appearanceTabBtn; } } else if (tabGroup.currentTab === tasksPage) { tabGroup.currentTab = appearancePage; tabBar.currentTab = appearanceTabBtn; } else if (tabGroup.currentTab === appearancePage) { tabGroup.currentTab = behaviorPage; tabBar.currentTab = behaviorTabBtn; } // } else if (event.key === Qt.Key_Right) { // if (tabGroup.currentTab === behaviorPage) { tabGroup.currentTab = appearancePage; tabBar.currentTab = appearanceTabBtn; } else if (tabGroup.currentTab === appearancePage) { if (tasksTabBtn.visible) { tabGroup.currentTab = tasksPage; tabBar.currentTab = tasksTabBtn; } else if (plasmoid.configuration.advanced) { tabGroup.currentTab = tweaksPage; tabBar.currentTab = tweaksTabBtn; } else { tabGroup.currentTab = behaviorPage; tabBar.currentTab = behaviorTabBtn; } } else if (tabGroup.currentTab === tasksPage) { if (plasmoid.configuration.advanced) { tabGroup.currentTab = tweaksPage; tabBar.currentTab = tweaksTabBtn; } else { tabGroup.currentTab = behaviorPage; tabBar.currentTab = behaviorTabBtn; } } else if (tabGroup.currentTab === tweaksPage) { tabGroup.currentTab = behaviorPage; tabBar.currentTab = behaviorTabBtn; } // } } 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 LatteExtraControls.ToolTip{ parent: logo text: i18n("Open Latte settings window") visible: aboutMouseArea.containsMouse delay: 7 * units.longDuration } Latte.IconItem { id: logo width: Math.round(1.4 * latteTxtMetrics.font.pixelSize) height: width smooth: true source: "latte-dock" // animated: true usesPlasmaTheme: false active: aboutMouseArea.containsMouse } PlasmaComponents.Label { id: latteTxtMetrics text: "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() } } MouseArea { id: aboutMouseArea acceptedButtons: Qt.LeftButton anchors.fill: parent hoverEnabled: true readonly property int preferencesPage: Latte.Dock.PreferencesPage onClicked: layoutManager.showLatteSettingsDialog(preferencesPage) } } Item{ id: headerSpacer Layout.minimumHeight: advancedSettings.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 * 3 //!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 dockConfig.setSticker(checked) } Component.onCompleted: { checked = plasmoid.configuration.configurationSticker dockConfig.setSticker(plasmoid.configuration.configurationSticker) } } RowLayout { id: advancedSettings Layout.fillWidth: true Layout.rightMargin: units.smallSpacing * 2 Layout.alignment: Qt.AlignRight | Qt.AlignBottom PlasmaComponents.Label { Layout.fillWidth: true Layout.alignment: Qt.AlignRight } PlasmaComponents.Label { text: i18n("Advanced") Layout.alignment: Qt.AlignRight opacity: plasmoid.configuration.advanced ? 1 : 0.3 MouseArea { anchors.fill: parent onClicked: { plasmoid.configuration.advanced = !advancedSwitch.checked; advancedSwitch.checked = plasmoid.configuration.advanced; } } } Switch { id: advancedSwitch checked: plasmoid.configuration.advanced onPressedChanged: { if(pressed) plasmoid.configuration.advanced = !checked; } style: Styles.SwitchStyle { property bool checked: advancedSwitch.checked } onCheckedChanged: { if (!checked && tabGroup.currentTab === tweaksPage) { if (tasksTabBtn.visible) { tabGroup.currentTab = tasksPage; tabBar.currentTab = tasksTabBtn; } else { tabGroup.currentTab = appearancePage; tabBar.currentTab = appearanceTabBtn; } } if (checked) { dockConfig.createSecondaryWindow(); } else { dockConfig.deleteSecondaryWindow(); } } } } } } PlasmaComponents.TabBar { id: tabBar Layout.fillWidth: true Layout.maximumWidth: maxWidth PlasmaComponents.TabButton { id: behaviorTabBtn text: i18n("Behavior") tab: behaviorPage } PlasmaComponents.TabButton { id: appearanceTabBtn text: i18n("Appearance") tab: appearancePage } PlasmaComponents.TabButton { id: tasksTabBtn text: i18n("Tasks") tab: tasksPage visible: dock.latteTasksPresent() } PlasmaComponents.TabButton { id: tweaksTabBtn text: i18n("Tweaks") tab: tweaksPage visible: plasmoid.configuration.advanced } } Rectangle { id: pagesBackground Layout.fillWidth: true Layout.fillHeight: false Layout.minimumWidth: maxWidth - 2*units.smallSpacing Layout.minimumHeight: height Layout.maximumHeight: height width: maxWidth - units.smallSpacing 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: Math.min(29*theme.mSize(theme.defaultFont).height + units.smallSpacing * 2, //calculatios according to font size dock.screenGeometry.height - dock.normalThickness - 2*units.largeSpacing - header.height - headerSpacer.height - tabBar.height - actionButtons.height - 36) //calculations according to screen geometry and elements heights 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 BehaviorConfig { id: behaviorPage } AppearanceConfig { id: appearancePage } TasksConfig { id: tasksPage } TweaksConfig { id: tweaksPage } } } } RowLayout { id: actionButtons Layout.fillWidth: true Layout.alignment: Qt.AlignHCenter | Qt.AlignBottom spacing: units.largeSpacing Connections{ target: dock onDocksCountChanged: actionButtons.updateEnabled(); } function updateEnabled() { addDock.enabled = dock.docksCount < 4 && dock.freeEdges().length > 0 removeDock.enabled = dock.docksCount>1 && !(dock.docksWithTasks()===1 && dock.tasksPresent()) } PlasmaComponents.Button { Layout.alignment: Qt.AlignLeft Layout.fillWidth: true text:" " PlasmaComponents3.ComboBox { id: actionsCmb anchors.fill: parent enabled: addDock.enabled property var activeLayoutsNames; function addModel() { var actions = [] actions.push(" " + i18n("Copy Dock")); var tempActiveLayouts = layoutManager.activeLayoutsNames(); var currentLayoutIndex = tempActiveLayouts.indexOf(dock.managedLayout.name); tempActiveLayouts.splice(currentLayoutIndex,1); if (tempActiveLayouts.length > 0) { activeLayoutsNames = tempActiveLayouts; actions.push(" ------ "); for(var i=0; i=2) { dock.hideDockDuringMovingToLayout(activeLayoutsNames[index-2]); } actionsCmb.currentIndex = -1; } onEnabledChanged: { if (enabled) addModel(); else emptyModel(); } } //overlayed button PlasmaComponents.Button { id: addDock anchors.left: Qt.application.layoutDirection === Qt.RightToLeft ? undefined : parent.left anchors.right: Qt.application.layoutDirection === Qt.RightToLeft ? parent.right : undefined LayoutMirroring.enabled: false width: parent.width - units.iconSizes.medium + 2*units.smallSpacing height: parent.height text: i18n("New Dock") iconSource: "list-add" tooltip: i18n("Add a new dock") onClicked: dock.addNewDock() Component.onCompleted: { enabled = dock.freeEdges().length > 0 } } } PlasmaComponents.Button { id: removeDock Layout.fillWidth: true Layout.alignment: Qt.AlignHCenter text: i18n("Remove") - iconSource: "edit-delete" + iconSource: "delete" opacity: dock.totalDocksCount > 1 ? 1 : 0 tooltip: i18n("Remove current dock") onClicked: dock.removeDock() } PlasmaComponents.Button { id: closeButton Layout.fillWidth: true Layout.alignment: Qt.AlignRight text: i18n("Close") iconSource: "dialog-close" tooltip: i18n("Close settings window") onClicked: dockConfig.hideConfigWindow(); } } } }