1
0
mirror of https://github.com/KDE/latte-dock.git synced 2024-12-28 03:21:38 +03:00

better way to identify applet plasma behavior

--there is a combinantion of settings that enables
plasma original applet behavior.
1. the applet is locked and is not using parabolic effect
2. the zoomfactor === 1 and the user has not activated
title tooltips
This commit is contained in:
Michail Vourlakos 2019-04-04 17:23:17 +03:00
parent 1503dbe247
commit 6d84b6eea2
6 changed files with 20 additions and 18 deletions

View File

@ -42,7 +42,7 @@ function reconsiderAppletIconItem(){
identifyKicker();
} else if (applet.pluginName === "org.kde.plasma.simplemenu") {
identifySimpleMenu();
} else if (applet.pluginName === "org.kde.plasma.userswitcher"&& !root.behaveAsPlasmaPanel && !container.lockZoom) {
} else if (applet.pluginName === "org.kde.plasma.userswitcher"&& !root.behaveAsPlasmaPanel && !container.originalAppletBehavior) {
identifyUserSwitcher();
} else if (applet.pluginName === "org.kde.comexpertise.plasma.kdeconnect.sms") {
identifyKdeConnectSms();
@ -160,7 +160,7 @@ function identifyUserSwitcher() {
for(var i=0; i<level0.length; ++i){
var level1 = level0[i].children;
for(var j=0; j<level1.length; ++j){
if (applet.pluginName === "org.kde.plasma.userswitcher" && !root.behaveAsPlasmaPanel && !container.lockZoom) {
if (applet.pluginName === "org.kde.plasma.userswitcher" && !root.behaveAsPlasmaPanel && !container.originalAppletBehavior) {
if (typeOf(level1[j], "QQuickMouseArea")) {
var level2 = level1[j].children;
for(var k=0; k<level2.length; ++k){

View File

@ -93,6 +93,7 @@ Item {
||((index === layoutsContainer.mainLayout.beginIndex+layoutsContainer.mainLayout.count-2)&&(layoutsContainer.mainLayout.count>2))
||((index === layoutsContainer.endLayout.beginIndex+layoutsContainer.endLayout.count-1)&&(layoutsContainer.endLayout.count>1)))
readonly property bool originalAppletBehavior: (root.zoomFactor === 1 || !canBeHovered && !root.titleTooltips) || lockZoom
readonly property bool isRectangled: communicator.overlayLatteIconIsActive
property int animationTime: appliedDurationTime * (1.2 *units.shortDuration)
@ -472,7 +473,7 @@ Item {
id: appletMouseAreaBottom
anchors.fill: parent
propagateComposedEvents: true
visible: (!appletMouseArea.visible || !appletMouseArea.enabled) && !root.editMode && !lockZoom
visible: (!appletMouseArea.visible || !appletMouseArea.enabled) && !root.editMode && !originalAppletBehavior
property bool pressed: false
@ -634,7 +635,7 @@ Item {
id: appletMouseArea
anchors.fill: parent
enabled: applet && !latteApplet && canBeHovered && !lockZoom && !communicator.parabolicEffectLocked
enabled: applet && !latteApplet && canBeHovered && !originalAppletBehavior && !communicator.parabolicEffectLocked
hoverEnabled: latteApplet ? false : true
propagateComposedEvents: true
@ -642,7 +643,7 @@ Item {
//! only to support springloading for plasma 5.10
//! also on this is based the tooltips behavior by enabling it
//! plasma tooltips are disabled
visible: applet && !appletItem.latteApplet && !lockZoom && !communicator.parabolicEffectLocked
visible: applet && !appletItem.latteApplet && !originalAppletBehavior && !communicator.parabolicEffectLocked
&& canBeHovered && !appletItem.isSeparator
property bool blockWheel: false
@ -654,7 +655,7 @@ Item {
}
onEntered: {
if (containsMouse && !appletItem.lockZoom && !communicator.parabolicEffectLocked && appletItem.canBeHovered){
if (containsMouse && !originalAppletBehavior && !communicator.parabolicEffectLocked && appletItem.canBeHovered){
root.stopCheckRestoreZoomTimer();
}
@ -677,7 +678,7 @@ Item {
layoutsContainer.hoveredIndex = index;
}
if (lockZoom || communicator.parabolicEffectLocked || !canBeHovered) {
if (originalAppletBehavior || communicator.parabolicEffectLocked || !canBeHovered) {
return;
}
@ -710,7 +711,7 @@ Item {
onPositionChanged: {
// if(!pressed){
if (lockZoom || !canBeHovered) {
if (originalAppletBehavior || !canBeHovered) {
mouse.accepted = false;
return;
}

View File

@ -308,7 +308,7 @@ Item{
else if(applet
&& ( applet.Layout.maximumHeight < root.iconSize
|| applet.Layout.preferredHeight > root.iconSize
|| appletItem.lockZoom)
|| appletItem.originalAppletBehavior)
&& root.isVertical
&& !disableScaleWidth
&& !communicator.overlayLatteIconIsActive) {
@ -322,7 +322,7 @@ Item{
} else if (applet.Layout.minimumHeight > root.iconSize){
layoutHeight = applet.Layout.minimumHeight;
} else if ((applet.Layout.preferredHeight > root.iconSize)
|| (appletItem.lockZoom && applet.Layout.preferredHeight > 0 )){
|| (appletItem.originalAppletBehavior && applet.Layout.preferredHeight > 0 )){
layoutHeight = applet.Layout.preferredHeight;
} else{
layoutHeight = root.iconSize;
@ -360,7 +360,7 @@ Item{
else if(applet
&& ( applet.Layout.maximumWidth < root.iconSize
|| applet.Layout.preferredWidth > root.iconSize
|| appletItem.lockZoom)
|| appletItem.originalAppletBehavior)
&& root.isHorizontal
&& !disableScaleHeight
&& !communicator.overlayLatteIconIsActive){
@ -375,7 +375,7 @@ Item{
} else if (applet.Layout.minimumWidth > root.iconSize){
layoutWidth = applet.Layout.minimumWidth;
} else if ((applet.Layout.preferredWidth > root.iconSize)
|| (appletItem.lockZoom && applet.Layout.preferredWidth > 0 )){
|| (appletItem.originalAppletBehavior && applet.Layout.preferredWidth > 0 )){
layoutWidth = applet.Layout.preferredWidth;
} else{
layoutWidth = root.iconSize;
@ -534,7 +534,7 @@ Item{
active: appletItem.applet && !appletColorizer.mustBeShown
&& (((plasmoid.configuration.shadows === 1 /*Locked Applets*/
&& (!appletItem.canBeHovered || (appletItem.lockZoom && (applet.pluginName !== root.plasmoidName))) )
&& (!appletItem.canBeHovered || (appletItem.originalAppletBehavior && (applet.pluginName !== root.plasmoidName))) )
|| (plasmoid.configuration.shadows === 2 /*All Applets*/
&& (applet.pluginName !== root.plasmoidName)))
|| (root.forceTransparentPanel && plasmoid.configuration.shadows>0 && applet.pluginName !== root.plasmoidName)) /*on forced transparent state*/
@ -661,7 +661,7 @@ Item{
function signalUpdateScale(nIndex, nScale, step){
if(appletItem && !appletItem.containsMouse && (appletItem.index === nIndex)){
if ( ((canBeHovered && !lockZoom ) || appletItem.latteApplet)
if ( ((canBeHovered && !appletItem.originalAppletBehavior) || appletItem.latteApplet)
&& (applet && applet.status !== PlasmaCore.Types.HiddenStatus)
//&& (index != currentLayout.hoveredIndex)
){

View File

@ -70,7 +70,7 @@ Item{
// USE CASE: it can be used from applets that want to be adjusted based
// on the parabolic Effect or not
// @since: 0.9
readonly property bool parabolicEffectEnabled: root.parabolicEffectEnabled && !appletItem.lockZoom
readonly property bool parabolicEffectEnabled: root.parabolicEffectEnabled && !appletItem.originalAppletBehavior
// NAME: iconSize
// USAGE: read-only

View File

@ -1161,7 +1161,7 @@ DragDrop.DropArea {
for(var i=0; i<applets.length; ++i){
var applet = applets[i];
if(applet && applet.containsMouse && !applet.lockZoom && applet.canBeHovered){
if(applet && applet.containsMouse && !applet.originalAppletBehavior && applet.canBeHovered){
return true;
}
}
@ -1171,7 +1171,7 @@ DragDrop.DropArea {
for(var i=0; i<applets.length; ++i){
var applet = applets[i];
if(applet && applet.containsMouse && !applet.lockZoom && applet.canBeHovered){
if(applet && applet.containsMouse && !applet.originalAppletBehavior && applet.canBeHovered){
return true;
}
}
@ -1182,7 +1182,7 @@ DragDrop.DropArea {
for(var i=0; i<applets.length; ++i){
var applet = applets[i];
if(applet && applet.containsMouse && !applet.lockZoom && applet.canBeHovered){
if(applet && applet.containsMouse && !applet.originalAppletBehavior && applet.canBeHovered){
return true;
}
}

View File

@ -115,6 +115,7 @@ Grid {
plasmoid.configuration.panelShadows = true;
plasmoid.configuration.shadows = 0;
plasmoid.configuration.zoomLevel = 0;
plasmoid.configuration.titleTooltips = false;
plasmoid.configuration.activeIndicator = Latte.Types.NoneIndicator;
//plasmoid.configuration.autoDecreaseIconSize = false;