mirror of
https://github.com/KDE/latte-dock.git
synced 2024-12-26 11:21:40 +03:00
containment more simplifications for indicators
This commit is contained in:
parent
41e796c7a5
commit
3e2c59b5bb
@ -30,9 +30,10 @@ import org.kde.kquickcontrolsaddons 2.0
|
|||||||
import org.kde.latte.core 0.2 as LatteCore
|
import org.kde.latte.core 0.2 as LatteCore
|
||||||
import org.kde.latte.components 1.0 as LatteComponents
|
import org.kde.latte.components 1.0 as LatteComponents
|
||||||
|
|
||||||
|
import org.kde.latte.abilities.items 0.1 as AbilityItem
|
||||||
|
|
||||||
import "colorizer" as Colorizer
|
import "colorizer" as Colorizer
|
||||||
import "communicator" as Communicator
|
import "communicator" as Communicator
|
||||||
import "indicator" as Indicator
|
|
||||||
import "../debugger" as Debugger
|
import "../debugger" as Debugger
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
@ -754,8 +755,29 @@ Item {
|
|||||||
width: wrapper.width
|
width: wrapper.width
|
||||||
height: wrapper.height
|
height: wrapper.height
|
||||||
|
|
||||||
Indicator.Bridge{
|
AbilityItem.IndicatorObject {
|
||||||
id: indicatorBridge
|
id: appletIndicatorObj
|
||||||
|
animations: appletItem.animations
|
||||||
|
metrics: appletItem.metrics
|
||||||
|
indicatorsHost: indicators
|
||||||
|
|
||||||
|
isApplet: true
|
||||||
|
|
||||||
|
isActive: appletItem.isActive
|
||||||
|
isHovered: appletItem.containsMouse
|
||||||
|
isSquare: appletItem.isSquare
|
||||||
|
|
||||||
|
hasActive: isActive
|
||||||
|
|
||||||
|
scaleFactor: appletItem.wrapper.zoomScale
|
||||||
|
panelOpacity: root.background.currentOpacity
|
||||||
|
shadowColor: root.appShadowColorSolid
|
||||||
|
|
||||||
|
palette: colorizerManager.applyTheme
|
||||||
|
|
||||||
|
//!icon colors
|
||||||
|
iconBackgroundColor: isSquare ? appletItem.wrapper.overlayIconLoader.backgroundColor : colorizerManager.buttonFocusColor
|
||||||
|
iconGlowColor: isSquare ? appletItem.wrapper.overlayIconLoader.glowColor : colorizerManager.focusGlowColor
|
||||||
}
|
}
|
||||||
|
|
||||||
//! InConfigureApplets visual paddings
|
//! InConfigureApplets visual paddings
|
||||||
@ -768,12 +790,12 @@ Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//! Indicator Back Layer
|
//! Indicator Back Layer
|
||||||
Indicator.IndicatorLevel{
|
IndicatorLevel{
|
||||||
id: indicatorBackLayer
|
id: indicatorBackLayer
|
||||||
visualParent: appletItem
|
visualParent: appletItem
|
||||||
indicatorsHost: indicators
|
indicatorsHost: indicators
|
||||||
level.isBackground: true
|
level.isBackground: true
|
||||||
level.bridge: indicatorBridge
|
level.bridge: appletIndicatorObj
|
||||||
|
|
||||||
Loader{
|
Loader{
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
@ -817,12 +839,12 @@ Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//! Indicator Front Layer
|
//! Indicator Front Layer
|
||||||
Indicator.IndicatorLevel{
|
IndicatorLevel{
|
||||||
id: indicatorFrontLayer
|
id: indicatorFrontLayer
|
||||||
visualParent: appletItem
|
visualParent: appletItem
|
||||||
indicatorsHost: indicators
|
indicatorsHost: indicators
|
||||||
level.isForeground: true
|
level.isForeground: true
|
||||||
level.bridge: indicatorBridge
|
level.bridge: appletIndicatorObj
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Applet Shortcut Visual Badge
|
//! Applet Shortcut Visual Badge
|
||||||
|
@ -1,47 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2019 Michail Vourlakos <mvourlakos@gmail.com>
|
|
||||||
*
|
|
||||||
* 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 <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import QtQuick 2.7
|
|
||||||
|
|
||||||
import org.kde.latte.abilities.items 0.1 as AbilityItem
|
|
||||||
|
|
||||||
AbilityItem.IndicatorObject{
|
|
||||||
id: indicatorBridge
|
|
||||||
animations: appletItem.animations
|
|
||||||
metrics: appletItem.metrics
|
|
||||||
indicatorsHost: indicators
|
|
||||||
|
|
||||||
isApplet: true
|
|
||||||
|
|
||||||
isActive: appletItem.isActive
|
|
||||||
isHovered: appletItem.containsMouse
|
|
||||||
isSquare: appletItem.isSquare
|
|
||||||
|
|
||||||
hasActive: isActive
|
|
||||||
|
|
||||||
scaleFactor: appletItem.wrapper.zoomScale
|
|
||||||
panelOpacity: root.background.currentOpacity
|
|
||||||
shadowColor: root.appShadowColorSolid
|
|
||||||
|
|
||||||
palette: colorizerManager.applyTheme
|
|
||||||
|
|
||||||
//!icon colors
|
|
||||||
iconBackgroundColor: isSquare ? appletItem.wrapper.overlayIconLoader.backgroundColor : colorizerManager.buttonFocusColor
|
|
||||||
iconGlowColor: isSquare ? appletItem.wrapper.overlayIconLoader.glowColor : colorizerManager.focusGlowColor
|
|
||||||
}
|
|
@ -1,47 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2019 Michail Vourlakos <mvourlakos@gmail.com>
|
|
||||||
*
|
|
||||||
* 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 <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import QtQuick 2.7
|
|
||||||
|
|
||||||
Item {
|
|
||||||
id: level
|
|
||||||
|
|
||||||
signal mousePressed(int x, int y, int button);
|
|
||||||
signal mouseReleased(int x, int y, int button);
|
|
||||||
|
|
||||||
property bool isBackground: true
|
|
||||||
property bool isForeground: false
|
|
||||||
|
|
||||||
property bool isDrawn: false
|
|
||||||
|
|
||||||
readonly property Item requested: Item{
|
|
||||||
property int iconOffsetX: 0
|
|
||||||
property int iconOffsetY: 0
|
|
||||||
}
|
|
||||||
|
|
||||||
property Item bridge
|
|
||||||
|
|
||||||
onIsBackgroundChanged: {
|
|
||||||
isForeground = !isBackground;
|
|
||||||
}
|
|
||||||
|
|
||||||
onIsForegroundChanged: {
|
|
||||||
isBackground = !isForeground;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,77 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2019 Michail Vourlakos <mvourlakos@gmail.com>
|
|
||||||
*
|
|
||||||
* 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 <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import QtQuick 2.7
|
|
||||||
|
|
||||||
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 /*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: metrics.iconSize
|
|
||||||
readonly property int maxIconSize: metrics.maxIconSize
|
|
||||||
readonly property real scaleFactor: 1
|
|
||||||
readonly property real panelOpacity: root.background.currentOpacity
|
|
||||||
readonly property color shadowColor: root.appShadowColorSolid
|
|
||||||
|
|
||||||
readonly property bool animationsEnabled: animations.active
|
|
||||||
readonly property real durationTime: animations.speedFactor.current
|
|
||||||
|
|
||||||
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 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
|
|
||||||
}
|
|
@ -1,41 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2019 Michail Vourlakos <mvourlakos@gmail.com>
|
|
||||||
*
|
|
||||||
* 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 <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import QtQuick 2.7
|
|
||||||
|
|
||||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
|
||||||
|
|
||||||
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);
|
|
||||||
onReleased: level.mouseReleased(mouse.x, mouse.y, mouse.button);
|
|
||||||
}
|
|
||||||
}
|
|
@ -34,7 +34,7 @@ Item {
|
|||||||
property int iconOffsetY: 0
|
property int iconOffsetY: 0
|
||||||
}
|
}
|
||||||
|
|
||||||
property Item bridge
|
property Item bridge: null
|
||||||
|
|
||||||
onIsBackgroundChanged: {
|
onIsBackgroundChanged: {
|
||||||
isForeground = !isBackground;
|
isForeground = !isBackground;
|
||||||
|
Loading…
Reference in New Issue
Block a user