Skip to content

Gtk: How to remove padding around LinkButton #2455

Discussion options

You must be logged in to vote

In case someone has this same problem, I managed to remove the padding around the buttons (not 100% perfect but enough for me) by adding a custom LinkButtonHandler:

I basically copied the exisiting handler in Eto and changed the constructor to apply Css styling on the button (I renamed it to GtkLinkButtonHandler because I had some issues with namespaces):

public GtkLinkButtonHandler()
{
  var provider = new Gtk.CssProvider();
  Gtk.StyleContext.AddProviderForScreen(Gdk.Screen.Default, provider, uint.MaxValue);          
  provider.LoadFromData("#linkButton {padding: 0;}");			
  Control = new Gtk.LinkButton(string.Empty);
  (Control as Gtk.LinkButton).Name = "linkButton";
  Control.Xalign…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by borjafdezgauna
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant