Python Forum
[PyQt] How is this tray icon throbber done?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[PyQt] How is this tray icon throbber done?
#1
I writing a tray widget/notifier for Manjaro KDE and i would like to use this tray icon throbber effect. Anyone know how? (using PyQt5)

   
Reply
#2
The way I would do it is to have two icons identical size, with the two views of the throbbed icon.
Use a timer event (not sleep) to toggle the icon change on each iteration.
Reply
#3
Yea that was what i thought, or maybe (if its even possible) use a .gif but there seems to be some method to do it because you can set any icon you like in the settings of the example i have shown and it still applies the throbbing effect to it even though its a single icon, so there is something somewhere other than messing with multiple icons and looping them on a timer type thing.
Reply
#4
a .gif .ico or .png will do, just don't make it too large or it will have strange flicker effect.
Reply
#5
I'll have to try and dig through the octopi-notifier-frameworks code and see how he's done it because he is not using multiple icons, as i say there must be a proper method to do it because you can change the icon and it still applies the throb.

Hate digging through someone else's code, especially when its Cpp ^^
Reply
#6
well i suspect its got something to do with these snipets of code iv found but i have not a clue what to make of them when talking about pyqt5

from octopi-notifier code Wrote:#ifdef KSTATUS
m_systemTrayIcon->setAttentionIconByPixmap(m_icon);
m_systemTrayIcon->setStatus(KStatusNotifierItem::NeedsAttention);
#endif

https://api.kde.org/frameworks/knotifica...e1fe2ff539

Quote:enum KStatusNotifierItem::ItemStatus

All the possible status this icon can have, depending on the importance of the events that happens in the parent application.
Enumerator

Passive
Nothing is happening in the application, so showing this icon is not required.

Active
The application is doing something, or it is important that the icon is always reachable from the user.

NeedsAttention
The application requests the attention of the user, for instance battery running out or a new IM message was received.


So to me it looks like in Cpp there is a KStatusNotifierItem::NeedsAttention Enumerator that i believe might be doing the work of throbbing the icon but after that im lost how to impliment that info into python
Reply
#7
found this: https://pypi.python.org/pypi/eea.icons/2.5
Reply
#8
great stuff, that I can understand and will take a good bash at using, Thank you :)
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Exclamation [PyQt] Setting icon on QAction from outside QGuiApplication gradlon93 3 1,677 Jan-04-2023, 11:37 AM
Last Post: gradlon93
  PyQt6 QAction with icon and string malonn 2 1,617 Sep-12-2022, 11:59 AM
Last Post: malonn
  how to remove icon ilyess68ysl 4 3,581 Oct-15-2021, 10:05 AM
Last Post: ilyess68ysl
  Icon in tkinter menator01 8 4,843 May-03-2020, 02:01 PM
Last Post: wuf
  Python + GTK + AppIndicator3 tray submenu Icon nodefive 5 4,781 Dec-03-2019, 01:23 PM
Last Post: Axel_Erfurt
  [Tkinter] Password Reveal Icon Evil_Patrick 2 4,586 Nov-29-2019, 02:20 PM
Last Post: Evil_Patrick
  [Tkinter] Window Icon Evil_Patrick 6 7,978 Oct-18-2019, 11:26 AM
Last Post: Evil_Patrick
  Button with Image Icon Friend 2 6,766 Jul-25-2019, 09:39 AM
Last Post: Friend
  [PyQt] Hide Dock Icon for QSystemTrayIcon App AeglosGreeenleaf 0 3,264 Jun-20-2019, 07:21 PM
Last Post: AeglosGreeenleaf
  Please advice Linux library - tray icon, popup windows, ICQ/Skype style etc ramendik 5 3,989 Dec-03-2017, 04:35 AM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020