After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 642688 - [PATCH] Text of the buttons change, resizes buttons
[PATCH] Text of the buttons change, resizes buttons
Status: RESOLVED FIXED
Product: NetworkManager
Classification: Platform
Component: nm-applet
git master
Other Linux
: Normal normal
: ---
Assigned To: Dan Williams
NetworkManager maintainer(s)
: 671143 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2011-02-18 16:28 UTC by Olivier Tilloy
Modified: 2014-04-25 17:00 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch against git master (2.68 KB, patch)
2011-02-18 16:34 UTC, Olivier Tilloy
none Details | Review
connection-editor: don't ellipsize unauthenticated CEPolkitButtons (5.49 KB, patch)
2014-01-03 20:53 UTC, Dan Winship
accepted-commit_now Details | Review

Description Olivier Tilloy 2011-02-18 16:28:11 UTC
(bug originally reported in launchpad at https://bugs.launchpad.net/network-manager-applet/+bug/721303)

The text of some buttons in the UI of nm-connection-editor changes based on whether the action requires authentication via policyKit. This includes the "Edit" and "Delete" buttons, and the "Save" button in the connection editor dialog. Whenever authentication is required, their text is appended an ellipsis ("..."). This results in an ugly visual effect: the button is resized to fit the text, and this affects the layout of the window.

I’m not sure why this was designed like this in the first place, but to me the additional ellipsis doesn’t convey any useful information that authentication is required. The stock icon, if displayed, plays this role well already.
Comment 1 Olivier Tilloy 2011-02-18 16:34:29 UTC
Created attachment 181231 [details] [review]
patch against git master

This patch applies against git master. It simply removes the ellipsis that were appended to the text of the buttons when their actions required authentication.
Note that the translation templates need to be updated (but the patch doesn’t introduce new strings).
Comment 2 Dan Williams 2011-02-21 21:39:49 UTC
Ellipses are a standard way to indicate "more action required when choosing this", which in the case of PolicyKit authentication is actually the case.  It's a pretty standard usage of ellipses in many operating systems; same reason "Open File..." or "Open Location..." in Firefox has them, since selecting that item will result in another dialog that requires further input.  They were added to conform to general user interface guidelines, and because PolicyKit examples used them as well.

The stock icon doesn't really indicate that further action is required, or that that action might be authentication.  I think the reason I don't ever see this is that by default these days GNOME has disabled icons in menus and in buttons, so the text in my buttons has enough room since the icon is not there.

Maybe we should just remove the stock icons instead?  I don't really have a huge problem with either approach.  But these were some of the reasons behind why the ellipses are there.
Comment 3 Dan Williams 2011-02-21 21:41:43 UTC
On the other hand removing stock icons is going to make it look out of place for those people that choose to re-enable icons in menus & buttons.
Comment 4 Olivier Tilloy 2011-02-21 22:15:24 UTC
Thank you for the detailed explanation on the rationale behind those ellipses. That sounds like a valid solution to indicate that an extra step (authentication) is required.

However, with or without stock icons, the original issue persists: I’m running a stock ubuntu maverick (network-manager-gnome 0.8.1+git.20100809t190028.290dc70-0ubuntu3), the stock icons are not displayed by default, yet the size of the buttons changes when e.g. a connection that requires authentication to edit is selected.

If I decrease the size of the default font for applications in gnome-appearance-properties, the issue goes away. I don’t know what the default font family and size are in stock gnome, but in any case this likely varies with every single distribution so the problem should probably be addressed downstream. We should just make sure the width of the buttons is set to a sensible default.
Comment 5 Dan Williams 2011-02-23 18:04:44 UTC
Sure; what should the default width be in your case?  We can certainly add hints to the UI file to ensure the buttons have a sensible minimum width.
Comment 6 Olivier Tilloy 2011-02-24 08:36:03 UTC
Ah, I just realized it’s not just a matter of default font family and size, it also depends on the user’s language preferences… My desktop is in French, where "Edit" translates to "Modifier" and "Delete" translates to "Supprimer". Both translations result in wider buttons than their English counterparts.
And indeed, if I run `LANG=C nm-connection-editor`, I can’t observe the issue.

Not sure much can be done about it, as it’s going to be different for every single language, and I’m pretty sure some are even more verbose than French.

For what it’s worth, on my desktop the original width of the buttons in nm-connection-editor is 82 pixels (regardless of the language), and selecting a connection that requires authentication to be edited expands them to 89 pixels when in French.
Comment 7 Mathieu Trudel-Lapierre 2011-03-11 17:45:37 UTC
Would it make sense to instead default to having ellipses for all of them at all times since Add, Modify and Delete (as well as Import, Export, etc) all require more steps? (Even delete actually asks for confirmation)
Comment 8 Olivier Tilloy 2011-03-11 17:53:13 UTC
I suppose it would make sense, and it would definitely solve the issue of buttons getting resized and affecting the whole layout of the window.
Comment 9 Tobias Mueller 2011-07-02 11:55:53 UTC
I think input on this issue has been provided. Hence reopening.
Comment 10 Dan Winship 2014-01-02 15:44:13 UTC
Assuming we want to keep the ellipses/no ellipses distinction, the easiest way to fix this would be to replace the button label with a borderless, tabless GtkNotebook, containing two pages, one with each label, and then switch between the two pages rather than changing the label. Then it would always have the same width.

Since gtk never displays stock button images any more, we could just drop the icons entirely, so the code doesn't need to deal with both icon and label.
Comment 11 Dan Winship 2014-01-02 15:45:53 UTC
*** Bug 671143 has been marked as a duplicate of this bug. ***
Comment 12 Dan Winship 2014-01-02 15:46:46 UTC
671143 has further discussion of ellipses and button labels (some of which is not completely correct given the policykit/non-policykit stuff), which should be dealt with at the same time as this
Comment 13 Gregory Merchan 2014-01-02 17:47:40 UTC
Authentication data is perhaps never the kind of "additional information" to which the 2.x HIG refers; it is more akin to a confirmation step. A command like "Open . . ." is incomplete--open what?--hence the ellipsis is required. "Do this fully specified thing, which happens to require authentication" is a complete command, so it should not have ellipsis.

Consider some related examples:

The Edit menu "Cut" command also requires additional information, a selection, but, rather than giving it an ellipsis and using who-knows-what to indicate a selection is needed, the command is only enabled when there is already a selection made. Similarly, while the "Open . . ." command on the File menu requires additional information, the "Open" command in the "Open . . ." dialog is only enabled once the user has selected the file which is to be opened.

A "Delete" command meant to delete a selected item should also be enabled or disabled according to whether an item is selected. Since the question "Delete what?" is already answered by the selection, there should be no ellipsis even if there will be an alert asking the user to confirm the action.

If the additional information can be provided by selection, enable or disable the command. If a dialog will be needed to allow selection, use ellipsis.
Comment 14 Dan Winship 2014-01-03 20:53:18 UTC
Created attachment 265252 [details] [review]
connection-editor: don't ellipsize unauthenticated CEPolkitButtons

Having CEPolkitButtons be sometimes ellipsized and sometimes not
causes the window width to change under some localizations.

After some discussion, it was decided that having to deal with an
authentication dialog does not really constitute the kind of
"additional input" that ellipses are meant to indicate, so just remove
them.
Comment 15 Dan Williams 2014-04-25 14:56:44 UTC
Review of attachment 265252 [details] [review]:

Works for me.  Patch looks good.