Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature request] Show list of outdated apps in panel systray #11

Closed
kinoegit opened this issue Mar 21, 2024 · 12 comments
Closed

[feature request] Show list of outdated apps in panel systray #11

kinoegit opened this issue Mar 21, 2024 · 12 comments

Comments

@kinoegit
Copy link

kinoegit commented Mar 21, 2024

Arch-update-checker displays a list of outdated apps when pressed, but only as a applet on the desktop.
Maybe I'm missing something but this feature doesn't seem to work in the panel systray.
Screencast_20240321_092332.webm
Apdatifier and Arch-update-counter do the trick. I would like Arch-update-checker to have that feature because i prefer it due to flatpak update option

@dhruv8sh
Copy link
Owner

It is supposed to work but due to my really busy schedule I am only able to give 30 mins per week to each of my projects.
I will try my best to get it to work in the next 24 hrs alongside the notification feature.

@kinoegit
Copy link
Author

Thank you anyway

@dhruv8sh
Copy link
Owner

dhruv8sh commented Mar 23, 2024

This probably is a bug in the plasmashell/systray itself.
I have tried all possible workarounds and it just doesn't seem to work.
Look at this.

Edit: I copied the battery widget, slightly changed the code which has nothing to do with expanding the applet. Even this caused the same behavior.

@kinoegit
Copy link
Author

You lost me there. Bear with me and sorry for my ignorance but I can't reproduce that bug and how is it relevant here?
Did you have a look at the code of the above mentioned apdatifier and arch-update-counter? How do they open a popup list of outdated apps?

@dhruv8sh
Copy link
Owner

Ok, I'll give you some context... The expanded property dictates if the popup is opened or not.
Here's how 'Adaptifier' handles this:

MouseArea {
    id: mouseArea
    anchors.fill: parent
    acceptedButtons: cfg.rightClick ? Qt.AllButtons : Qt.LeftButton | Qt.MiddleButton
    hoverEnabled: true
    property bool wasExpanded: false
    onPressed: wasExpanded = expanded
    onClicked: (mouse) => {
        if (mouse.button == Qt.LeftButton) expanded = !wasExpanded
        if (mouse.button == Qt.MiddleButton && cfg.middleClick) JS[cfg.middleClick]()
        if (mouse.button == Qt.RightButton && cfg.rightClick) JS[cfg.rightClick]()
    }
    onEntered: {
        lastCheck = JS.getLastCheck()
    }
}

Here's mine:

MouseArea {
    id: mouseArea
    property bool wasExpanded: false
    acceptedButtons: Qt.LeftButton | Qt.MiddleButton
    anchors.fill: parent
    hoverEnabled: true
    onPressed: wasExpanded = expanded
    onClicked: mouse => {
        if (mouse.button == Qt.MiddleButton) packageManager.action_updateSystem()
        else {
            expanded = !wasExpanded;
            if( expanded && plasmoid.configuration.updateOnExpand && main.hasUserSeen )
                packageManager.action_checkForUpdates();
            main.hasUserSeen = true
        }
    }
 }

There is no inherent difference. If it were to be a problem with this applet, it wouldn't open outside the system tray either.
I would have to specifically define the behavior for it to not open in the tray.

Also, the linked bug is reproducible for me.

@kinoegit
Copy link
Author

kinoegit commented Mar 23, 2024

Thank you for taking the time!
Maybe thats the relevant code of arch-update-counter:

 MouseArea {
      anchors.fill: container // cover all the zone
      cursorShape: Qt.PointingHandCursor // give user feedback
      acceptedButtons: Qt.LeftButton | Qt.MiddleButton
      onClicked: (mouse) => {
        if (invertMouseAction) {
          if (mouse.button == Qt.MiddleButton) {
            mainIsRefresh ? onLClick() : main.expanded = !main.expanded
          }
          if (mouse.button == Qt.LeftButton) onMClick()
        } else {
          if (mouse.button == Qt.LeftButton) {
            mainIsRefresh ? onLClick() : main.expanded = !main.expanded
          }
          if (mouse.button == Qt.MiddleButton) onMClick()
        }
      }
    }
  }
}

@dhruv8sh
Copy link
Owner

You see it does the exact same thing, it's the same for any other applet as well.
(main.expanded is expanded). Also, implementing the same does nothing either.
Maybe I am missing something that all the other applets are doing, but I just cannot seem to find it. But I also am really sure this is a problem with the system tray.

@kinoegit
Copy link
Author

I can't help either for I'm a professional layman concerning coding;) but it looks like the other update applets have got a clue thats to find out.

@dhruv8sh
Copy link
Owner

Okay, so this was fixed.
The fix was to remove preferredRepresentation property from main.qml.
This property dictates whether the applet should be in its expanded or compact form when it's not in a panel.
This of course is a bug(as I suspected) and will be reported in the KDE bug-tracking system.
Thanks for using the applet.

@kinoegit
Copy link
Author

Looking forward to have that feature in your very helpful plasmoid. Thank you Dhruvesh- keep up your good work.

@kinoegit
Copy link
Author

Sorry for bothering: am I missing something or didn't you released the new version yet?

@dhruv8sh
Copy link
Owner

Hello @kinoegit , I had to make a few changes before pushing the update. It has now been uploaded, enjoy!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants