Warning, /plasma/latte-dock/shell/package/contents/configuration/pages/BehaviorConfig.qml is written in an unsupported language. File is not indexed.

0001 /*
0002     SPDX-FileCopyrightText: 2016 Smith AR <audoban@openmailbox.org>
0003     SPDX-FileCopyrightText: 2016 Michail Vourlakos <mvourlakos@gmail.com>
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 import QtQuick 2.0
0008 import QtQuick.Controls 1.4
0009 import QtQuick.Layouts 1.3
0010 import QtGraphicalEffects 1.0
0011 
0012 import org.kde.plasma.core 2.0 as PlasmaCore
0013 import org.kde.plasma.components 2.0 as PlasmaComponents
0014 import org.kde.plasma.components 3.0 as PlasmaComponents3
0015 
0016 import org.kde.latte.core 0.2 as LatteCore
0017 import org.kde.latte.components 1.0 as LatteComponents
0018 import org.kde.latte.private.containment 0.1 as LatteContainment
0019 
0020 import "../../controls" as LatteExtraControls
0021 
0022 PlasmaComponents.Page {
0023     id: page
0024     width: content.width + content.Layout.leftMargin * 2
0025     height: content.height + units.smallSpacing * 2
0026 
0027     ColumnLayout {
0028         id: content       
0029         width: (dialog.appliedWidth - units.smallSpacing * 2) - Layout.leftMargin * 2
0030         spacing: dialog.subGroupSpacing
0031         anchors.horizontalCenter: parent.horizontalCenter
0032         Layout.leftMargin: units.smallSpacing * 2
0033 
0034         //! BEGIN: Inline Dock/Panel Type, it is used only when the secondary window
0035         //! overlaps the main dock config window
0036         Loader {
0037             Layout.fillWidth: true
0038             active: dialog.advancedLevel && viewConfig.showInlineProperties && viewConfig.isReady
0039             visible: active
0040 
0041             sourceComponent: ColumnLayout {
0042                 Layout.fillWidth: true
0043                 Layout.topMargin: units.smallSpacing
0044                 spacing: units.smallSpacing
0045 
0046                 LatteComponents.Header {
0047                     text: i18n("Type")
0048                 }
0049 
0050                 LatteExtraControls.TypeSelection{
0051                     id: viewTypeSelection
0052                     horizontal: true
0053                 }
0054             }
0055         }
0056         //! END: Inline Dock/Panel Type
0057 
0058         //! BEGIN: Location
0059         ColumnLayout {
0060             Layout.fillWidth: true
0061             spacing: units.smallSpacing
0062             Layout.topMargin: units.smallSpacing
0063 
0064             LatteComponents.Header {
0065                 text: screenRow.visible ? i18n("Screen") : i18n("Location")
0066             }
0067 
0068             Connections {
0069                 target: universalSettings
0070                 onScreensCountChanged: screenRow.updateScreens()
0071             }
0072 
0073             RowLayout {
0074                 id: screenRow
0075                 Layout.fillWidth: true
0076                 Layout.leftMargin: units.smallSpacing * 2
0077                 Layout.rightMargin: units.smallSpacing * 3
0078                 spacing: 2
0079                 visible: screensCount > 1 || dialog.advancedLevel
0080 
0081                 property int screensCount: 1
0082 
0083                 function updateScreens() {
0084                     screensCount = universalSettings.screens.length;
0085                     screensModel.clear();
0086 
0087                     var primary = {name: i18n("On Primary Screen"), icon: 'favorite'};
0088                     screensModel.append(primary);
0089 
0090                     var allscreens = {name: i18n("On All Screens"), icon: 'favorite'};
0091                     screensModel.append(allscreens);
0092 
0093                     var allsecscreens = {name: i18n("On All Secondary Screens"), icon: 'favorite'};
0094                     screensModel.append(allsecscreens);
0095 
0096                     //check if the screen exists, it is used in cases Latte is moving
0097                     //the view automatically to primaryScreen in order for the user
0098                     //to has always a view with tasks shown
0099                     var screenExists = false
0100                     for (var i = 0; i < universalSettings.screens.length; i++) {
0101                         if (universalSettings.screens[i].name === latteView.positioner.currentScreenName) {
0102                             screenExists = true;
0103                         }
0104                     }
0105 
0106                     if (!screenExists && !latteView.onPrimary) {
0107                         var scr = {name: latteView.positioner.currentScreenName, icon: 'view-fullscreen'};
0108                         screensModel.append(scr);
0109                     }
0110 
0111                     for (var i = 0; i < universalSettings.screens.length; i++) {
0112                         var scr = {name: universalSettings.screens[i].name, icon: 'view-fullscreen'};
0113                         screensModel.append(scr);
0114                     }
0115 
0116                     if (latteView.onPrimary && latteView.screensGroup === LatteCore.Types.SingleScreenGroup) {
0117                         screenCmb.currentIndex = 0;
0118                     } else if (latteView.screensGroup === LatteCore.Types.AllScreensGroup) {
0119                         screenCmb.currentIndex = 1;
0120                     } else if (latteView.screensGroup === LatteCore.Types.AllSecondaryScreensGroup) {
0121                         screenCmb.currentIndex = 2;
0122                     } else {
0123                         screenCmb.currentIndex = screenCmb.findScreen(latteView.positioner.currentScreenName);
0124                     }
0125 
0126                     console.log(latteView.positioner.currentScreenName);
0127                 }
0128 
0129                 Connections{
0130                     target: viewConfig
0131                     onShowSignal: screenRow.updateScreens();
0132                 }
0133 
0134                 ListModel {
0135                     id: screensModel
0136                 }
0137 
0138                 LatteComponents.ComboBox {
0139                     id: screenCmb
0140                     Layout.fillWidth: true
0141                     model: screensModel
0142                     textRole: "name"
0143                     iconRole: "icon"
0144 
0145                     Component.onCompleted: screenRow.updateScreens();
0146 
0147                     onActivated: {
0148                         if (index === 0) { // primary
0149                             latteView.positioner.setNextLocation("", LatteCore.Types.SingleScreenGroup, "{primary-screen}", PlasmaCore.Types.Floating, LatteCore.Types.NoneAlignment);
0150                         } else if (index === 1) { // all screens
0151                             latteView.positioner.setNextLocation("", LatteCore.Types.AllScreensGroup, "{primary-screen}", PlasmaCore.Types.Floating, LatteCore.Types.NoneAlignment);
0152                         } else if (index === 2) { // all secondary screens
0153                             latteView.positioner.setNextLocation("", LatteCore.Types.AllSecondaryScreensGroup, "", PlasmaCore.Types.Floating, LatteCore.Types.NoneAlignment);
0154                         } else if (index>2 && (index !== findScreen(latteView.positioner.currentScreenName) || latteView.onPrimary)) {// explicit screen
0155                             latteView.positioner.setNextLocation("", LatteCore.Types.SingleScreenGroup, textAt(index), PlasmaCore.Types.Floating, LatteCore.Types.NoneAlignment);
0156                         }
0157                     }
0158 
0159                     function findScreen(scrName) {                        
0160                         for(var i=0; i<screensModel.count; ++i) {
0161                             if (screensModel.get(i).name === scrName) {
0162                                 return i;
0163                             }
0164                         }
0165 
0166                         return 0;
0167                     }
0168                 }
0169             }
0170 
0171             RowLayout {
0172                 id: locationLayout
0173                 Layout.fillWidth: true
0174                 Layout.leftMargin: units.smallSpacing * 2
0175                 Layout.rightMargin: units.smallSpacing * 2
0176                 Layout.topMargin: screenRow.visible ? units.smallSpacing : 0
0177                 LayoutMirroring.enabled: false
0178                 spacing: 2
0179 
0180                 readonly property int buttonSize: (dialog.optionsWidth - (spacing * 3)) / 4
0181 
0182                 ExclusiveGroup {
0183                     id: locationGroup
0184                 }
0185 
0186                 PlasmaComponents.Button {
0187                     id: bottomEdgeBtn
0188                     Layout.minimumWidth: parent.buttonSize
0189                     Layout.maximumWidth: Layout.minimumWidth
0190                     text: i18nc("bottom location", "Bottom")
0191                     iconSource: "arrow-down"
0192                     checked: plasmoid.location === edge
0193                     checkable: false
0194                     exclusiveGroup: locationGroup
0195 
0196                     readonly property int edge: PlasmaCore.Types.BottomEdge
0197 
0198                     onClicked: {
0199                         //! clicked event is more wayland friendly because it release focus from the button before hiding the window
0200                         if (viewConfig.isReady && plasmoid.location !== edge) {
0201                             latteView.positioner.setNextLocation("", latteView.screensGroup, "", edge, LatteCore.Types.NoneAlignment);
0202                         }
0203                     }
0204                 }
0205                 PlasmaComponents.Button {
0206                     id: leftEdgeBtn
0207                     Layout.minimumWidth: parent.buttonSize
0208                     Layout.maximumWidth: Layout.minimumWidth
0209                     text: i18nc("left location", "Left")
0210                     iconSource: "arrow-left"
0211                     checked: plasmoid.location === edge
0212                     checkable: false
0213                     exclusiveGroup: locationGroup
0214 
0215                     readonly property int edge: PlasmaCore.Types.LeftEdge
0216 
0217                     onClicked: {
0218                         //! clicked event is more wayland friendly because it release focus from the button before hiding the window
0219                         if (viewConfig.isReady && plasmoid.location !== edge) {
0220                             latteView.positioner.setNextLocation("", latteView.screensGroup, "", edge, LatteCore.Types.NoneAlignment);
0221                         }
0222                     }
0223                 }
0224                 PlasmaComponents.Button {
0225                     id: topEdgeBtn
0226                     Layout.minimumWidth: parent.buttonSize
0227                     Layout.maximumWidth: Layout.minimumWidth
0228                     text: i18nc("top location", "Top")
0229                     iconSource: "arrow-up"
0230                     checked: plasmoid.location === edge
0231                     checkable: false
0232                     exclusiveGroup: locationGroup
0233 
0234                     readonly property int edge: PlasmaCore.Types.TopEdge
0235 
0236                     onClicked: {
0237                         //! clicked event is more wayland friendly because it release focus from the button before hiding the window
0238                         if (viewConfig.isReady && plasmoid.location !== edge) {
0239                             latteView.positioner.setNextLocation("", latteView.screensGroup, "", edge, LatteCore.Types.NoneAlignment);
0240                         }
0241                     }
0242                 }
0243                 PlasmaComponents.Button {
0244                     id: rightEdgeBtn
0245                     Layout.minimumWidth: parent.buttonSize
0246                     Layout.maximumWidth: Layout.minimumWidth
0247                     text: i18nc("right location", "Right")
0248                     iconSource: "arrow-right"
0249                     checked: plasmoid.location === edge
0250                     checkable: false
0251                     exclusiveGroup: locationGroup
0252 
0253                     readonly property int edge: PlasmaCore.Types.RightEdge
0254 
0255                     onClicked: {
0256                         //! clicked event is more wayland friendly because it release focus from the button before hiding the window
0257                         if (viewConfig.isReady && plasmoid.location !== edge) {
0258                             latteView.positioner.setNextLocation("", latteView.screensGroup, "", edge, LatteCore.Types.NoneAlignment);
0259                         }
0260                     }
0261                 }
0262             }
0263         }
0264         //! END: Location
0265 
0266         //! BEGIN: Alignment
0267         ColumnLayout {
0268             Layout.fillWidth: true
0269             spacing: units.smallSpacing
0270 
0271             LatteComponents.Header {
0272                 text: i18n("Alignment")
0273             }
0274 
0275             RowLayout {
0276                 id: alignmentRow
0277                 Layout.fillWidth: true
0278                 Layout.leftMargin: units.smallSpacing * 2
0279                 Layout.rightMargin: units.smallSpacing * 2
0280                 LayoutMirroring.enabled: false
0281                 spacing: 2
0282 
0283                 readonly property int configAlignment: plasmoid.configuration.alignment
0284                 readonly property int buttonSize: (dialog.optionsWidth - (spacing * 3)) / 4
0285 
0286                 ExclusiveGroup {
0287                     id: alignmentGroup
0288                 }
0289 
0290                 PlasmaComponents.Button {
0291                     Layout.minimumWidth: parent.buttonSize
0292                     Layout.maximumWidth: Layout.minimumWidth
0293                     text: panelIsVertical ? i18nc("top alignment", "Top") : i18nc("left alignment", "Left")
0294                     iconSource: panelIsVertical ? "format-align-vertical-top" : "format-justify-left"
0295                     checked: parent.configAlignment === alignment
0296                     checkable: false
0297                     exclusiveGroup: alignmentGroup
0298 
0299                     property int alignment: panelIsVertical ? LatteCore.Types.Top : LatteCore.Types.Left
0300 
0301                     onPressedChanged: {
0302                         if (pressed) {
0303                             latteView.positioner.setNextLocation("", latteView.screensGroup, "", PlasmaCore.Types.Floating, alignment);
0304                         }
0305                     }
0306                 }
0307                 PlasmaComponents.Button {
0308                     Layout.minimumWidth: parent.buttonSize
0309                     Layout.maximumWidth: Layout.minimumWidth
0310                     text: i18nc("center alignment", "Center")
0311                     iconSource: panelIsVertical ? "format-align-vertical-center" : "format-justify-center"
0312                     checked: parent.configAlignment === alignment
0313                     checkable: false
0314                     exclusiveGroup: alignmentGroup
0315 
0316                     property int alignment: LatteCore.Types.Center
0317 
0318                     onPressedChanged: {
0319                         if (pressed) {
0320                             latteView.positioner.setNextLocation("", latteView.screensGroup, "", PlasmaCore.Types.Floating, alignment);
0321                         }
0322                     }
0323                 }
0324                 PlasmaComponents.Button {
0325                     Layout.minimumWidth: parent.buttonSize
0326                     Layout.maximumWidth: Layout.minimumWidth
0327                     text: panelIsVertical ? i18nc("bottom alignment", "Bottom") : i18nc("right alignment", "Right")
0328                     iconSource: panelIsVertical ? "format-align-vertical-bottom" : "format-justify-right"
0329                     checked: parent.configAlignment === alignment
0330                     checkable: false
0331                     exclusiveGroup: alignmentGroup
0332 
0333                     property int alignment: panelIsVertical ? LatteCore.Types.Bottom : LatteCore.Types.Right
0334 
0335                     onPressedChanged: {
0336                         if (pressed) {
0337                             latteView.positioner.setNextLocation("", latteView.screensGroup, "", PlasmaCore.Types.Floating, alignment);
0338                         }
0339                     }
0340                 }
0341 
0342                 PlasmaComponents.Button {
0343                     Layout.minimumWidth: parent.buttonSize
0344                     Layout.maximumWidth: Layout.minimumWidth
0345                     text: i18nc("justify alignment", "Justify")
0346                     iconSource: "format-justify-fill"
0347                     checked: parent.configAlignment === alignment
0348                     checkable: false
0349                     exclusiveGroup: alignmentGroup
0350 
0351                     property int alignment: LatteCore.Types.Justify
0352 
0353                     onPressedChanged: {
0354                         if (pressed) {
0355                             latteView.positioner.setNextLocation("", latteView.screensGroup, "", PlasmaCore.Types.Floating, alignment);
0356                         }
0357                     }
0358                 }
0359             }
0360         }
0361         //! END: Alignment
0362 
0363         //! BEGIN: Visibility
0364         ColumnLayout {
0365             Layout.fillWidth: true
0366             spacing: units.smallSpacing
0367 
0368             LatteComponents.Header {
0369                 text: i18n("Visibility")
0370             }
0371 
0372             GridLayout {
0373                 width: parent.width
0374                 rowSpacing: 1
0375                 columnSpacing: 2
0376                 Layout.leftMargin: units.smallSpacing * 2
0377                 Layout.rightMargin: units.smallSpacing * 2
0378 
0379                 columns: 2
0380 
0381                 property int mode: latteView.visibility.mode
0382                 readonly property int buttonSize: (dialog.optionsWidth - (columnSpacing)) / 2
0383 
0384                 ExclusiveGroup {
0385                     id: visibilityGroup
0386                 }
0387 
0388                 PlasmaComponents.Button {
0389                     id:alwaysVisibleBtn
0390                     Layout.minimumWidth: parent.buttonSize
0391                     Layout.maximumWidth: Layout.minimumWidth
0392                     text: i18n("Always Visible")
0393                     checked: parent.mode === mode
0394                     checkable: false
0395                     exclusiveGroup: visibilityGroup
0396 
0397                     property int mode: LatteCore.Types.AlwaysVisible
0398 
0399                     onPressedChanged: {
0400                         if (pressed) {
0401                             latteView.visibility.mode = mode;
0402                         }
0403                     }
0404                 }
0405                 PlasmaComponents.Button {
0406                     Layout.minimumWidth: parent.buttonSize
0407                     Layout.maximumWidth: Layout.minimumWidth
0408                     text: i18n("Auto Hide")
0409                     checked: parent.mode === mode
0410                     checkable: false
0411                     exclusiveGroup: visibilityGroup
0412 
0413                     property int mode: LatteCore.Types.AutoHide
0414 
0415                     onPressedChanged: {
0416                         if (pressed) {
0417                             latteView.visibility.mode = mode;
0418                         }
0419                     }
0420                 }
0421                 PlasmaComponents.Button {
0422                     Layout.minimumWidth: parent.buttonSize
0423                     Layout.maximumWidth: Layout.minimumWidth
0424                     text: i18n("Dodge Active")
0425                     checked: parent.mode === mode
0426                     checkable: false
0427                     exclusiveGroup: visibilityGroup
0428 
0429                     property int mode: LatteCore.Types.DodgeActive
0430 
0431                     onPressedChanged: {
0432                         if (pressed) {
0433                             latteView.visibility.mode = mode;
0434                         }
0435                     }
0436                 }
0437 
0438                 LatteExtraControls.CustomVisibilityModeButton {
0439                     id: dodgeModeBtn
0440                     Layout.minimumWidth: parent.buttonSize
0441                     Layout.maximumWidth: Layout.minimumWidth
0442                     implicitWidth: alwaysVisibleBtn.implicitWidth
0443                     implicitHeight: alwaysVisibleBtn.implicitHeight
0444 
0445                     checked: parent.mode === mode
0446                     exclusiveGroup:  visibilityGroup
0447 
0448                     mode: plasmoid.configuration.lastDodgeVisibilityMode
0449                     modes: [
0450                         {
0451                             pluginId: LatteCore.Types.DodgeMaximized,
0452                             name: i18n("Dodge Maximized"),
0453                             tooltip: ""
0454                         },
0455                         {
0456                             pluginId: LatteCore.Types.DodgeAllWindows,
0457                             name: i18n("Dodge All Windows"),
0458                             tooltip: ""
0459                         }
0460                     ]
0461 
0462                     onViewRelevantVisibilityModeChanged: plasmoid.configuration.lastDodgeVisibilityMode = latteView.visibility.mode;
0463                 }
0464 
0465                 LatteExtraControls.CustomVisibilityModeButton {
0466                     id: windowsModeBtn
0467                     Layout.minimumWidth: parent.buttonSize
0468                     Layout.maximumWidth: Layout.minimumWidth
0469                     implicitWidth: alwaysVisibleBtn.implicitWidth
0470                     implicitHeight: alwaysVisibleBtn.implicitHeight
0471 
0472                     checked: parent.mode === mode
0473                     exclusiveGroup:  visibilityGroup
0474 
0475                     mode: plasmoid.configuration.lastWindowsVisibilityMode
0476                     modes: [
0477                         {
0478                             pluginId: LatteCore.Types.WindowsGoBelow,
0479                             name: i18n("Windows Go Below"),
0480                             tooltip: ""
0481                         },
0482                         {
0483                             pluginId: LatteCore.Types.WindowsCanCover,
0484                             name: i18n("Windows Can Cover"),
0485                             tooltip: ""
0486                         },
0487                         {
0488                             pluginId: LatteCore.Types.WindowsAlwaysCover,
0489                             name: i18n("Windows Always Cover"),
0490                             tooltip: ""
0491                         }
0492                     ]
0493 
0494                     onViewRelevantVisibilityModeChanged: plasmoid.configuration.lastWindowsVisibilityMode = latteView.visibility.mode;
0495                 }
0496 
0497                 LatteExtraControls.CustomVisibilityModeButton {
0498                     id: sidebarModeBtn
0499                     Layout.minimumWidth: parent.buttonSize
0500                     Layout.maximumWidth: Layout.minimumWidth
0501                     implicitWidth: alwaysVisibleBtn.implicitWidth
0502                     implicitHeight: alwaysVisibleBtn.implicitHeight
0503 
0504                     checked: parent.mode === mode
0505                     exclusiveGroup:  visibilityGroup
0506 
0507                     mode: plasmoid.configuration.lastSidebarVisibilityMode
0508                     modes: [
0509                         {
0510                             pluginId: LatteCore.Types.SidebarOnDemand,
0511                             name: i18n("On Demand Sidebar"),
0512                             tooltip: i18n("Sidebar can be shown and become hidden only through an external applet, shortcut or script")
0513                         },
0514                         {
0515                             pluginId: LatteCore.Types.SidebarAutoHide,
0516                             name: i18n("Auto Hide Sidebar"),
0517                             tooltip: i18n("Sidebar can be shown only through an external applet, shortcut or script but it can also autohide itself when it does not contain mouse")
0518                         }
0519                     ]
0520 
0521                     onViewRelevantVisibilityModeChanged: plasmoid.configuration.lastSidebarVisibilityMode = latteView.visibility.mode;
0522                 }
0523 
0524             }
0525         }
0526         //! END: Visibility
0527 
0528         //! BEGIN: Delay
0529         ColumnLayout {
0530             Layout.fillWidth: true
0531             spacing: units.smallSpacing
0532 
0533             enabled: !(latteView.visibility.mode === LatteCore.Types.AlwaysVisible
0534                        || latteView.visibility.mode === LatteCore.Types.WindowsGoBelow
0535                        || latteView.visibility.mode === LatteCore.Types.WindowsAlwaysCover
0536                        || latteView.visibility.mode === LatteCore.Types.SidebarOnDemand)
0537 
0538             LatteComponents.Header {
0539                 text: i18n("Delay")
0540             }
0541 
0542             Flow {
0543                 width: dialog.optionsWidth
0544                 Layout.minimumWidth: dialog.optionsWidth
0545                 Layout.maximumWidth: dialog.optionsWidth
0546                 Layout.leftMargin: units.smallSpacing * 2
0547                 Layout.rightMargin: units.smallSpacing * 2
0548                 Layout.topMargin: units.smallSpacing
0549 
0550                 spacing: 2
0551 
0552                 readonly property bool overlap: showContainer.overlap || hideContainer.overlap
0553 
0554                 Item {
0555                     id: showContainer
0556                     width: parent.overlap ? dialog.optionsWidth : oneLineWidth
0557                     height: childrenRect.height
0558                     implicitWidth: width
0559                     implicitHeight: height
0560 
0561                     readonly property bool overlap: oneLineWidth > alwaysVisibleBtn.width
0562                     readonly property int oneLineWidth: Math.max(alwaysVisibleBtn.width, showTimerRow.width)
0563 
0564                     RowLayout{
0565                         id: showTimerRow
0566                         anchors.horizontalCenter: parent.horizontalCenter
0567                         enabled: latteView.visibility.mode !== LatteCore.Types.SidebarAutoHide
0568                         PlasmaComponents.Label {
0569                             Layout.leftMargin: Qt.application.layoutDirection === Qt.RightToLeft ? units.smallSpacing : 0
0570                             Layout.rightMargin: Qt.application.layoutDirection === Qt.RightToLeft ? 0 : units.smallSpacing
0571                             text: i18n("Show ")
0572                         }
0573 
0574                         LatteComponents.TextField {
0575                             Layout.preferredWidth: implicitWidth
0576                             text: latteView.visibility.timerShow
0577 
0578                             onValueChanged: {
0579                                 latteView.visibility.timerShow = value
0580                             }
0581                         }
0582                     }
0583                 }
0584 
0585                 Item {
0586                     id: hideContainer
0587                     width: parent.overlap ? dialog.optionsWidth : oneLineWidth
0588                     height: childrenRect.height
0589                     implicitWidth: width
0590                     implicitHeight: height
0591 
0592                     readonly property bool overlap: oneLineWidth > alwaysVisibleBtn.width
0593                     readonly property int oneLineWidth: Math.max(alwaysVisibleBtn.width, hideTimerRow.width)
0594 
0595                     RowLayout {
0596                         id: hideTimerRow
0597                         anchors.horizontalCenter: parent.horizontalCenter
0598 
0599                         PlasmaComponents.Label {
0600                             Layout.leftMargin: Qt.application.layoutDirection === Qt.RightToLeft ? units.smallSpacing : 0
0601                             Layout.rightMargin: Qt.application.layoutDirection === Qt.RightToLeft ? 0 : units.smallSpacing
0602                             text: i18n("Hide")
0603                         }
0604 
0605                         LatteComponents.TextField{
0606                             Layout.preferredWidth: implicitWidth
0607                             text: latteView.visibility.timerHide
0608                             maxValue: 5000
0609 
0610                             onValueChanged: {
0611                                 latteView.visibility.timerHide = value
0612                             }
0613                         }
0614                     }
0615                 }
0616             }
0617         }
0618         //! END: Delay
0619 
0620         //! BEGIN: Actions
0621         ColumnLayout {
0622             spacing: units.smallSpacing
0623             visible: dialog.advancedLevel
0624 
0625             LatteComponents.Header {
0626                 text: i18n("Actions")
0627             }
0628 
0629             ColumnLayout {
0630                 id: actionsPropertiesColumn
0631                 Layout.leftMargin: units.smallSpacing * 2
0632                 Layout.rightMargin: units.smallSpacing * 2
0633                 spacing: 0
0634 
0635                 readonly property int maxLabelWidth: Math.max(trackActiveLbl.implicitWidth,
0636                                                               mouseWheelLbl.implicitWidth,
0637                                                               leftBtnLbl.implicitWidth,
0638                                                               midBtnLbl.implicitWidth)
0639 
0640                 ColumnLayout {
0641                     RowLayout {
0642                         Layout.topMargin: units.smallSpacing
0643 
0644                         PlasmaComponents.Label {
0645                             id: trackActiveLbl
0646                             Layout.minimumWidth: actionsPropertiesColumn.maxLabelWidth
0647                             Layout.maximumWidth: actionsPropertiesColumn.maxLabelWidth
0648                             text: i18nc("track active window","Track")
0649                         }
0650 
0651                         LatteComponents.ComboBox {
0652                             id: activeWindowFilterCmb
0653                             Layout.fillWidth: true
0654                             model: [i18nc("track from current screen", "Active Window From Current Screen"),
0655                                 i18nc("track from all screens", "Active Window From All Screens")]
0656 
0657                             currentIndex: plasmoid.configuration.activeWindowFilter
0658 
0659                             onCurrentIndexChanged: {
0660                                 switch(currentIndex) {
0661                                 case LatteContainment.Types.ActiveInCurrentScreen:
0662                                     plasmoid.configuration.activeWindowFilter = LatteContainment.Types.ActiveInCurrentScreen;
0663                                     break;
0664                                 case LatteContainment.Types.ActiveFromAllScreens:
0665                                     plasmoid.configuration.activeWindowFilter = LatteContainment.Types.ActiveFromAllScreens;
0666                                     break;
0667                                 }
0668                             }
0669                         }
0670                     }
0671                 }
0672 
0673                 ColumnLayout {
0674                     Layout.topMargin: units.smallSpacing
0675                     RowLayout {
0676                         PlasmaComponents.Label {
0677                             id: leftBtnLbl
0678                             Layout.minimumWidth: actionsPropertiesColumn.maxLabelWidth
0679                             Layout.maximumWidth: actionsPropertiesColumn.maxLabelWidth
0680                             text: i18n("Left Button")
0681                         }
0682 
0683                         PlasmaComponents.Button {
0684                             Layout.fillWidth: true
0685                             text: i18n("Drag Active Window")
0686                             checkable: true
0687                             tooltip: i18n("The user can use left mouse button to drag and maximized/restore last active window from empty areas")
0688                             iconName: "transform-move"
0689 
0690                             readonly property int dragActiveWindowEnabled: plasmoid.configuration.dragActiveWindowEnabled
0691 
0692                             onDragActiveWindowEnabledChanged: checked = dragActiveWindowEnabled
0693 
0694                             onClicked: {
0695                                 plasmoid.configuration.dragActiveWindowEnabled = checked;
0696                             }
0697                         }
0698                     }
0699 
0700                     RowLayout {
0701                         PlasmaComponents.Label {
0702                             id: midBtnLbl
0703                             Layout.minimumWidth: actionsPropertiesColumn.maxLabelWidth
0704                             Layout.maximumWidth: actionsPropertiesColumn.maxLabelWidth
0705                             text: i18n("Middle Button")
0706                         }
0707 
0708                         PlasmaComponents.Button {
0709                             Layout.fillWidth: true
0710                             text: i18n("Close Active Window")
0711                             checkable: true
0712                             tooltip: i18n("The user can use middle mouse button to close last active window from empty areas")
0713                             iconName: "window-close"
0714 
0715                             readonly property int closeActiveWindowEnabled: plasmoid.configuration.closeActiveWindowEnabled
0716 
0717                             onCloseActiveWindowEnabledChanged: checked = closeActiveWindowEnabled;
0718 
0719                             onClicked: {
0720                                 plasmoid.configuration.closeActiveWindowEnabled = checked;
0721                             }
0722                         }
0723                     }
0724 
0725                     RowLayout {
0726                        // Layout.topMargin: units.smallSpacing
0727 
0728                         PlasmaComponents.Label {
0729                             id: mouseWheelLbl
0730                             Layout.minimumWidth: actionsPropertiesColumn.maxLabelWidth
0731                             Layout.maximumWidth: actionsPropertiesColumn.maxLabelWidth
0732                             text: i18n("Mouse wheel")
0733                         }
0734 
0735                         LatteComponents.ComboBox {
0736                             id: scrollAction
0737                             Layout.fillWidth: true
0738                             model: [i18nc("none scroll actions", "No Action"),
0739                                 i18n("Cycle Through Desktops"),
0740                                 i18n("Cycle Through Activities"),
0741                                 i18n("Cycle Through Tasks"),
0742                                 i18n("Cycle And Minimize Tasks")
0743                             ]
0744 
0745                             currentIndex: plasmoid.configuration.scrollAction
0746 
0747                             onCurrentIndexChanged: {
0748                                 switch(currentIndex) {
0749                                 case LatteContainment.Types.ScrollNone:
0750                                     plasmoid.configuration.scrollAction = LatteContainment.Types.ScrollNone;
0751                                     break;
0752                                 case LatteContainment.Types.ScrollDesktops:
0753                                     plasmoid.configuration.scrollAction = LatteContainment.Types.ScrollDesktops;
0754                                     break;
0755                                 case LatteContainment.Types.ScrollActivities:
0756                                     plasmoid.configuration.scrollAction = LatteContainment.Types.ScrollActivities;
0757                                     break;
0758                                 case LatteContainment.Types.ScrollTasks:
0759                                     plasmoid.configuration.scrollAction = LatteContainment.Types.ScrollTasks;
0760                                     break;
0761                                 case LatteContainment.Types.ScrollToggleMinimized:
0762                                     plasmoid.configuration.scrollAction = LatteContainment.Types.ScrollToggleMinimized;
0763                                     break;
0764                                 }
0765                             }
0766                         }
0767                     }
0768                 }
0769 
0770                 LatteComponents.SubHeader {
0771                     text: i18n("Items")
0772                 }
0773 
0774                 LatteComponents.CheckBoxesColumn {
0775                     LatteComponents.CheckBox {
0776                         id: titleTooltipsChk
0777                         Layout.maximumWidth: dialog.optionsWidth
0778                         text: i18n("Thin title tooltips on hovering")
0779                         tooltip: i18n("Show narrow tooltips produced by Latte for items.\nThese tooltips are not drawn when applets zoom effect is disabled");
0780                         value: plasmoid.configuration.titleTooltips
0781 
0782                         onClicked: {
0783                             plasmoid.configuration.titleTooltips = !plasmoid.configuration.titleTooltips;
0784                         }
0785                     }
0786 
0787                     LatteComponents.CheckBox {
0788                         id: mouseWheelChk
0789                         Layout.maximumWidth: dialog.optionsWidth
0790                         text: i18n("Expand popup through mouse wheel")
0791                         tooltip: i18n("Show or Hide applet popup through mouse wheel action")
0792                         value: plasmoid.configuration.mouseWheelActions
0793                         visible: dialog.advancedLevel
0794 
0795                         onClicked: {
0796                             plasmoid.configuration.mouseWheelActions = !plasmoid.configuration.mouseWheelActions;
0797                         }
0798                     }
0799 
0800                     LatteComponents.CheckBox {
0801                         id: autoSizeChk
0802                         Layout.maximumWidth: dialog.optionsWidth
0803                         text: i18n("Adjust size automatically when needed")
0804                         tooltip: i18n("Items decrease their size when exceed maximum length and increase it when they can fit in")
0805                         value: plasmoid.configuration.autoSizeEnabled
0806                         visible: dialog.advancedLevel
0807 
0808                         onClicked: {
0809                             plasmoid.configuration.autoSizeEnabled = !plasmoid.configuration.autoSizeEnabled;
0810                         }
0811                     }
0812 
0813                     LatteComponents.CheckBox {
0814                         Layout.maximumWidth: dialog.optionsWidth
0815                        // Layout.maximumHeight: mouseWheelChk.height
0816                         text: i18n("Activate based on position global shortcuts")
0817                         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")
0818                         value: latteView.isPreferredForShortcuts || (!latteView.layout.preferredForShortcutsTouched && latteView.isHighestPriorityView())
0819 
0820                         onClicked: {
0821                             latteView.isPreferredForShortcuts = checked;
0822                             if (!latteView.layout.preferredForShortcutsTouched) {
0823                                 latteView.layout.preferredForShortcutsTouched = true;
0824                             }
0825                         }
0826                     }
0827                 }
0828             }
0829 
0830             LatteComponents.SubHeader {
0831                 id: floatingSubCategory
0832                 text: i18n("Floating")
0833                 enabled: plasmoid.configuration.screenEdgeMargin >= 0
0834             }
0835 
0836             LatteComponents.CheckBoxesColumn {
0837                 Layout.leftMargin: units.smallSpacing * 2
0838                 Layout.rightMargin: units.smallSpacing * 2
0839                 enabled: floatingSubCategory.enabled
0840 
0841                 LatteComponents.CheckBoxesColumn {
0842                     LatteComponents.CheckBox {
0843                         Layout.maximumWidth: dialog.optionsWidth
0844                         text: i18n("Always use floating gap for user interaction")
0845                         tooltip: i18n("Floating gap is always used for applets and window interaction")
0846                         value: plasmoid.configuration.floatingInternalGapIsForced
0847                         enabled: plasmoid.configuration.zoomLevel === 0
0848 
0849                         onClicked: {
0850                             plasmoid.configuration.floatingInternalGapIsForced = !plasmoid.configuration.floatingInternalGapIsForced;
0851                         }
0852                     }
0853 
0854                     LatteComponents.CheckBox {
0855                         Layout.maximumWidth: dialog.optionsWidth
0856                         text: i18n("Hide floating gap for maximized windows")
0857                         tooltip: i18n("Floating gap is disabled when there are maximized windows")
0858                         value: plasmoid.configuration.hideFloatingGapForMaximized
0859 
0860                         onClicked: {
0861                             plasmoid.configuration.hideFloatingGapForMaximized = !plasmoid.configuration.hideFloatingGapForMaximized;
0862                         }
0863                     }
0864 
0865                     LatteComponents.CheckBox {
0866                         Layout.maximumWidth: dialog.optionsWidth
0867                         enabled: plasmoid.configuration.hideFloatingGapForMaximized
0868                         text: i18n("Delay floating gap hiding until mouse leaves")
0869                         tooltip: i18n("to avoid clicking on adjacent items accidentally in some cases")
0870                         value: plasmoid.configuration.floatingGapHidingWaitsMouse
0871 
0872                         onClicked: {
0873                             plasmoid.configuration.floatingGapHidingWaitsMouse = !plasmoid.configuration.floatingGapHidingWaitsMouse;
0874                         }
0875                     }
0876 
0877                     LatteComponents.CheckBox {
0878                         Layout.maximumWidth: dialog.optionsWidth
0879                         enabled: latteView.visibility.mode === LatteCore.Types.AlwaysVisible
0880                         text: i18n("Mirror floating gap when it is shown")
0881                         tooltip: i18n("Floating gap is mirrored when it is shown in Always Visible mode")
0882                         value: plasmoid.configuration.floatingGapIsMirrored
0883 
0884                         onClicked: {
0885                             plasmoid.configuration.floatingGapIsMirrored = !plasmoid.configuration.floatingGapIsMirrored;
0886                         }
0887                     }
0888                 }
0889             }
0890         }
0891         //! END: Actions
0892 
0893         //! BEGIN: Adjust
0894         ColumnLayout {
0895             spacing: units.smallSpacing
0896 
0897             visible: dialog.advancedLevel
0898             enabled: !(latteView.visibility.mode === LatteCore.Types.AlwaysVisible
0899                        || latteView.visibility.mode === LatteCore.Types.WindowsGoBelow
0900                        || latteView.visibility.mode === LatteCore.Types.WindowsCanCover
0901                        || latteView.visibility.mode === LatteCore.Types.WindowsAlwaysCover)
0902 
0903             LatteComponents.Header {
0904                 text: i18n("Environment")
0905             }
0906 
0907             LatteComponents.CheckBoxesColumn {
0908                 Layout.leftMargin: units.smallSpacing * 2
0909                 Layout.rightMargin: units.smallSpacing * 2
0910 
0911                 LatteComponents.CheckBox {
0912                     Layout.maximumWidth: dialog.optionsWidth
0913                     text: i18n("Activate KWin edge after hiding")
0914                     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")
0915                     enabled: !dialog.viewIsPanel
0916                              && !latteView.byPassWM
0917                              && latteView.visibility.mode !== LatteCore.Types.SidebarOnDemand
0918                              && latteView.visibility.mode !== LatteCore.Types.SidebarAutoHide
0919                     value: latteView.visibility.enableKWinEdges
0920 
0921                     onClicked: {
0922                         latteView.visibility.enableKWinEdges = !latteView.visibility.enableKWinEdges;
0923                     }
0924                 }
0925 
0926                 LatteComponents.CheckBox {
0927                     Layout.maximumWidth: dialog.optionsWidth
0928                     text: i18n("Can be above fullscreen windows")
0929                     tooltip: i18n("BypassWindowManagerHint flag for the window. The view will be above all windows even those set as 'Always On Top'")
0930                     value: latteView.byPassWM
0931 
0932                     onClicked: {
0933                         latteView.byPassWM = !latteView.byPassWM;
0934                     }
0935                 }
0936 
0937                 LatteComponents.CheckBox {
0938                     Layout.maximumWidth: dialog.optionsWidth
0939                     text: i18n("Raise on desktop change")
0940                     value: latteView.visibility.raiseOnDesktop
0941 
0942                     onClicked: {
0943                         latteView.visibility.raiseOnDesktop = !latteView.visibility.raiseOnDesktop;
0944                     }
0945                 }
0946 
0947                 LatteComponents.CheckBox {
0948                     Layout.maximumWidth: dialog.optionsWidth
0949                     text: i18n("Raise on activity change")
0950                     value: latteView.visibility.raiseOnActivity
0951 
0952                     onClicked: {
0953                         latteView.visibility.raiseOnActivity = !latteView.visibility.raiseOnActivity;
0954                     }
0955                 }
0956             }
0957         }
0958         //! END: Adjust
0959 
0960     }
0961 }