Tab CreateTab(GtkShellDocumentViewItem view) { var tab = CreateTab(tabstrip, view); tab.Activated += TabActivated; return(tab); }
public void SetViewTitle(GtkShellDocumentViewItem view, string label, Xwt.Drawing.Image icon, string accessibilityDescription) { var tab = tabstrip.Tabs.FirstOrDefault(t => t.Tag == view); if (tab != null) { UpdateTab(tab, label, icon, accessibilityDescription); } }
internal static Tab CreateTab(Tabstrip tabstrip, GtkShellDocumentViewItem view) { var tab = new Tab(tabstrip, view.Title) { Tag = view }; if (tab.Accessible != null) { tab.Accessible.Help = view.AccessibilityDescription; } return(tab); }
public void SetRootView(IShellDocumentViewItem view) { this.view = (GtkShellDocumentViewItem)view; if (Child != null) { Remove(Child); } if (view != null) { var widget = (Gtk.Widget)view; widget.Show(); Add(widget); } }
public void InsertView(int position, GtkShellDocumentViewItem view) { if (Children.Count > 0) { var part = 1 / ((double)Children.Count + 1); for (int i = 0; i < relativeSplitSizes.Count; i++) { relativeSplitSizes [i] *= 1 - part; } relativeSplitSizes.Insert(position, part); } else { relativeSplitSizes.Add(1); } Children.Insert(position, view); Rebuild(); }
void ShowChildView(GtkShellDocumentViewItem view) { if (currentContainer.ActiveView != view) { currentContainer.ActiveView = view; // If this container has embedded tabstrips, reset the active tab in all of them except // the one that was clicked. Otherwise several active tabs would be visible, one for // each tabstrip if (attachedChildTabstrips.Contains(view)) { tabstrip.ActiveTab = -1; } foreach (var c in attachedChildTabstrips) { if (c != view) { c.tabstrip.ActiveTab = -1; } } } }
public void InsertView(int position, GtkShellDocumentViewItem view) { tabstrip.InsertTab(position, CreateTab(view)); }
public void ReplaceView(int position, GtkShellDocumentViewItem view) { tabstrip.ReplaceTab(position, CreateTab(view)); ShowActiveContent(); }
public void SetViewTitle(GtkShellDocumentViewItem view, string label, Xwt.Drawing.Image icon, string accessibilityDescription) { }
public void SelectView(GtkShellDocumentViewItem view) { }
public void ReplaceView(int position, GtkShellDocumentViewItem view) { Children [position] = view; Rebuild(); }
public void SetCurrentMode(DocumentViewContainerMode mode, GtkShellDocumentViewItem newActive) { if (this.currentMode == mode) { return; } // Save current split sizes if (currentContainer is GtkShellDocumentViewContainerSplit split) { splitSizes = split.GetRelativeSplitSizes(); } this.currentMode = mode; GtkShellDocumentViewItem activeView = null; List <GtkShellDocumentViewItem> allViews = null; if (currentContainer != null) { activeView = currentContainer.ActiveView; currentContainer.ActiveViewChanged -= Container_ActiveViewChanged; allViews = currentContainer.GetAllViews().ToList(); currentContainer.Widget.Hide(); currentContainer.RemoveAllViews(); } if (mode == DocumentViewContainerMode.Tabs) { if (tabsContainer == null) { tabsContainer = new GtkShellDocumentViewContainerTabs(); rootTabsBox.PackStart(tabsContainer.Widget, true, true, 0); } currentContainer = tabsContainer; } else { if (splitContainer == null) { splitContainer = new GtkShellDocumentViewContainerSplit(mode); rootTabsBox.PackStart(splitContainer.Widget, true, true, 0); } currentContainer = splitContainer; if (hasSplit) { tabstrip.ActiveTab = tabstrip.TabCount - 1; } } if (allViews != null) { currentContainer.AddViews(allViews); } // Restore current split sizes if (splitSizes != null && currentContainer is GtkShellDocumentViewContainerSplit newSplit) { newSplit.SetRelativeSplitSizes(splitSizes); } currentContainer.ActiveView = newActive ?? activeView; currentContainer.ActiveViewChanged += Container_ActiveViewChanged; currentContainer.Widget.Show(); if (newActive != activeView) { ActiveViewChanged?.Invoke(this, EventArgs.Empty); } CurrentModeChanged?.Invoke(this, EventArgs.Empty); }