changeset 6:49307b998555

Re #23: Add easy creation of "tab with close" * Fix spacing to make tab smaller (ugly hack that involves making GTK parse gtkrc properties)
author IBBoard <dev@ibboard.co.uk>
date Wed, 22 Jul 2009 20:58:19 +0000
parents 51b4bbca7c19
children d92d11bd4808
files NotebookUtil.cs
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/NotebookUtil.cs	Thu Jun 25 20:04:21 2009 +0000
+++ b/NotebookUtil.cs	Wed Jul 22 20:58:19 2009 +0000
@@ -30,9 +30,15 @@
 			HBox hbox = new HBox();
 			hbox.PackStart(new Label(title));			
 			Button close = new Button();
-			close.Image = Image.NewFromIconName("gtk-close", IconSize.Menu);
+			Gtk.Rc.ParseString ("style \"NotebookTab.CloseButton\" {\n GtkButton::inner-border = {0,0,0,0}\n }\n");
+			Gtk.Rc.ParseString ("widget \"*.NotebookTab.CloseButton\" style  \"NotebookTab.CloseButton\"\n");
+			Image icon = Image.NewFromIconName("gtk-close", IconSize.Menu);
+			icon.SetPadding(0, 0);
+			close.Image = icon;
 			close.Relief = ReliefStyle.None;
 			close.FocusOnClick = false;
+			close.BorderWidth = 0;
+			close.Name = "NotebookTab.CloseButton";			
 			close.Clicked += delegate {
 			    hbox.Destroy();
 			    page.Destroy();