Bug 308722 - network manager widget should behave the same in the panel and on the desktop
Summary: network manager widget should behave the same in the panel and on the desktop
Status: RESOLVED FIXED
Alias: None
Product: Network Management
Classification: Miscellaneous
Component: Plasma Widget (show other bugs)
Version: unspecified
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Sebastian Kügler
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-20 17:00 UTC by kabud
Modified: 2012-10-24 16:55 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 0.9.0.6


Attachments
Plasma NM without panel containment workaround (95.28 KB, image/png)
2012-10-24 16:45 UTC, Lamarque V. Souza
Details

Note You need to log in before you can comment on or make changes to this bug.
Description kabud 2012-10-20 17:00:40 UTC
the network manager widget in the panel shows a status icon (wireless connected, connection strenght, or ethernet connected, or wwan, or disconnected), however when i add a system tray widget to the desktop the network manager widget inside shows only as the blue NM icon.

Reproducible: Always

Steps to Reproduce:
1. add widget 'system tray' to the desktop

Actual Results:  
2. observe that the network manager in the system tray shows as blue NM icon


Expected Results:  
2. the network manager in the system tray should display the same icon as network manager in the panel (and network manager inside a system tray in a panel)
Comment 1 Lamarque V. Souza 2012-10-20 23:55:44 UTC
Unfortunately currently there is no way to fix this problem without causing a regression where the plasmoid on the desktop would look like the tray icon. The systray widget is not supposed to be used outside a panel and since this is a rare case I do not think it is worth implementating.
Comment 2 kabud 2012-10-21 14:48:53 UTC
I intended to remove the panel altogether - given plasmas awsomeness of: everything is a widget and can go everywhere - this is almost possible. Only the network status icon can seemingly only be shown in the panel. NM widget on the desktop directly is the folded-out version and NM widget in a systray on the desktop is the blue NM icon.

But, yes it may be a rare case. Thanks for your explanation, though.
Comment 3 Sebastian Kügler 2012-10-24 11:51:30 UTC
Lamarque, I'm not sure I understand: the network manager widget is an ordinary PopupApplet, and surely it can show the representation in the systray also elsewhere. I'm not sure I understand your comment, the reasoning behind it, or the bug itself entirely, since "it should just not happen", however...
Comment 4 Lamarque V. Souza 2012-10-24 11:59:14 UTC
It can, the problem is how to detect if Plasma NM should be shown as an icon or popped up. I am using containment()->containmentType() for that. If it returns Plasma::Containment::PanelContainment or Plasma::Containment::CustomPanelContainment then the Plasma NM will be an icon, if not then it will be shown popped up. Systray widget is not a panel containment, so Plasma NM is shown popped up. If someone change systray widget containment type to Plasma::Containment::PanelContainment then this bug can be fixed.
Comment 5 Sebastian Kügler 2012-10-24 12:59:39 UTC
Ah, that's wrong then. Don't check the containment type, but set a minimum size on the graphicsWidget(), this will take care of collapsing and expanding the widget, without any containment-specific hacks.
Comment 6 Lamarque V. Souza 2012-10-24 16:45:01 UTC
Created attachment 74780 [details]
Plasma NM without panel containment workaround

(In reply to comment #5)
> Ah, that's wrong then. Don't check the containment type, but set a minimum
> size on the graphicsWidget(), this will take care of collapsing and
> expanding the widget, without any containment-specific hacks.

Well, I did that long time ago and I remember at least with problem with it: the popup background is transparent when the applet is not in a panel containment. I have just tested it and it still happens if I remove the check for panel containment (see attached screenshot).
Comment 7 Lamarque V. Souza 2012-10-24 16:47:29 UTC
Hmmm I guess I can let the systray icon be updated even when not in a panel containment. That should fix this bug and do not add a regression about the problem I described above.
Comment 8 Lamarque V. Souza 2012-10-24 16:53:49 UTC
Git commit e276f04f438773361fda03e3dc8f4c125d396431 by Lamarque V. Souza.
Committed on 24/10/2012 at 18:49.
Pushed by lvsouza into branch 'master'.

Update systray icon even when not in a panel containment. This is
usefull when using systray widget outside a panel.
FIXED-IN: 0.9.0.6

M  +0    -1    applet/networkmanager.cpp
M  +1    -1    plasma_nm_version.h

http://commits.kde.org/networkmanagement/e276f04f438773361fda03e3dc8f4c125d396431
Comment 9 Lamarque V. Souza 2012-10-24 16:55:54 UTC
Git commit fde7dc426d59d8981101a5cc2f6cdd794709f3aa by Lamarque V. Souza.
Committed on 24/10/2012 at 18:49.
Pushed by lvsouza into branch 'nm09'.

Update systray icon even when not in a panel containment. This is
usefull when using systray widget outside a panel.
FIXED-IN: 0.9.0.6

M  +0    -1    applet/networkmanager.cpp
M  +1    -1    plasma_nm_version.h

http://commits.kde.org/networkmanagement/fde7dc426d59d8981101a5cc2f6cdd794709f3aa