void EnsureToolbarBoxSeparator()
        {
            if (toolbarBox == null || subViewToolbar == null)
            {
                return;
            }

            if (separatorItem != null && pathBar == null)
            {
                subViewToolbar.Remove(separatorItem);
                separatorItem = null;
            }
            else if (separatorItem == null && pathBar != null)
            {
                separatorItem = new SeparatorToolItem();
                subViewToolbar.Insert(separatorItem, -1);
            }
            else if (separatorItem != null && pathBar != null)
            {
                if (subViewToolbar.GetItemIndex(separatorItem) != subViewToolbar.NumChildren - 1)
                {
                    subViewToolbar.Remove(separatorItem);
                    subViewToolbar.Insert(separatorItem, -1);
                }
            }
        }
Exemple #2
0
        public void PopulateToolbarPlaceholder(Toolbar toolbar, string path, Widget item, bool expand)
        {
            var placeholder = (ToolItem)UIManager.GetWidget(path);
            int position    = toolbar.GetItemIndex(placeholder);

            toolbar.Remove(placeholder);

            if (item is ToolItem)
            {
                ((ToolItem)item).Expand = expand;
                toolbar.Insert((ToolItem)item, position);
            }
            else
            {
                ToolItem container_item = new Widgets.GenericToolItem <Widget> (item)
                {
                    Expand = expand
                };
                container_item.Show();
                container_item.ToolbarReconfigured += (o, a) => {
                    SetItemSize(container_item, container_item.IconSize);
                };
                toolbar.Insert(container_item, position);
            }
        }
        public void PopulateToolbarPlaceholder(Toolbar toolbar, string path, Widget item, bool expand)
        {
            ToolItem placeholder = (ToolItem)UIManager.GetWidget(path);
            int      position    = toolbar.GetItemIndex(placeholder);

            toolbar.Remove(placeholder);

            if (item is ToolItem)
            {
                ((ToolItem)item).Expand = expand;
                toolbar.Insert((ToolItem)item, position);
            }
            else
            {
                ToolItem container_item = new Banshee.Widgets.GenericToolItem <Widget> (item);
                container_item.Expand = expand;
                container_item.Show();
                toolbar.Insert(container_item, position);
            }
        }
Exemple #4
0
        void toolbarClick(object sender, EventArgs e)
        {
            if (sender == alphButton)
            {
                PropertySort = System.Windows.Forms.PropertySort.Alphabetical;
            }
            else if (sender == catButton)
            {
                PropertySort = System.Windows.Forms.PropertySort.Categorized;
            }
            else
            {
                int index = toolbar.GetItemIndex((RadioToolButton)sender) - FirstTabIndex;

                PropertyTab tab = (PropertyTab)propertyTabs[index];
                if (selectedTab == tab)
                {
                    return;
                }

                selectedTab = tab;
                Populate();
            }
        }