Bug 271491 - networkmanager plasma applet from git: wrong list entry size (too small)
Summary: networkmanager plasma applet from git: wrong list entry size (too small)
Status: RESOLVED FIXED
Alias: None
Product: knetworkmanager
Classification: Miscellaneous
Component: general (show other bugs)
Version: unspecified
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: Will Stephenson
URL:
Keywords:
: 242433 272147 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-04-22 16:16 UTC by Christian (Fuchs)
Modified: 2011-07-18 21:54 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In: nm09


Attachments
Screenshot of the problem (333.45 KB, image/png)
2011-04-23 11:56 UTC, Christian (Fuchs)
Details
Fix connection layout (3.00 KB, patch)
2011-04-23 23:20 UTC, Lamarque V. Souza
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Christian (Fuchs) 2011-04-22 16:16:07 UTC
Version:           unspecified (using KDE 4.6.2) 
OS:                Linux

The height of the connection entries is too small here, the items are mangled into each other and the overlay on mouse over is too small. 

Fixed by changing 

activatableitem.cpp:    rowHeight(24),

to

activatableitem.cpp:    rowHeight(32),



Reproducible: Always

Steps to Reproduce:
Get networkmanager from current git, use with air plasma theme. Open the applet by clicking on the systray icon

Actual Results:  
Connection entries (WLAN Networks, VPN Connections ...) are too small 

Expected Results:  
Connection entries have the correct size (not mangled in each other, same size as the overlay) 

It might be that for other configurations  (plasma theme, icon theme, font size) this does not apply. Maybe a dynamic solution is needed? 

Otherwhise: the above mentioned change fixes it.
Comment 1 Lamarque V. Souza 2011-04-23 06:33:06 UTC
Please send me a screenshot.
Comment 2 Christian (Fuchs) 2011-04-23 11:56:06 UTC
Created attachment 59244 [details]
Screenshot of the problem

Left is good, right the icons are too small (look at the mouse over)

Even though with the right one (which is current git without modifications) there are more items shown without the need to scroll, the mouse over looks too small and the icons are just next to each other, also making it harder to aim and hit (even with the mouse, touch interfaces are probably way worse). 

Other items affected, such as the strength indicator can be made smaller, currently in the code they are already RowHeight/2, which can be made even smaller if needed. 

Kind regards
Comment 3 Lamarque V. Souza 2011-04-23 23:20:49 UTC
Created attachment 59259 [details]
Fix connection layout

Can you please try the attached patch to see if it fixes your problem?
Comment 4 Lamarque V. Souza 2011-04-24 05:40:10 UTC
Git commit d2f2a447b1e3060c3a5236caaea0bad9c1eb9d47 by Lamarque V. Souza.
Committed on 23/04/2011 at 23:25.
Pushed by lvsouza into branch 'master'.

Try to fix side effects of comit
c05ac96ee4f9fecde5ba5e6c44d062bc3715f476 (Move height setup of all
connection widgets to ActivatedItem constructor. Now all connection
widgets have the same height and do not change it when toggling the
"Show More" button)

CCBUG: 271491
CCBUG: 271353

M  +1    -1    applet/activatableitem.cpp     
M  +1    -1    applet/activatablelistwidget.cpp     
M  +2    -2    applet/gsminterfaceconnectionitem.cpp     
M  +2    -2    applet/wirelessnetworkitem.cpp     

http://commits.kde.org/networkmanagement/d2f2a447b1e3060c3a5236caaea0bad9c1eb9d47
Comment 5 Lamarque V. Souza 2011-04-24 05:41:08 UTC
Git commit d7abc1f1eec401fb1d920c7b864b47e973170122 by Lamarque V. Souza.
Committed on 23/04/2011 at 23:25.
Pushed by lvsouza into branch 'nm09'.

Try to fix side effects of comit
c05ac96ee4f9fecde5ba5e6c44d062bc3715f476 (Move height setup of all
connection widgets to ActivatedItem constructor. Now all connection
widgets have the same height and do not change it when toggling the
"Show More" button)

CCBUG: 271491
CCBUG: 271353
(cherry picked from commit d2f2a447b1e3060c3a5236caaea0bad9c1eb9d47)

