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 586330 - GtkButton ignores user_underline when an image is set
GtkButton ignores user_underline when an image is set
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
2.17.x
Other All
: Normal minor
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2009-06-19 01:07 UTC by Evan Stade
Modified: 2009-06-19 02:13 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Evan Stade 2009-06-19 01:07:46 UTC
Please describe the problem:
When an image is set on a button (using gtk_button_set_image), the button ignores the user_underline setting.

Steps to reproduce:
1. gtk_button_set_image(...)
2. gtk_button_set_label(...)
3. gtk_button_set_use_underline(..., FALSE)


Actual results:
the _ is always treated as a mnemonic specifier

Expected results:
no mnemonics show up in the button label

Does this happen every time?
yes

Other information:
Here is the relevant code in gtk_button_construct_child(), with added commentary and the irrelevant bits elided:

  if (image)
    {
      ...

      if (label_text)
	{
          // doesn't check for use_underline >:(
	  label = gtk_label_new_with_mnemonic (label_text);
	  gtk_label_set_mnemonic_widget (GTK_LABEL (label), 
					 GTK_WIDGET (button));

      ...
	}
      
      ...

      return;  // <--- Early return!
    }
  
  if (button->use_underline)  // <--- This check not reached
    {
       ...
    }
Comment 1 Evan Stade 2009-06-19 01:09:01 UTC
s/user_underline/use_underline
Comment 2 Matthias Clasen 2009-06-19 02:13:26 UTC
Thanks, fixed