fix coloring in some badges

--a faulty check was using backgroundColor instead of
textColor for badges shown from global shortcuts indicators
--improve badges to understand the new url form of
plasma 5.11 launchers
v0.7
Michail Vourlakos 7 years ago
parent ff2870952e
commit 8ecef66d5d

@ -1313,10 +1313,11 @@ Item {
function getBadger(identifier) {
var ident1 = identifier;
var n = ident1.lastIndexOf('/');
var result = n>=0 ? ident1.substring(n + 1) : identifier;
for(var i=0; i<badgers.length; ++i) {
if (badgers[i].id === result) {
if (result.indexOf(badgers[i].id) >= 0) {
return badgers[i];
}
}

@ -53,9 +53,9 @@ Rectangle {
border.color: root.minimizedDotColor //alphaBackColor2
onProportionChanged: {
// console.log(previousProportion + " - "+proportion);
// console.log(previousProportion + " - "+proportion);
if ((proportion - 0.03 >= previousProportion) || (proportion===1)) {
// console.log("request repaint...");
// console.log("request repaint...");
previousProportion = proportion;
repaint();
}
@ -110,23 +110,25 @@ Rectangle {
text: numberValue > 0 ? numberValue : ""
font.pixelSize: 0.6 * parent.height
font.bold: true
color: (( (mainItemContainer.badgeIndicator > 0)
|| (centralItem.smartLauncherItem.countVisible && !centralItem.smartLauncherItem.progressVisible) ))
&& proportion>0 ? theme.backgroundColor : theme.textColor
color: useBackgroundColor ? theme.backgroundColor : theme.textColor
visible: showNumber
property bool useBackgroundColor: ( (mainItemContainer.badgeIndicator > 0)
|| (centralItem.smartLauncherItem.countVisible && !centralItem.smartLauncherItem.progressVisible) )
&& proportion>0
}
Rectangle{
anchors.fill: parent
anchors.topMargin: parent.border.width
anchors.bottomMargin: parent.border.width
anchors.leftMargin: parent.border.width
anchors.rightMargin: parent.border.width
color: "transparent"
border.width: parent.border.width
border.color: parent.alphaBackColor2
radius: parent.radius
anchors.fill: parent
anchors.topMargin: parent.border.width
anchors.bottomMargin: parent.border.width
anchors.leftMargin: parent.border.width
anchors.rightMargin: parent.border.width
color: "transparent"
border.width: parent.border.width
border.color: parent.alphaBackColor2
radius: parent.radius
}
Rectangle{

@ -527,15 +527,7 @@ MouseArea{
checkWindowsStates();
}
onLauncherUrlChanged: {
var badger = root.getBadger(launcherUrl);
if (badger && !isLauncher) {
badgeIndicator = parseInt(badger.value);
} else {
badgeIndicator = 0;
}
}
onLauncherUrlChanged: updateBadge();
////// End of Values Changes /////
@ -1175,6 +1167,16 @@ MouseArea{
mainItemContainer.audioStreams.forEach(function (item) { item.decreaseVolume(); });
}
function updateBadge() {
var badger = root.getBadger(launcherUrl);
if (badger && !isLauncher) {
badgeIndicator = parseInt(badger.value);
} else {
badgeIndicator = 0;
}
}
Connections {
target: pulseAudio.item
ignoreUnknownSignals: true // Plasma-PA might not be available
@ -1188,7 +1190,6 @@ MouseArea{
onDragSourceChanged: mainItemContainer.updateAudioStreams()
}
///REMOVE
//fix wrong positioning of launchers....
onActivityChanged:{

Loading…
Cancel
Save