M  +1    -1    applet/activatableitem.cpp     
M  +1    -1    applet/activatablelistwidget.cpp     
M  +2    -2    applet/gsminterfaceconnectionitem.cpp     
M  +2    -2    applet/wirelessnetworkitem.cpp     

http://commits.kde.org/networkmanagement/d7abc1f1eec401fb1d920c7b864b47e973170122
Comment 6 Christian (Fuchs) 2011-04-24 12:29:54 UTC
Hello Lamarque, 

thanks for your good work, some comments regarding your patch: 

+ The issue with resizing entries on clicking "show more" is gone
+ The list entries have the same size, however
- 28 px seems a little bit too small, the wireless icon is still a bit bigger than the overlay. 30, or as I did, 32 seems to be a bit better
- It was a bit hard to apply the patch, since the current git does not compile anymore on 4.6.* due to bluetooth changes, which are not in solid yet.

In static member function »static QString UiUtils::interfaceTypeLabel(Solid::Control::NetworkInterface::Type)«:
/var/tmp/portage/kde-misc/knetworkmanager-9999/work/knetworkmanager-9999/libs/internals/uiutils.cpp:51:14: Fehler: »Bluetooth« ist kein Element von »Solid::Control::NetworkInterface«

/var/tmp/portage/kde-misc/knetworkmanager-9999/work/knetworkmanager-9999/libs/internals/uiutils.cpp: In static member function »static QString UiUtils::iconName(Solid::Control::NetworkInterface*)«:
/var/tmp/portage/kde-misc/knetworkmanager-9999/work/knetworkmanager-9999/libs/internals/uiutils.cpp:105:14: Fehler: »Bluetooth« ist kein Element von »Solid::Control::NetworkInterface«


I had to get a tar of d2f2a447b1e3060c3a5236caaea0bad9c1eb9d47 and feed that to portage manually. But it seems that this commit solves the issues. But I still recommend a little bit bigger default size (30 or 32). 

Thanks for your work, kind regards, 

Chrisitian

(I currently leave this as uncofirmed, if you change the size or decide not too, you can set it to fixed. In the latter case I'll just patch it manually to my preferences :) )
Comment 7 Lamarque V. Souza 2011-05-02 02:22:45 UTC
*** Bug 272147 has been marked as a duplicate of this bug. ***
Comment 8 Christoph Feck 2011-05-02 20:36:59 UTC
Please do not use hard coded sizes, but account for font sizes and/or icon sizes.
Comment 9 Lamarque V. Souza 2011-05-02 23:57:19 UTC
Last week I did a test to calculate the height taking into account the font and icon's heights. The Plasma NM interface became a little sluggish to switch between the "Show More" states. I guess it is because there could be several of those items in the plasmoid GUI and each of them are deleted/allocated in each switch. It was not me that implemented it that way, I am just trying to keep things working.

ActivatbleItem is the base class for other four classes. If you know how to add a property to the class (not the allocated object) dynamically (yes, it is a paradox) it would be simple to add the height to all subclasses. For now the only way I know is passing the height at each object allocation, something I wanted to prevent from the begining because some of those four subclasses had different heights, I guess because they were implemented by different people.

I prefer to keep performance and use hardcoded values until I find a better solution, which is going to take time since I am very busy. I am open to suggestions.
Comment 10 Lamarque V. Souza 2011-05-08 20:27:19 UTC
*** Bug 242433 has been marked as a duplicate of this bug. ***
Comment 11 Lamarque V. Souza 2011-07-18 21:54:32 UTC
Git commit 34e6d2a5ae236faa6639ee0ae9385637e240477c by Lamarque V. Souza.
Committed on 18/07/2011 at 23:52.
Pushed by lvsouza into branch 'nm09'.

Calculets connection list height based on default font height. Minimum
height is 28 pixels.

BUG: 271491
FIXED-IN: nm09

M  +1    -1    applet/activatableitem.h
M  +2    -1    applet/activatableitem.cpp

http://commits.kde.org/networkmanagement/34e6d2a5ae236faa6639ee0ae9385637e240477c