Esempio n. 1
0
        public void Highlight(FileTab tab)
        {
            if (currentHighlight != null)
            {
                currentHighlight.Normalize();
            }

            tab.Highlight();
            currentHighlight = tab;
        }
Esempio n. 2
0
        void OnTap(object sender, EventArgs e)
        {
            FileTab tab = (FileTab)sender;

            Highlight(tab);

            if (OnTabTap != null)
            {
                OnTabTap(tab, e);
            }
        }
Esempio n. 3
0
        public void Highlight(int index)
        {
            if (currentHighlight != null)
            {
                currentHighlight.Normalize();
            }

            FileTab item = items[index];

            item.Highlight();
            currentHighlight = item;
        }
        void OnTabTapped(object sender, EventArgs e)
        {
            FileTab tab = (FileTab)sender;

            ContentView.Editor.Update(tab.Index);

            /*
             * If parent is FileTabs, all tabs are visible, ExpandButton is hidden
             * If ExpandButton is visible, tab.Parent will be FileTabPopup
             */
            if (tab.Parent is FileTabs)
            {
                // Do nothing. No UI-updates to handle
            }
            else
            {
                ContentView.FileTabs.Toggle();
                ContentView.Toolbar.ExpandButton.Update(tab.Text);
            }
        }
Esempio n. 5
0
        void AddTabs(ZipData data)
        {
            items = new List <FileTab>();

            Children.Clear();
            items.Clear();

            List <string> names = data.StyleFileNames;
            int           index = 0;

            foreach (string name in names)
            {
                FileTab tab = new FileTab(name, index);
                AddSubview(tab);
                items.Add(tab);

                tab.Tapped += OnTap;

                index++;
            }

            LayoutSubviews();
        }
        public void Update(ZipData data)
        {
            Children.Clear();
            items.Clear();


            double x = 0;
            double y = 0;
            double w = TabWidth;
            double h = Height;

            List <string> names = data.StyleFileNames;
            int           index = 0;

            foreach (string name in names)
            {
                FileTab tab = new FileTab(name, index);
                AddSubview(tab, x, y, w, h);
                items.Add(tab);

                tab.Tapped += OnTap;

                if ((int)Math.Ceiling(x + w) == (int)Width)
                {
                    x  = 0;
                    y += h;
                }
                else
                {
                    x += w;
                }

                index++;
            }

            Highlight(0);
        }