nextcloud / desktop

💻 Desktop sync client for Nextcloud
https://nextcloud.com/install/#install-clients
GNU General Public License v2.0
3.02k stars 793 forks source link

Research: widget on Desktop #4298

Closed tobiasKaminsky closed 2 years ago

tobiasKaminsky commented 2 years ago

Similar as https://github.com/nextcloud/files-clients/issues/17 please check if / how widgets on Desktop are possible

claucambra commented 2 years ago

GNOME does not have desktop widgets in the conventional sense, and any thing that we could do with the toolbar would be considered a hack by the desktop development team. I would say a widget is not really possible on this platform

claucambra commented 2 years ago

KDE has "plasmoids", which are mini-applications built with QML (and can carry a C++ payload). These tend to have two representations, full and compact. Full representations are like our desktop client tray, and usualyl provide the user with information that can be interacted with. The compact representation is usually a mini-info display that can be placed on the taskbar and can summon the full representation when clicked on.

IMO making a plasmoid should be fairly straightforward for us considering they are built similarly to most Qt and KDE apps (including ours), even though the documentation around them isn't fantastic

claucambra commented 2 years ago

On the macOS side of things, the good news is that we can probably exchange most of the code with iOS/iPadOS, the bigger question is how these widgets will communicate with the main app. On iOS this will obviously be a lot easier than for the desktop client but we already use a socket API for the Finder extension, we could likely find a way to do something similar for the widget.

As for the UX side of things, macOS widgets are far less interactive than plasmoids and are mainly there to present information.

allexzander commented 2 years ago

Regarding Windows. Back in the day, Windows Vista introduced the "Gadgets" feature that allowed to put something similar to widgets on the desktop. Those gadgets could display the weather, time, exchange rates, etc. I don't remember if there were ways to add custom gadgets. The feature existed in Windows 7 too. Starting from Windows 8, the "Gadgets" feature is gone. So, Windows 10 does not have anything like this available natively. There is third-party software that allows adding widgets(gadgets) to Windows 8 and Windows 10 desktops as well as to Windows 11, but, those are just packs of widgets and don't allow customization.

On Windows 11, they've introduced the new "Widgets" menu available by clicking or hovering in the bottom left corner in a place where the "Start" button was previously located. That menu allows adding predefined Windows widgets as well as customizing them. However, it does not allow adding widgets programmatically and, at the moment third-party widgets are not supported. They're claiming to have third-party widgets support on the roadmap, but, those would be apps in the Windows Store and would need to be registered in that store and maintained separately as separate apps. Another downside of these widgets is that they seem to only be added to that widget's menu, not to the desktop.

To summarize, it doesn't seem like there is any native way to add widgets on Windows. If we want them, we need to implement them via QML. In that case, based on the problems that exist with widgets on KDE, Gnome, and macOS, I'd say, it would make sense to implement them crossplatform via QML.