public Category (Tiles.TileGroupInfo info, int columns) { WidgetFlags |= WidgetFlags.NoWindow; header = new Gtk.HBox (false, 0); headerExpander = new Gtk.Expander ("<big><b>" + GLib.Markup.EscapeText (info.Name) + "</b></big>"); ((Gtk.Label) headerExpander.LabelWidget).SetAlignment (0.0f, 0.5f); headerExpander.UseMarkup = true; headerExpander.UseUnderline = true; headerExpander.Show (); header.PackStart (headerExpander, true, true, 0); headerExpander.Activated += OnActivated; scope = Tiles.Utils.TileGroupToScopeType(info.Group); position = new Gtk.Label (); position.ModifyFg (Gtk.StateType.Normal, position.Style.Base (Gtk.StateType.Selected)); header.PackStart (position, false, false, 0); position.Show (); prev = MakeButton (header, Gtk.Stock.GoBack, OnPrev); next = MakeButton (header, Gtk.Stock.GoForward, OnNext); header.Show (); header.Parent = this; header.SizeRequested += HeaderSizeRequested; tiles = new SortedTileList (Beagle.Search.SortType.Relevance); Columns = columns; UpdateButtons (); Expanded = true; }
public Category(Tiles.TileGroupInfo info, int columns) { WidgetFlags |= WidgetFlags.NoWindow; header = new Gtk.HBox(false, 0); headerExpander = new Gtk.Expander("<big><b>" + GLib.Markup.EscapeText(info.Name) + "</b></big>"); ((Gtk.Label)headerExpander.LabelWidget).SetAlignment(0.0f, 0.5f); headerExpander.UseMarkup = true; headerExpander.UseUnderline = true; headerExpander.Show(); header.PackStart(headerExpander, true, true, 0); headerExpander.Activated += OnActivated; scope = Tiles.Utils.TileGroupToScopeType(info.Group); position = new Gtk.Label(); position.ModifyFg(Gtk.StateType.Normal, position.Style.Base(Gtk.StateType.Selected)); header.PackStart(position, false, false, 0); position.Show(); prev = MakeButton(header, Gtk.Stock.GoBack, OnPrev); next = MakeButton(header, Gtk.Stock.GoForward, OnNext); header.Show(); header.Parent = this; header.SizeRequested += HeaderSizeRequested; tiles = new SortedTileList(Beagle.Search.SortType.Relevance); Columns = columns; UpdateButtons(); Expanded = true; }
// TODO: Possible to make Tomboy not crash if quit while dialog is up? public SyncDialog () : base (string.Empty, null, Gtk.DialogFlags.DestroyWithParent) { progressBarTimeoutId = 0; SetSizeRequest (400, -1); HasSeparator = false; // Outer box. Surrounds all of our content. VBox outerVBox = new VBox (false, 12); outerVBox.BorderWidth = 6; outerVBox.Show (); VBox.PackStart (outerVBox, true, true, 0); // Top image and label HBox hbox = new HBox (false, 12); hbox.Show (); outerVBox.PackStart (hbox, false, false, 0); image = new Image (GuiUtils.GetIcon ("tomboy", 48)); image.Xalign = 0; image.Yalign = 0; image.Show (); hbox.PackStart (image, false, false, 0); // Label header and message VBox vbox = new VBox (false, 6); vbox.Show (); hbox.PackStart (vbox, true, true, 0); headerLabel = new Label (); headerLabel.UseMarkup = true; headerLabel.Xalign = 0; headerLabel.UseUnderline = false; headerLabel.LineWrap = true; headerLabel.Show (); vbox.PackStart (headerLabel, false, false, 0); messageLabel = new Label (); messageLabel.Xalign = 0; messageLabel.UseUnderline = false; messageLabel.LineWrap = true; messageLabel.SetSizeRequest (250, -1); messageLabel.Show (); vbox.PackStart (messageLabel, false, false, 0); progressBar = new Gtk.ProgressBar (); progressBar.Orientation = Gtk.ProgressBarOrientation.LeftToRight; progressBar.BarStyle = ProgressBarStyle.Continuous; progressBar.ActivityBlocks = 30; progressBar.Show (); outerVBox.PackStart (progressBar, false, false, 0); progressLabel = new Label (); progressLabel.UseMarkup = true; progressLabel.Xalign = 0; progressLabel.UseUnderline = false; progressLabel.LineWrap = true; progressLabel.Wrap = true; progressLabel.Show (); outerVBox.PackStart (progressLabel, false, false, 0); // Expander containing TreeView expander = new Gtk.Expander (Catalog.GetString ("Details")); expander.Spacing = 6; expander.Activated += OnExpanderActivated; expander.Show (); outerVBox.PackStart (expander, true, true, 0); // Contents of expander Gtk.VBox expandVBox = new Gtk.VBox (); expandVBox.Show (); expander.Add (expandVBox); // Scrolled window around TreeView Gtk.ScrolledWindow scrolledWindow = new Gtk.ScrolledWindow (); scrolledWindow.ShadowType = Gtk.ShadowType.In; scrolledWindow.SetSizeRequest (-1, 200); scrolledWindow.Show (); expandVBox.PackStart (scrolledWindow, true, true, 0); // Create model for TreeView model = new Gtk.TreeStore (typeof (string), typeof (string)); // Create TreeView, attach model Gtk.TreeView treeView = new Gtk.TreeView (); treeView.Model = model; treeView.RowActivated += OnRowActivated; treeView.Show (); scrolledWindow.Add (treeView); // Set up TreeViewColumns Gtk.TreeViewColumn column = new Gtk.TreeViewColumn ( Catalog.GetString ("Note Title"), new Gtk.CellRendererText (), "text", 0); column.SortColumnId = 0; column.Resizable = true; treeView.AppendColumn (column); column = new Gtk.TreeViewColumn ( Catalog.GetString ("Status"), new Gtk.CellRendererText (), "text", 1); column.SortColumnId = 1; column.Resizable = true; treeView.AppendColumn (column); // Button to close dialog. closeButton = (Gtk.Button) AddButton (Gtk.Stock.Close, Gtk.ResponseType.Close); closeButton.Sensitive = false; }
// TODO: Possible to make Tomboy not crash if quit while dialog is up? public SyncDialog() : base(string.Empty, null, Gtk.DialogFlags.DestroyWithParent) { progressBarTimeoutId = 0; SetSizeRequest(400, -1); HasSeparator = false; // Outer box. Surrounds all of our content. VBox outerVBox = new VBox(false, 12); outerVBox.BorderWidth = 6; outerVBox.Show(); VBox.PackStart(outerVBox, true, true, 0); // Top image and label HBox hbox = new HBox(false, 12); hbox.Show(); outerVBox.PackStart(hbox, false, false, 0); image = new Image(GuiUtils.GetIcon("tomboy", 48)); image.Xalign = 0; image.Yalign = 0; image.Show(); hbox.PackStart(image, false, false, 0); // Label header and message VBox vbox = new VBox(false, 6); vbox.Show(); hbox.PackStart(vbox, true, true, 0); headerLabel = new Label(); headerLabel.UseMarkup = true; headerLabel.Xalign = 0; headerLabel.UseUnderline = false; headerLabel.LineWrap = true; headerLabel.Show(); vbox.PackStart(headerLabel, false, false, 0); messageLabel = new Label(); messageLabel.Xalign = 0; messageLabel.UseUnderline = false; messageLabel.LineWrap = true; messageLabel.SetSizeRequest(250, -1); messageLabel.Show(); vbox.PackStart(messageLabel, false, false, 0); progressBar = new Gtk.ProgressBar(); progressBar.Orientation = Gtk.ProgressBarOrientation.LeftToRight; progressBar.BarStyle = ProgressBarStyle.Continuous; progressBar.ActivityBlocks = 30; progressBar.Show(); outerVBox.PackStart(progressBar, false, false, 0); progressLabel = new Label(); progressLabel.UseMarkup = true; progressLabel.Xalign = 0; progressLabel.UseUnderline = false; progressLabel.LineWrap = true; progressLabel.Wrap = true; progressLabel.Show(); outerVBox.PackStart(progressLabel, false, false, 0); // Expander containing TreeView expander = new Gtk.Expander(Catalog.GetString("Details")); expander.Spacing = 6; expander.Activated += OnExpanderActivated; expander.Show(); outerVBox.PackStart(expander, true, true, 0); // Contents of expander Gtk.VBox expandVBox = new Gtk.VBox(); expandVBox.Show(); expander.Add(expandVBox); // Scrolled window around TreeView Gtk.ScrolledWindow scrolledWindow = new Gtk.ScrolledWindow(); scrolledWindow.ShadowType = Gtk.ShadowType.In; scrolledWindow.SetSizeRequest(-1, 200); scrolledWindow.Show(); expandVBox.PackStart(scrolledWindow, true, true, 0); // Create model for TreeView model = new Gtk.TreeStore(typeof(string), typeof(string)); // Create TreeView, attach model Gtk.TreeView treeView = new Gtk.TreeView(); treeView.Model = model; treeView.RowActivated += OnRowActivated; treeView.Show(); scrolledWindow.Add(treeView); // Set up TreeViewColumns Gtk.TreeViewColumn column = new Gtk.TreeViewColumn( Catalog.GetString("Note Title"), new Gtk.CellRendererText(), "text", 0); column.SortColumnId = 0; column.Resizable = true; treeView.AppendColumn(column); column = new Gtk.TreeViewColumn( Catalog.GetString("Status"), new Gtk.CellRendererText(), "text", 1); column.SortColumnId = 1; column.Resizable = true; treeView.AppendColumn(column); // Button to close dialog. closeButton = (Gtk.Button)AddButton(Gtk.Stock.Close, Gtk.ResponseType.Close); closeButton.Sensitive = false; }