Exemplo n.º 1
0
        protected virtual void Dispose(bool disposing)
        {
            if (disposed)
            {
                return;
            }
            disposed = true;

            if (disposing)
            {
                Preferences.SettingChanged -= OnPreferencesChanged;
                // free managed resources
                if (rating != null)
                {
                    rating.Dispose();
                    rating = null;
                }
                if (description_entry != null)
                {
                    description_entry.Dispose();
                    description_entry = null;
                }
                if (tag_view != null)
                {
                    tag_view.Dispose();
                    tag_view = null;
                }
                if (photo_view_scrolled != null)
                {
                    photo_view_scrolled.Dispose();
                    photo_view_scrolled = null;
                }
                if (filmstrip != null)
                {
                    filmstrip.Dispose();
                    filmstrip = null;
                }
                if (inner_vbox != null)
                {
                    inner_vbox.Dispose();
                    inner_vbox = null;
                }
                if (inner_hbox != null)
                {
                    inner_hbox.Dispose();
                    inner_hbox = null;
                }
            }
            // free unmanaged resources
        }
Exemplo n.º 2
0
        public PhotoView(IBrowsableCollection query)
        {
            Query = query;

            commit_delay = new DelayedOperation(1000, new GLib.IdleHandler(CommitPendingChanges));
            Destroyed   += HandleDestroy;

            Name = "ImageContainer";
            Box vbox = new VBox(false, 6);

            Add(vbox);

            background = new EventBox();
            Frame frame = new Frame();

            background.Add(frame);

            frame.ShadowType = ShadowType.In;
            vbox.PackStart(background, true, true, 0);

            inner_vbox = new VBox(false, 2);
            inner_hbox = new HBox(false, 2);

            frame.Add(inner_hbox);

            BrowsablePointer bp = new BrowsablePointer(query, -1);

            View = new PhotoImageView(bp);

            filmstrip             = new Filmstrip(bp);
            filmstrip.ThumbOffset = 1;
            filmstrip.Spacing     = 4;
            filmstrip.ThumbSize   = 75;
            PlaceFilmstrip((Orientation)Preferences.Get <int> (Preferences.FILMSTRIP_ORIENTATION), true);

            View.PhotoChanged += HandlePhotoChanged;

            photo_view_scrolled = new ScrolledWindow(null, null);

            photo_view_scrolled.SetPolicy(PolicyType.Automatic, PolicyType.Automatic);
            photo_view_scrolled.ShadowType = ShadowType.None;
            photo_view_scrolled.Add(View);
            photo_view_scrolled.Child.ButtonPressEvent += HandleButtonPressEvent;
            View.AddEvents((int)EventMask.KeyPressMask);
            inner_vbox.PackStart(photo_view_scrolled, true, true, 0);
            inner_hbox.PackStart(inner_vbox, true, true, 0);

            HBox lower_hbox = new HBox(false, 2);

            //inner_hbox.BorderWidth = 6;

            tag_view = new TagView();
            lower_hbox.PackStart(tag_view, false, true, 0);

            Label comment = new Label(Catalog.GetString("Description:"));

            lower_hbox.PackStart(comment, false, false, 0);
            description_entry = new Entry();
            lower_hbox.PackStart(description_entry, true, true, 0);
            description_entry.Changed += HandleDescriptionChanged;

            rating = new RatingEntry {
                HasFrame             = false,
                AlwaysShowEmptyStars = true
            };
            lower_hbox.PackStart(rating, false, false, 0);
            rating.Changed += HandleRatingChanged;

            SetColors();

            inner_vbox.PackStart(lower_hbox, false, true, 0);

            vbox.ShowAll();

            Realized += (o, e) => SetColors();
            Preferences.SettingChanged += OnPreferencesChanged;
        }
Exemplo n.º 3
0
        public PhotoView(IBrowsableCollection query)
            : base()
        {
            this.query = query;

            commit_delay    = new FSpot.Delay(1000, new GLib.IdleHandler(CommitPendingChanges));
            this.Destroyed += HandleDestroy;

            Name = "ImageContainer";
            Box vbox = new VBox(false, 6);

            Add(vbox);

            background = new EventBox();
            Frame frame = new Frame();

            background.Add(frame);

            frame.ShadowType = ShadowType.In;
            vbox.PackStart(background, true, true, 0);

            Box inner_vbox = new VBox(false, 2);

            frame.Add(inner_vbox);

            BrowsablePointer bp = new BrowsablePointer(query, -1);

            photo_view = new FSpot.PhotoImageView(bp);

            filmstrip = new Filmstrip(bp);
            Gdk.Pixbuf bg = new Gdk.Pixbuf(Gdk.Colorspace.Rgb, true, 8, 1, 69);
            bg.Fill(0x00000000);
            filmstrip.BackgroundTile = bg;
            filmstrip.ThumbOffset    = 1;
            filmstrip.Spacing        = 4;
            inner_vbox.PackStart(filmstrip, false, false, 0);

            photo_view.PhotoChanged += HandlePhotoChanged;

            photo_view_scrolled = new ScrolledWindow(null, null);

            photo_view_scrolled.SetPolicy(PolicyType.Automatic, PolicyType.Automatic);
            photo_view_scrolled.ShadowType = ShadowType.None;
            photo_view_scrolled.Add(photo_view);
            photo_view_scrolled.Child.ButtonPressEvent += HandleButtonPressEvent;
            photo_view.AddEvents((int)EventMask.KeyPressMask);
            inner_vbox.PackStart(photo_view_scrolled, true, true, 0);

            HBox inner_hbox = new HBox(false, 2);

            //inner_hbox.BorderWidth = 6;

            tag_view = new Widgets.TagView(MainWindow.ToolTips);
            inner_hbox.PackStart(tag_view, false, true, 0);

            Label comment = new Label(Catalog.GetString("Comment:"));

            inner_hbox.PackStart(comment, false, false, 0);
            description_entry = new Entry();
            inner_hbox.PackStart(description_entry, true, true, 0);
            description_entry.Changed += HandleDescriptionChanged;

            rating = new Widgets.Rating();
            inner_hbox.PackStart(rating, false, false, 0);
            rating.Changed += HandleRatingChanged;

            SetColors();

            inner_vbox.PackStart(inner_hbox, false, true, 0);

            vbox.ShowAll();

            Realized += delegate(object o, EventArgs e) { SetColors(); };
        }