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 694075 - GtkAccelLabel: Don't show "+" if there's no more keys to add
GtkAccelLabel: Don't show "+" if there's no more keys to add
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
unspecified
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2013-02-18 11:01 UTC by Bastien Nocera
Modified: 2013-02-18 17:02 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
GtkAccelLabel: Don't show "+" if there's no more keys to add (2.04 KB, patch)
2013-02-18 11:01 UTC, Bastien Nocera
committed Details | Review

Description Bastien Nocera 2013-02-18 11:01:01 UTC
.
Comment 1 Bastien Nocera 2013-02-18 11:01:03 UTC
Created attachment 236574 [details] [review]
GtkAccelLabel: Don't show "+" if there's no more keys to add

With the following code:
 #define INVALID_CHAR GDK_KEY_VoidSymbol - 1
gtk_accelerator_get_label (INVALID_CHAR, GDK_SHIFT_MASK | GDK_CONTROL_MASK);
we would get this label:
Shift+Ctrl+
instead of this label:
Shift+Ctrl
Comment 2 Cosimo Cecchi 2013-02-18 16:57:01 UTC
Review of attachment 236574 [details] [review]:

Looks good with a minor comment.

::: gtk/gtkaccellabel.c
@@ +845,3 @@
 	case ' ':
+          if (seen_mod)
+            g_string_append (gstring, klass->mod_separator);

Can you put this before the switch() statement?
Comment 3 Bastien Nocera 2013-02-18 17:01:58 UTC
Yep, wanted to make sure that we only added the '+' when we really added to the string, but forgot to check that all the cases added something ;)

Attachment 236574 [details] pushed as 3c8a412 - GtkAccelLabel: Don't show "+" if there's no more keys to add