Пример #1
0
        protected override bool OnExposeEvent(Gdk.EventExpose evnt)
        {
            if (need_resort)
            {
                need_resort = false;

                // Resort the tree store. This is performed in an event handler
                // known not to conflict with gtk_tree_view_bin_expose() to prevent
                // errors about corrupting the TreeView's internal state.
                foreach (Source dsource in ServiceManager.SourceManager.Sources.ToArray())
                {
                    TreeIter iter = store.FindSource(dsource);
                    if (!TreeIter.Zero.Equals(iter) &&
                        (int)store.GetValue(iter, (int)SourceModel.Columns.Order) != dsource.Order)
                    {
                        store.SetValue(iter, (int)SourceModel.Columns.Order, dsource.Order);
                    }
                }
                QueueDraw();
            }

            try {
                cr = Gdk.CairoHelper.Create(evnt.Window);
                base.OnExposeEvent(evnt);
                if (Hyena.PlatformDetection.IsMeeGo)
                {
                    theme.DrawFrameBorder(cr, new Gdk.Rectangle(0, 0,
                                                                Allocation.Width, Allocation.Height));
                }
                return(true);
            } finally {
                CairoExtensions.DisposeContext(cr);
                cr = null;
            }
        }
Пример #2
0
        protected override bool OnExposeEvent(Gdk.EventExpose evnt)
        {
            if (need_resort)
            {
                need_resort = false;

                // Resort the tree store. This is performed in an event handler
                // known not to conflict with gtk_tree_view_bin_expose() to prevent
                // errors about corrupting the TreeView's internal state.
                foreach (Source dsource in ServiceManager.SourceManager.Sources)
                {
                    TreeIter iter = store.FindSource(dsource);
                    if (!TreeIter.Zero.Equals(iter) && (int)store.GetValue(iter, 1) != dsource.Order)
                    {
                        store.SetValue(iter, 1, dsource.Order);
                    }
                }
                QueueDraw();
            }

            try {
                cr = Gdk.CairoHelper.Create(evnt.Window);
                return(base.OnExposeEvent(evnt));
            } finally {
                ((IDisposable)cr.Target).Dispose();
                ((IDisposable)cr).Dispose();
                cr = null;
            }
        }
Пример #3
0
        protected override bool OnDrawn(Cairo.Context cr)
        {
            if (need_resort)
            {
                need_resort = false;

                // Resort the tree store. This is performed in an event handler
                // known not to conflict with gtk_tree_view_bin_expose() to prevent
                // errors about corrupting the TreeView's internal state.
                foreach (Source dsource in ServiceManager.SourceManager.Sources.ToArray())
                {
                    TreeIter iter = store.FindSource(dsource);
                    if (!TreeIter.Zero.Equals(iter) &&
                        (int)store.GetValue(iter, (int)SourceModel.Columns.Order) != dsource.Order)
                    {
                        store.SetValue(iter, (int)SourceModel.Columns.Order, dsource.Order);
                    }
                }
                QueueDraw();
            }

            base.OnDrawn(cr);
            return(true);
        }
Пример #4
0
        protected override void OnChanged()
        {
            lock (this) {
                TreeIter iter;

                if (GetActiveIter(out iter))
                {
                    Source new_source = store.GetValue(iter, 0) as Source;
                    if (new_source != null && ServiceManager.SourceManager.ActiveSource != new_source)
                    {
                        ServiceManager.SourceManager.SetActiveSource(new_source);
                        if (new_source is ITrackModelSource)
                        {
                            ServiceManager.PlaybackController.NextSource = (ITrackModelSource)new_source;
                        }
                    }
                }
            }
        }