changeset 13:245677d0d47e

Re #26: Add GTK wrapper methods * Compact tabs in a notebook even more
author IBBoard <dev@ibboard.co.uk>
date Sat, 14 Aug 2010 19:37:49 +0000
parents ffda5e5f1617
children 0a466c011016
files NotebookUtil.cs
diffstat 1 files changed, 6 insertions(+), 5 deletions(-) [+]
line diff
     1.1 --- a/NotebookUtil.cs	Tue Aug 10 19:46:43 2010 +0000
     1.2 +++ b/NotebookUtil.cs	Sat Aug 14 19:37:49 2010 +0000
     1.3 @@ -45,22 +45,23 @@
     1.4  		/// <returns>
     1.5  		/// A <see cref="Widget"/> that can be used as a tab label that contains the label with the title text and a close button
     1.6  		/// </returns>
     1.7 -		public static Widget CreateNotebookTabLabelWithClose(Notebook notebook, Widget page,String title)
     1.8 +		public static Widget CreateNotebookTabLabelWithClose(Notebook notebook, Widget page, String title)
     1.9  		{
    1.10  			HBox hbox = new HBox();
    1.11 -			hbox.PackStart(new Label(title));			
    1.12 +			hbox.PackStart(new Label(title));
    1.13  			Button close = new Button();
    1.14 -			Gtk.Rc.ParseString ("style \"NotebookTab.CloseButton\" {\n GtkButton::inner-border = {0,0,0,0}\n }\n");
    1.15 -			Gtk.Rc.ParseString ("widget \"*.NotebookTab.CloseButton\" style  \"NotebookTab.CloseButton\"\n");
    1.16 +			Gtk.Rc.ParseString("style \"NotebookTab.CloseButton\" {\n GtkWidget::focus-padding = 0\n GtkWidget::focus-line-width = 0\n xthickness = 0\n ythickness = 0\n GtkButton::inner-border = {0,0,0,0}\n }\n");
    1.17 +			Gtk.Rc.ParseString("widget \"*.NotebookTab.CloseButton\" style  \"NotebookTab.CloseButton\"\n");
    1.18  			Image icon = Image.NewFromIconName("gtk-close", IconSize.Menu);
    1.19  			icon.SetPadding(0, 0);
    1.20  			close.Image = icon;
    1.21  			close.Relief = ReliefStyle.None;
    1.22  			close.FocusOnClick = false;
    1.23  			close.BorderWidth = 0;
    1.24 -			close.Name = "NotebookTab.CloseButton";			
    1.25 +			close.Name = "NotebookTab.CloseButton";
    1.26  			close.Clicked += delegate {
    1.27  				notebook.Remove(page);
    1.28 +				page.Dispose();
    1.29  			};
    1.30  			hbox.PackStart(close);			
    1.31  			hbox.ShowAll();