mirror of
https://github.com/KDE/latte-dock.git
synced 2025-03-20 06:50:28 +03:00
fix #490,improve identification algorithms
--this commits improves the identification algorithm for kicker and simplemenu and their behavior also concerning setting a static image or not
This commit is contained in:
parent
cfca7fadd4
commit
641d096d58
@ -1,8 +1,8 @@
|
||||
|
||||
function typeOf(obj, className){
|
||||
var name = obj.toString();
|
||||
//if (applet.pluginName === "org.kde.plasma.simplemenu") //"set a plugin name to debug"
|
||||
//console.log(name);
|
||||
//if (applet.pluginName === "org.kde.plasma.kicker") //"set a plugin name to debug"
|
||||
// console.log(name);
|
||||
return ((name.indexOf(className + "(") === 0) || (name.indexOf(className + "_QML") === 0));
|
||||
}
|
||||
|
||||
@ -133,13 +133,15 @@ function identifyKicker() {
|
||||
}
|
||||
}
|
||||
|
||||
if (iconIt && iconIt.visible) {
|
||||
if (iconIt) {
|
||||
container.appletIconItem = iconIt;
|
||||
return;
|
||||
} else if (imageIt && imageIt.visible){
|
||||
container.appletIconItem = imageIt;
|
||||
return;
|
||||
}
|
||||
|
||||
if (imageIt){
|
||||
container.appletImageItem = imageIt;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -164,14 +166,14 @@ function identifySimpleMenu() {
|
||||
}
|
||||
}
|
||||
|
||||
if (imageIt && imageIt.visible){
|
||||
container.appletIconItem = imageIt;
|
||||
return;
|
||||
} else if (iconIt && iconIt.visible) {
|
||||
if (iconIt) {
|
||||
container.appletIconItem = iconIt;
|
||||
return;
|
||||
}
|
||||
|
||||
if (imageIt){
|
||||
container.appletImageItem = imageIt;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -105,9 +105,10 @@ Item {
|
||||
((applet.pluginName === root.plasmoidName) ||
|
||||
(applet.pluginName === "org.kde.plasma.systemtray")) ? wrapper : wrapper.wrapperContainer
|
||||
property Item appletIconItem; //first applet's IconItem, to be activated onExit signal
|
||||
property Item appletImageItem;
|
||||
|
||||
//this is used for folderView and icon widgets to fake their visual
|
||||
property bool fakeIconItem: applet && appletIconItem && appletIconItem//(applet.pluginName === "org.kde.plasma.folder" || applet.pluginName === "org.kde.plasma.icon")
|
||||
property bool fakeIconItem: applet && appletIconItem //(applet.pluginName === "org.kde.plasma.folder" || applet.pluginName === "org.kde.plasma.icon")
|
||||
|
||||
property alias containsMouse: appletMouseArea.containsMouse
|
||||
property alias pressed: appletMouseArea.pressed
|
||||
@ -362,19 +363,8 @@ Item {
|
||||
}
|
||||
}
|
||||
|
||||
Connections{
|
||||
target: container.appletIconItem
|
||||
onVisibleChanged: {
|
||||
if (!container.appletIconItem.visible) {
|
||||
container.appletIconItem = null;
|
||||
container.reconsiderAppletIconItem();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
///END connections
|
||||
|
||||
|
||||
PlasmaComponents.BusyIndicator {
|
||||
z: 1000
|
||||
visible: applet && applet.busy
|
||||
|
@ -454,8 +454,12 @@ Item{
|
||||
sourceComponent: Latte.IconItem{
|
||||
id: fakeAppletIconItem
|
||||
anchors.fill: parent
|
||||
source: appletIconItem.source
|
||||
|
||||
source: {
|
||||
if (appletIconItem && appletIconItem.visible)
|
||||
return appletIconItem.source;
|
||||
else if (appletImageItem && appletImageItem.visible)
|
||||
return appletImageItem.source;
|
||||
}
|
||||
//ActiveIndicator{}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user