2019-08-09 11:39:37 +00:00
|
|
|
/*
|
|
|
|
|
* Copyright 2019 Marco Martin <mart@kde.org>
|
|
|
|
|
*
|
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
|
* (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
import QtQuick 2.4
|
|
|
|
|
import QtQuick.Layouts 1.1
|
|
|
|
|
import QtQuick.Controls 2.3 as Controls
|
|
|
|
|
|
|
|
|
|
import org.kde.plasma.plasmoid 2.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
|
|
|
|
|
|
|
|
|
|
|
2019-08-16 13:50:37 +00:00
|
|
|
LauncherContainer {
|
2019-08-09 11:39:37 +00:00
|
|
|
id: root
|
|
|
|
|
|
2021-02-15 10:44:48 +00:00
|
|
|
readonly property int count: flow.width / cellWidth
|
2019-08-15 11:19:16 +00:00
|
|
|
|
2019-08-16 13:50:37 +00:00
|
|
|
flow.flow: Flow.TopToBottom
|
2019-08-15 11:19:16 +00:00
|
|
|
|
2021-02-15 10:44:48 +00:00
|
|
|
visible: flow.children.length > 0 || launcherDragManager.active || dropArea.containsDrag
|
2019-08-09 11:39:37 +00:00
|
|
|
|
2019-09-03 15:52:45 +00:00
|
|
|
opacity: launcherDragManager.active && plasmoid.nativeInterface.applicationListModel.favoriteCount >= plasmoid.nativeInterface.applicationListModel.maxFavoriteCount ? 0.3 : 1
|
|
|
|
|
|
2021-02-15 10:44:48 +00:00
|
|
|
height: visible ? cellHeight : 0
|
2019-08-22 11:14:28 +00:00
|
|
|
|
2021-02-15 10:44:48 +00:00
|
|
|
frame.implicitWidth: cellWidth * Math.max(1, flow.children.length) + frame.leftPadding + frame.rightPadding
|
2019-09-03 15:52:45 +00:00
|
|
|
|
2020-02-14 15:09:44 +00:00
|
|
|
Behavior on height {
|
|
|
|
|
NumberAnimation {
|
|
|
|
|
duration: units.longDuration
|
|
|
|
|
easing.type: Easing.InOutQuad
|
|
|
|
|
}
|
|
|
|
|
}
|
2019-09-03 15:52:45 +00:00
|
|
|
Behavior on opacity {
|
|
|
|
|
OpacityAnimator {
|
|
|
|
|
duration: units.longDuration * 4
|
|
|
|
|
easing.type: Easing.InOutQuad
|
|
|
|
|
}
|
|
|
|
|
}
|
2019-08-09 11:39:37 +00:00
|
|
|
}
|