예제 #1
0
        public RatingFilterDialog(FSpot.PhotoQuery query, Gtk.Window parent_window)
            : base("RatingFilterDialog.ui", "rating_filter_dialog")
        {
            this.query = query;
            this.parent_window = parent_window;
            TransientFor = parent_window;
            DefaultResponse = ResponseType.Ok;
            ok_button.GrabFocus ();

            if (query.RatingRange != null) {
                minrating_value = (int) query.RatingRange.MinRating;
                maxrating_value = (int) query.RatingRange.MaxRating;
            }
            minrating = new Rating (minrating_value);
            maxrating = new Rating (maxrating_value);
            minrating_hbox.PackStart (minrating, false, false, 0);
            maxrating_hbox.PackStart (maxrating, false, false, 0);

            ResponseType response = (ResponseType) Run ();

            if (response == ResponseType.Ok) {
                query.RatingRange = new RatingRange ((uint) minrating.Value, (uint) maxrating.Value);
            }

            Destroy ();
        }
		public RatingMenuItem (object parent) : base ()
		{
			HBox box = new HBox ();
			box.Spacing = 5;

			Label label = new Label ();
			label.Markup = String.Format ("<i>{0}</i>",
					GLib.Markup.EscapeText (Catalog.GetString ("Rating:")));
			box.PackStart (label, false, false, 0);

			if (parent is FullScreenView) {
				FSpot.Utils.Log.Debug ("PARENT IS FSVIEW");
				FullScreenView fsview = parent as FullScreenView;
				entry = new Rating ((int)fsview.View.Item.Current.Rating, true);
			} else if (MainWindow.Toplevel.Selection.Count == 1)
				entry = new Rating ((int)MainWindow.Toplevel.Selection[0].Rating, true);
			else
				entry = new Rating (-1, true);
			entry.Changed += OnEntryChanged;
			box.PackStart (entry, false, false, 0);

			box.ShowAll ();
			Add (box);
		}
예제 #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 ();};
		}
예제 #4
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(); };
        }