Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't add a label on RadioToolButton when set icon_widget - Fixes #4875 #239

Merged
merged 1 commit into from Jul 19, 2015

Conversation

godiard
Copy link
Contributor

@godiard godiard commented Jul 8, 2015

When we use set_icon_widget(), GtkToolButton set a private property
contents_invalid = TRUE [1], and gtk_tool_button_construct_content [2]
is called. Then if the label widget not exist, a GtkLabel is added.
This is a problem for us, by example in the Clipboard buttons in the frame.
By adding a empty Gtk.Box instead of a label, we avoid the label creation.

But as this is a internal implementation of Gtk, can change in the future,
in fact the issue is not visible with Gtk < 3.16

This patch is based in a pr sent by Sam Parkinson

[1] https://github.com/GNOME/gtk/blob/master/gtk/gtktoolbutton.c#L1415
[2] https://github.com/GNOME/gtk/blob/master/gtk/gtktoolbutton.c#L357

When we use set_icon_widget(), GtkToolButton set a private property
contents_invalid = TRUE [1], and gtk_tool_button_construct_content [2]
is called. Then if the label widget not exist, a GtkLabel is added.
This is a problem for us, by example in the Clipboard buttons in the frame.
By adding a empty Gtk.Box instead of a label, we avoid the label creation.

But as this is a internal implementation of Gtk, can change in the future,
in fact the issue is not visible with Gtk < 3.16

This patch is based in a pr sent by Sam Parkinson

[1] https://github.com/GNOME/gtk/blob/master/gtk/gtktoolbutton.c#L1415
[2] https://github.com/GNOME/gtk/blob/master/gtk/gtktoolbutton.c#L357
@godiard
Copy link
Contributor Author

godiard commented Jul 8, 2015

This is based on @samdroid-apps pr sugarlabs/sugar#552
but solving the issue in the toolkit is better to avoid the problem in other places.

@samdroid-apps
Copy link
Contributor

Does this effect the buttons that have a label (the ones in toolbar
overflow menus)?

On Thu, 9 Jul 2015 3:29 am Gonzalo Odiard notifications@github.com wrote:

This is based on @samdroid-apps https://github.com/samdroid-apps pr
sugarlabs/sugar#552 sugarlabs/sugar#552
but solving the issue in the toolkit is better to avoid the problem in
other places.


Reply to this email directly or view it on GitHub
#239 (comment)
.

@godiard
Copy link
Contributor Author

godiard commented Jul 9, 2015

@samdroid-apps, only radiotoolbuttons. In what case are you thinking?

@samdroid-apps
Copy link
Contributor

I probably wasn't thinking.

Merged.

@samdroid-apps samdroid-apps merged commit 7a3d23e into sugarlabs:master Jul 19, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants