コード例 #1
0
        void BuildUI(Window parent)
        {
            TransientFor   = parent;
            WindowPosition = WindowPosition.CenterOnParent;

            photo_view = new PhotoImageView(Controller.Photos);
            photo_scrolled.Add(photo_view);
            photo_scrolled.SetSizeRequest(200, 200);
            photo_view.Show();

            GtkUtil.ModifyColors(photo_scrolled);
            GtkUtil.ModifyColors(photo_view);

            var tray = new BrowseablePointerGridView(photo_view.Item)
            {
                DisplayTags = false
            };

            icon_scrolled.Add(tray);
            tray.Show();

            progress_bar.Hide();

            import_button.Sensitive = false;

            tag_entry = new TagEntry(App.Instance.Database.Tags, false);
            tag_entry.UpdateFromTagNames(new string [] {});
            tagentry_box.Add(tag_entry);
            tag_entry.Show();
            attachtags_label.MnemonicWidget = tag_entry;
        }
コード例 #2
0
        void ReleaseDesignerOutlets()
        {
            if (UsernameLabel != null)
            {
                UsernameLabel.Dispose();
                UsernameLabel = null;
            }

            if (CheckBoxButton != null)
            {
                CheckBoxButton.Dispose();
                CheckBoxButton = null;
            }

            if (PhotoImageView != null)
            {
                PhotoImageView.Dispose();
                PhotoImageView = null;
            }

            if (OnlineIndicatorView != null)
            {
                OnlineIndicatorView.Dispose();
                OnlineIndicatorView = null;
            }

            if (InactiveContactOverlay != null)
            {
                InactiveContactOverlay.Dispose();
                InactiveContactOverlay = null;
            }
        }
コード例 #3
0
        protected override void DoAttachBindings()
        {
            Bindings.Add(this.SetBinding(() => ViewModel.Target.Username, () => UsernameLabel.Text));
            Bindings.Add(this.SetBinding(() => ViewModel.Target.PhotoUrl).WhenSourceChanges(() =>
            {
                PhotoImageView.LoadImageWithTextPlaceholder(
                    ViewModel.Target.PhotoUrl,
                    ViewModel.Target.Username,
                    StyleHelper.Style.AvatarStyles,
                    x => x.Transform(new CircleTransformation()));
            }));
            Bindings.Add(this.SetBinding(() => ViewModel.Target.IsSelected, () => CheckBoxButton.Selected, BindingMode.TwoWay));
            Bindings.Add(this.SetBinding(() => ViewModel.Target.IsActive).WhenSourceChanges(() =>
            {
                var isActive = ViewModel.Target.IsActive;

                InactiveContactOverlay.Hidden = isActive;
                CheckBoxButton.Hidden         = !isActive;
                UserInteractionEnabled        = isActive;
            }));
            Bindings.Add(this.SetBinding(() => ViewModel.Target.IsOnline, () => OnlineIndicatorView.Hidden)
                         .ConvertSourceToTarget(x => !x));
            Bindings.Add(this.SetBinding(() => ViewModel.Target.IsSelectable, () => CheckBoxButton.Hidden)
                         .ConvertSourceToTarget(x => !x));
        }
コード例 #4
0
		protected virtual void SetView (PhotoImageView view)
		{
			if (controls != null)
				controls.Destroy ();

			controls = null;

			this.view = view;
			if (view == null)
				return;

			Widget w = CreateControls ();

			if (w != null) {
#if false
				ControlOverlay c = new ControlOverlay (view);
				c.AutoHide = false;
				w.ShowAll ();
				c.Add (w);
				c.Visibility = ControlOverlay.VisibilityType.Full;
				controls = c;
#else
				Window win = new Window (String.Format ("{0}", GetTitle ()));
				win.TransientFor = (Gtk.Window) view.Toplevel;
				win.Add (w);
				win.ShowAll ();
				win.DeleteEvent += delegate { Destroy (); };
				controls = win;
#endif
			}
			
		}
コード例 #5
0
        void ReleaseDesignerOutlets()
        {
            if (AttachPhotoButton != null)
            {
                AttachPhotoButton.Dispose();
                AttachPhotoButton = null;
            }

            if (DeleteButton != null)
            {
                DeleteButton.Dispose();
                DeleteButton = null;
            }

            if (DescriptionTextField != null)
            {
                DescriptionTextField.Dispose();
                DescriptionTextField = null;
            }

            if (DetachPhotoButton != null)
            {
                DetachPhotoButton.Dispose();
                DetachPhotoButton = null;
            }

            if (NoInternetConnection != null)
            {
                NoInternetConnection.Dispose();
                NoInternetConnection = null;
            }

            if (PhotoImageView != null)
            {
                PhotoImageView.Dispose();
                PhotoImageView = null;
            }

            if (SaveButton != null)
            {
                SaveButton.Dispose();
                SaveButton = null;
            }

            if (StatusSwitch != null)
            {
                StatusSwitch.Dispose();
                StatusSwitch = null;
            }

            if (TitleTextField != null)
            {
                TitleTextField.Dispose();
                TitleTextField = null;
            }
        }
コード例 #6
0
		protected override void SetView (PhotoImageView value)
		{
			base.SetView (value);
			
			if (value == null)
				return;

			soft = new Widgets.SoftFocus (info);
			effect = (IEffect) soft;
		}
コード例 #7
0
        protected override void SetView(PhotoImageView value)
        {
            base.SetView(value);

            if (value == null)
            {
                return;
            }

            soft   = new Widgets.SoftFocus(info);
            effect = (IEffect)soft;
        }
コード例 #8
0
        protected virtual void SetupLayoutConstraints()
        {
            this.SubviewsDoNotTranslateAutoresizingMaskIntoConstraints();

            this.AddConstraints(
                DescriptionLabel.Below(PhotoImageView, 8),
                DescriptionLabel.AtRightOf(this, 8),
                DescriptionLabel.AtLeftOf(this, 8),
                PhotoImageView.Height().EqualTo(300),
                PhotoImageView.AtTopOfSafeArea(this),
                PhotoImageView.AtLeftOf(this),
                PhotoImageView.AtRightOf(this));
        }
コード例 #9
0
        void ReleaseDesignerOutlets()
        {
            if (BottomBar != null)
            {
                BottomBar.Dispose();
                BottomBar = null;
            }

            if (DateLabel != null)
            {
                DateLabel.Dispose();
                DateLabel = null;
            }

            if (DeleteButton != null)
            {
                DeleteButton.Dispose();
                DeleteButton = null;
            }

            if (LikeButton != null)
            {
                LikeButton.Dispose();
                LikeButton = null;
            }

            if (PhotoImageView != null)
            {
                PhotoImageView.Dispose();
                PhotoImageView = null;
            }

            if (ProfilePictureImageView != null)
            {
                ProfilePictureImageView.Dispose();
                ProfilePictureImageView = null;
            }

            if (TopBar != null)
            {
                TopBar.Dispose();
                TopBar = null;
            }

            if (UserName != null)
            {
                UserName.Dispose();
                UserName = null;
            }
        }
コード例 #10
0
 protected override void DoAttachBindings()
 {
     Bindings.Add(this.SetBinding(() => ViewModel.Target.Username, () => UsernameLabel.Text));
     Bindings.Add(this.SetBinding(() => ViewModel.Target.PhotoUrl).WhenSourceChanges(() =>
     {
         PhotoImageView.LoadImageWithTextPlaceholder(
             ViewModel.Target.PhotoUrl,
             ViewModel.Target.Username,
             StyleHelper.Style.AvatarStyles,
             x => x.Transform(new CircleTransformation()));
     }));
     Bindings.Add(this.SetBinding(() => ViewModel.Target.IsSelected, () => CheckBoxButton.Selected, BindingMode.TwoWay));
     Bindings.Add(this.SetBinding(() => ViewModel.Target.IsSelectable, () => CheckBoxButton.Hidden)
                  .ConvertSourceToTarget(x => !x));
 }
コード例 #11
0
        public AdjustTimeDialog(Db db, IBrowsableCollection collection) : base("AdjustTimeDialog.ui", "time_dialog")
        {
            this.db         = db;
            this.collection = collection;

            view = new PhotoImageView(collection);
            view_scrolled.Add(view);
            item          = view.Item;
            item.Changed += HandleItemChanged;
            item.MoveFirst();

            tray = new BrowseablePointerGridView(view.Item)
            {
                MaxColumns     = 1,
                DisplayRatings = false,
                DisplayTags    = false,
                DisplayDates   = true
            };
            tray_scrolled.Add(tray);

            //forward_button.Clicked += HandleForwardClicked;
            //back_button.Clicked += HandleBackClicked;
            ok_button.Clicked     += HandleOkClicked;
            cancel_button.Clicked += HandleCancelClicked;

            photo_spin.ValueChanged += HandleSpinChanged;
            photo_spin.SetIncrements(1.0, 1.0);
            photo_spin.Adjustment.StepIncrement = 1.0;
            photo_spin.Wrap = true;

            date_edit.TimeChanged += HandleTimeChanged;
            date_edit.DateChanged += HandleTimeChanged;
            Gtk.Entry entry = (Gtk.Entry)date_edit.Children [0];
            entry.Changed        += HandleTimeChanged;
            entry                 = (Gtk.Entry)date_edit.Children [2];
            entry.Changed        += HandleTimeChanged;
            offset_entry.Changed += HandleOffsetChanged;
            ShowAll();
            HandleCollectionChanged(collection);

            spacing_entry.Changed  += HandleSpacingChanged;
            spacing_entry.Sensitive = !difference_check.Active;

            difference_check.Toggled += HandleActionToggled;
        }
コード例 #12
0
        protected override void SetView(PhotoImageView value)
        {
            if (view != null)
            {
                view.ExposeEvent -= ExposeEvent;
                view.QueueDraw();
            }

            base.SetView(value);

            if (value == null)
            {
                return;
            }

            view.ExposeEvent += ExposeEvent;
            view.QueueDraw();
        }
コード例 #13
0
        void ReleaseDesignerOutlets()
        {
            if (DescriptionLabel != null)
            {
                DescriptionLabel.Dispose();
                DescriptionLabel = null;
            }

            if (PhotoImageView != null)
            {
                PhotoImageView.Dispose();
                PhotoImageView = null;
            }

            if (TakePhotoButton != null)
            {
                TakePhotoButton.Dispose();
                TakePhotoButton = null;
            }
        }
コード例 #14
0
        void ReleaseDesignerOutlets()
        {
            if (CheckBoxButton != null)
            {
                CheckBoxButton.Dispose();
                CheckBoxButton = null;
            }

            if (PhotoImageView != null)
            {
                PhotoImageView.Dispose();
                PhotoImageView = null;
            }

            if (UsernameLabel != null)
            {
                UsernameLabel.Dispose();
                UsernameLabel = null;
            }
        }
コード例 #15
0
		public TimeDialog (Db db, IBrowsableCollection collection) : base ("time_dialog")
		{
			this.db = db;
			this.collection = collection;

			tray = new TrayView (collection);
			tray_scrolled.Add (tray);
			tray.Selection.Changed += HandleSelectionChanged;

			view = new PhotoImageView (collection);
			view_scrolled.Add (view);
			Item = view.Item;
			Item.Changed += HandleItemChanged;
			Item.MoveFirst ();

			//forward_button.Clicked += HandleForwardClicked;
			//back_button.Clicked += HandleBackClicked;
			ok_button.Clicked += HandleOkClicked;
			cancel_button.Clicked += HandleCancelClicked;

			photo_spin.ValueChanged += HandleSpinChanged;
			photo_spin.SetIncrements (1.0, 1.0);
			photo_spin.Adjustment.StepIncrement = 1.0;
			photo_spin.Wrap = true;

			date_edit.TimeChanged += HandleTimeChanged;
			date_edit.DateChanged += HandleTimeChanged;
			Gtk.Entry entry = (Gtk.Entry) date_edit.Children [0];
			entry.Changed += HandleTimeChanged;
			entry = (Gtk.Entry) date_edit.Children [2];
			entry.Changed += HandleTimeChanged;
			offset_entry.Changed += HandleOffsetChanged;
			Dialog.ShowAll ();
			HandleCollectionChanged (collection);

			spacing_entry.Changed += HandleSpacingChanged;
			spacing_entry.Sensitive = ! difference_check.Active;
		      
			difference_check.Toggled += HandleActionToggled;
		}
コード例 #16
0
        void ReleaseDesignerOutlets()
        {
            if (LocationText != null)
            {
                LocationText.Dispose();
                LocationText = null;
            }

            if (PhotoImageView != null)
            {
                PhotoImageView.Dispose();
                PhotoImageView = null;
            }

            if (ShareAppnet != null)
            {
                ShareAppnet.Dispose();
                ShareAppnet = null;
            }

            if (ShareFacebook != null)
            {
                ShareFacebook.Dispose();
                ShareFacebook = null;
            }

            if (ShareFlickr != null)
            {
                ShareFlickr.Dispose();
                ShareFlickr = null;
            }

            if (ShareTwitter != null)
            {
                ShareTwitter.Dispose();
                ShareTwitter = null;
            }
        }
コード例 #17
0
        protected override void SetView(PhotoImageView value)
        {
            if (view != null)
            {
                view.ExposeEvent -= ExposeEvent;
                view.QueueDraw();
                view.DoubleBuffered = double_buffer;
            }

            base.SetView(value);

            if (view == null)
            {
                return;
            }

            info = new Widgets.ImageInfo(view.CompletePixbuf());

            double_buffer       = (view.WidgetFlags & WidgetFlags.DoubleBuffered) == WidgetFlags.DoubleBuffered;
            view.DoubleBuffered = true;
            view.ExposeEvent   += ExposeEvent;
            view.QueueDraw();
        }
コード例 #18
0
        protected virtual void SetView(PhotoImageView view)
        {
            if (controls != null)
            {
                controls.Destroy();
            }

            controls = null;

            this.view = view;
            if (view == null)
            {
                return;
            }

            Widget w = CreateControls();

            if (w != null)
            {
#if false
                ControlOverlay c = new ControlOverlay(view);
                c.AutoHide = false;
                w.ShowAll();
                c.Add(w);
                c.Visibility = ControlOverlay.VisibilityType.Full;
                controls     = c;
#else
                Window win = new Window(String.Format("{0}", GetTitle()));
                win.TransientFor = (Gtk.Window)view.Toplevel;
                win.Add(w);
                win.ShowAll();
                win.DeleteEvent += delegate { Destroy(); };
                controls         = win;
#endif
            }
        }
コード例 #19
0
		private void HandlePhotoChanged (PhotoImageView view)
		{
			try {
				if (!view.Item.IsValid)
 					throw new Exception ("Invalid Image");
				
				using (FSpot.ImageFile img = FSpot.ImageFile.Create (((Photo)view.Item.Current).DefaultVersionUri)) {
 					try {
 						image_profile = img.GetProfile ();
 					} catch (System.Exception e) {
 						image_profile = null;
 						System.Console.WriteLine (e);
 					}

					// FIXME fall back to rgb for now
					if (image_profile == null)
						image_profile = Cms.Profile.CreateStandardRgb ();
				
					AdjustedPixbuf = img.Load (256, 256);
					ScaledPixbuf = AdjustedPixbuf.Copy ();			
				}

				if (AdjustedPixbuf.HasAlpha)
					throw new Exception ("Unsupported Alpha Channel");

 				control_vbox.Sensitive = true;
 				ok_button.Sensitive = true;

  				RangeChanged (null, null);
  			} catch (System.Exception) {
 				control_vbox.Sensitive = false;
 				ok_button.Sensitive = false;
 				AdjustedPixbuf = null;
 				ScaledPixbuf = null;
  				image_profile = null;
  			}	
		}
コード例 #20
0
 public GlEditor(PhotoImageView view) : base(view)
 {
     transition = new GlTransition.Flip();
 }
コード例 #21
0
 public Tilt(PhotoImageView view) : base(view)
 {
 }
コード例 #22
0
		public SoftFocus (PhotoImageView view) : base (view)
		{
		}
コード例 #23
0
		public Editor (PhotoImageView view)
		{
			SetView (view);
		}
コード例 #24
0
		protected override void SetView (PhotoImageView value)
		{
			if (view != null) {
				view.ExposeEvent -= ExposeEvent;
				view.QueueDraw ();
				view.DoubleBuffered = double_buffer;
			}

			base.SetView (value);

			if (view == null)
				return;

			info = new Widgets.ImageInfo (view.CompletePixbuf ());

			double_buffer = (view.WidgetFlags & WidgetFlags.DoubleBuffered) == WidgetFlags.DoubleBuffered;
			view.DoubleBuffered = true;
			view.ExposeEvent += ExposeEvent;
			view.QueueDraw ();
		}
コード例 #25
0
		public EffectEditor (PhotoImageView view) : base (view)
		{
		}
コード例 #26
0
		// FIXME clicking the spinbutton too fast seems to switch the view to browse
			
		public FaceBox (Gtk.Box tb, PhotoImageView vw) : base() {
			
			m_list = new ArrayList();
			face_store = Core.Database.Faces;
			View = vw;
			tag_store = FSpot.Core.Database.Tags;
			
			Gtk.Label lab = new Gtk.Label("Face det:");
			lab.Show();
			tb.PackStart(lab, false, true, 0);
				
			face_button = new ToolbarButton ();
			face_button.Add (new Gtk.Image ("f-spot-sepia", IconSize.Button));
			tb.PackStart (face_button, false, true, 0);
				
			face_button.Clicked += HandleFaceButtonClicked;
			
			tag_entry = new Gtk.Entry ("test");
			tag_entry.Show();
				tag_entry.Sensitive = false;
			tb.PackStart(tag_entry, false, true, 0);
				
			m_newtag_button = new  ToolbarButton ();
			m_newtag_button.Add (new Gtk.Image ("f-spot-new-tag", IconSize.Button));
			m_newtag_button.Show();
			m_newtag_button.Sensitive = false;
			tb.PackStart(m_newtag_button,false,true,0);	
			
			m_newtag_button.Clicked += HandleNewTagButtonClicked;				
						
			m_spin = new SpinButton(1,1,1);
			m_spin.Show();
			m_spin.Sensitive = false;
			tb.PackStart(m_spin, false, true, 0);
				
			m_spin.Changed += HandleSpinChanged;
				
			//m.spin.ValueChanged += jesli w bazie, to pokaz jego tag
			//this.Add(tag_widget);
			
		}
コード例 #27
0
ファイル: PhotoView.cs プロジェクト: iainlane/f-spot
        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);

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

            frame.Add (inner_hbox);

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

            filmstrip = new Filmstrip (bp);
            Gdk.Pixbuf bg = new Gdk.Pixbuf (Gdk.Colorspace.Rgb, true, 8, 1, 77);
            bg.Fill (0x00000000);
            filmstrip.BackgroundTile = bg;
            filmstrip.ThumbOffset = 1;
            filmstrip.Spacing = 4;
            filmstrip.ThumbSize = 75;
            PlaceFilmstrip ((Orientation) Preferences.Get <int> (Preferences.FILMSTRIP_ORIENTATION), true);

            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);
            inner_hbox.PackStart (inner_vbox, true, true, 0);

            HBox lower_hbox = new HBox (false, 2);
            //inner_hbox.BorderWidth = 6;

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

            Label comment = new Label (Catalog.GetString ("Comment:"));
            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 Widgets.Rating();
            lower_hbox.PackStart (rating, false, false, 0);
            rating.Changed += HandleRatingChanged;

            SetColors ();

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

            vbox.ShowAll ();

            Realized += delegate (object o, EventArgs e) {SetColors ();};
            Preferences.SettingChanged += OnPreferencesChanged;
        }
コード例 #28
0
        public FullScreenView(IBrowsableCollection collection, Gtk.Window parent)
            : base("Full Screen Mode")
        {
            //going fullscreen on the same screen the parent window
            Gdk.Screen screen = Screen;
            int monitor = screen.GetMonitorAtWindow (parent.GdkWindow);
            Gdk.Rectangle bounds = screen.GetMonitorGeometry (monitor);
            Move (bounds.X, bounds.Y);

            string style = "style \"test\" {\n" +
                "GtkToolbar::shadow_type = GTK_SHADOW_NONE\n" +
                "}\n" +
                "class \"GtkToolbar\" style \"test\"";

            Gtk.Rc.ParseString (style);

            Name = "FullscreenContainer";
            try {
                //scroll = new Gtk.ScrolledWindow (null, null);
                actions = new ActionGroup ("joe");

                actions.Add (new ActionEntry [] {
                    new ActionEntry (HideToolbar, Stock.Close,
                             Catalog.GetString ("Hide"),
                             null,
                             Catalog.GetString ("Hide toolbar"),
                             HideToolbarAction)});

                actions.Add (new ToggleActionEntry [] {
                    new ToggleActionEntry (Info,
                                   Stock.Info,
                                   Catalog.GetString ("Info"),
                                   null,
                                   Catalog.GetString ("Image information"),
                                   InfoAction,
                                   false)});

                Gtk.Action exit_full_screen = new Gtk.Action (ExitFullScreen,
                    Catalog.GetString ("Exit fullscreen"),
                    null,
                    null);
                exit_full_screen.IconName = "view-restore";
                exit_full_screen.Activated += ExitAction;
                actions.Add (exit_full_screen);

                Gtk.Action slide_show = new Gtk.Action (SlideShow,
                    Catalog.GetString ("Slideshow"),
                    Catalog.GetString ("Start slideshow"),
                    null);
                slide_show.IconName = "media-playback-start";
                slide_show.Activated += SlideShowAction;
                actions.Add (slide_show);

                new WindowOpacityFader (this, 1.0, 600);
                notebook = new Notebook ();
                notebook.ShowBorder = false;
                notebook.ShowTabs = false;
                notebook.Show ();

                scroll = new ScrolledView ();
                scroll.ScrolledWindow.SetPolicy (PolicyType.Never, PolicyType.Never);
                view = new PhotoImageView (collection);
                // FIXME this should be handled by the new style setting code
                view.ModifyBg (Gtk.StateType.Normal, this.Style.Black);
                this.Add (notebook);
                view.Show ();
                view.MotionNotifyEvent += HandleViewMotion;
                view.PointerMode = PointerMode.Scroll;

                scroll.ScrolledWindow.Add (view);

                Toolbar tbar = new Toolbar ();
                tbar.ToolbarStyle = Gtk.ToolbarStyle.BothHoriz;

                tbar.ShowArrow = false;
                tbar.BorderWidth = 15;

                ToolItem t_item = (actions [ExitFullScreen]).CreateToolItem () as ToolItem;
                t_item.IsImportant = true;
                tbar.Insert (t_item, -1);

                Gtk.Action action = new PreviousPictureAction (view.Item);
                actions.Add (action);
                tbar.Insert (action.CreateToolItem () as ToolItem, -1);

                play_pause_button = (actions [SlideShow]).CreateToolItem () as ToolButton;
                tbar.Insert (play_pause_button, -1);

                action = new NextPictureAction (view.Item);
                actions.Add (action);
                tbar.Insert (action.CreateToolItem () as ToolItem, -1);

                t_item = new ToolItem ();
                t_item.Child = new Label (Catalog.GetString ("Slide transition:"));
                tbar.Insert (t_item, -1);

                display = new SlideShow (view.Item);
                display.AddEvents ((int) (Gdk.EventMask.PointerMotionMask));
                display.ModifyBg (Gtk.StateType.Normal, this.Style.Black);
                display.MotionNotifyEvent += HandleViewMotion;
                display.Show ();

                t_item = new ToolItem ();
                ComboBox combo = ComboBox.NewText ();
                foreach (var transition in display.Transitions)
                    combo.AppendText (transition.Name);
                combo.Active = 0;
                combo.Changed += HandleTransitionChanged;
                t_item.Child = combo;
                tbar.Insert (t_item, -1);

                action = new RotateLeftAction (view.Item);
                actions.Add (action);
                tbar.Insert (action.CreateToolItem () as ToolItem, -1);

                action = new RotateRightAction (view.Item);
                actions.Add (action);
                tbar.Insert (action.CreateToolItem () as ToolItem, -1);

                info_button = (ToggleToolButton) ((actions [Info]).CreateToolItem () as ToolItem);
                tbar.Insert (info_button, -1);

                tbar.Insert ((actions [HideToolbar]).CreateToolItem () as ToolItem, -1);

                notebook.AppendPage (scroll, null);
                notebook.AppendPage (display, null);

                tbar.ShowAll ();

                scroll.Show ();
                this.Decorated = false;
                this.Fullscreen ();
                this.ButtonPressEvent += HandleButtonPressEvent;

                view.Item.Changed += HandleItemChanged;
                view.GrabFocus ();

                hide_cursor_delay = new DelayedOperation (3000, new GLib.IdleHandler (HideCursor));
                hide_cursor_delay.Start ();

                controls = new ControlOverlay (this);
                controls.Add (tbar);
                controls.Dismiss ();

                notebook.CurrentPage = 0;
            } catch (System.Exception e) {
                Log.Exception (e);
            }
        }
コード例 #29
0
		public SingleView (Uri [] uris) 
		{
			string glade_name = "single_view";
			this.uri = uris [0];
			
			System.Console.WriteLine ("uri = {0}", uri.ToString ());

			xml = new Glade.XML (null, "f-spot.glade", glade_name, "f-spot");
			xml.Autoconnect (this);
			window = (Gtk.Window) xml.GetWidget (glade_name);
		
			LoadPreference (Preferences.VIEWER_WIDTH);
			LoadPreference (Preferences.VIEWER_MAXIMIZED);

			Gtk.Toolbar toolbar = new Gtk.Toolbar ();
			toolbar_hbox.PackStart (toolbar);
		
			ToolButton rl_button = GtkUtil.ToolButtonFromTheme ("object-rotate-left", Catalog.GetString ("Rotate Left"), true);
			rl_button.Clicked += HandleRotate270Command;
			rl_button.SetTooltip (toolTips, Catalog.GetString ("Rotate photo left"), null);
			toolbar.Insert (rl_button, -1);

			ToolButton rr_button = GtkUtil.ToolButtonFromTheme ("object-rotate-right", Catalog.GetString ("Rotate Right"), true);
			rr_button.Clicked += HandleRotate90Command;
			rr_button.SetTooltip (toolTips, Catalog.GetString ("Rotate photo right"), null);
			toolbar.Insert (rr_button, -1);

			toolbar.Insert (new SeparatorToolItem (), -1);

			ToolButton fs_button = GtkUtil.ToolButtonFromTheme ("view-fullscreen", Catalog.GetString ("Fullscreen"), true);
			fs_button.Clicked += HandleViewFullscreen;
			fs_button.SetTooltip (toolTips, Catalog.GetString ("View photos fullscreen"), null);
			toolbar.Insert (fs_button, -1);

			ToolButton ss_button = GtkUtil.ToolButtonFromTheme ("media-playback-start", Catalog.GetString ("Slideshow"), true);
			ss_button.Clicked += HandleViewSlideshow;
			ss_button.SetTooltip (toolTips, Catalog.GetString ("View photos in a slideshow"), null);
			toolbar.Insert (ss_button, -1);

			collection = new UriCollection (uris);

			TargetEntry [] dest_table = {   new TargetEntry ("text/uri-list", 0, 0),
							new TargetEntry ("text/plain", 0, 1)};
			
			directory_view = new FSpot.Widgets.IconView (collection);
			directory_view.Selection.Changed += HandleSelectionChanged;
			directory_view.DragDataReceived += HandleDragDataReceived;
			Gtk.Drag.DestSet (directory_view, DestDefaults.All, dest_table, 
					DragAction.Copy | DragAction.Move); 
			directory_view.DisplayTags = false;
			directory_view.DisplayDates = false;
			directory_view.DisplayRatings = false;

			directory_scrolled = new ScrolledWindow();
			directory_scrolled.Add (directory_view);

			sidebar = new Sidebar ();

			info_vbox.Add (sidebar);
			sidebar.AppendPage (directory_scrolled, Catalog.GetString ("Folder"), "gtk-directory");

			AddinManager.AddExtensionNodeHandler ("/FSpot/Sidebar", OnSidebarExtensionChanged);
 		
			sidebar.Context = ViewContext.Single;

			sidebar.CloseRequested += HandleHideSidePane;
			sidebar.Show ();

			ThumbnailGenerator.Default.OnPixbufLoaded += delegate { directory_view.QueueDraw (); };

			image_view = new PhotoImageView (collection);
			GtkUtil.ModifyColors (image_view);
			GtkUtil.ModifyColors (image_scrolled);
			image_view.ZoomChanged += HandleZoomChanged;
			image_view.Item.Changed += HandleItemChanged;
			image_view.ButtonPressEvent += HandleImageViewButtonPressEvent;
			image_view.DragDataReceived += HandleDragDataReceived;
			Gtk.Drag.DestSet (image_view, DestDefaults.All, dest_table,
					DragAction.Copy | DragAction.Move); 
			image_scrolled.Add (image_view);
			
			Window.ShowAll ();

			zoom_scale.ValueChanged += HandleZoomScaleValueChanged;
		
			LoadPreference (Preferences.VIEWER_SHOW_TOOLBAR);
 			LoadPreference (Preferences.VIEWER_INTERPOLATION);
			LoadPreference (Preferences.VIEWER_TRANSPARENCY);
			LoadPreference (Preferences.VIEWER_TRANS_COLOR);

			ShowSidebar = collection.Count > 1;

			LoadPreference (Preferences.VIEWER_SHOW_FILENAMES);

			Preferences.SettingChanged += OnPreferencesChanged;
			window.DeleteEvent += HandleDeleteEvent;
			
			collection.Changed += HandleCollectionChanged;

			// wrap the methods to fit to the delegate
			image_view.Item.Changed += delegate (BrowsablePointer pointer, BrowsablePointerChangedArgs old) {
															IBrowsableItem [] item = {pointer.Current};
															PhotoArray item_array = new PhotoArray (item);
															sidebar.HandleSelectionChanged (item_array);
													};
			
			image_view.Item.Collection.ItemsChanged += sidebar.HandleSelectionItemsChanged;

			UpdateStatusLabel ();
			
			if (collection.Count > 0)
				directory_view.Selection.Add (0);

			export.Submenu = (Mono.Addins.AddinManager.GetExtensionNode ("/FSpot/Menus/Exports") as FSpot.Extensions.SubmenuNode).GetMenuItem (this).Submenu;
			export.Submenu.ShowAll ();
			export.Activated += HandleExportActivated ;
		}
コード例 #30
0
 protected override void SetView(PhotoImageView view)
 {
     base.SetView(view);
     effect = new Widgets.Tilt(info);
 }
コード例 #31
0
		public Sharpener (PhotoImageView view) : base (view)
		{	
		}
コード例 #32
0
        void ReleaseDesignerOutlets()
        {
            if (TimelineView != null)
            {
                TimelineView.Dispose();
                TimelineView = null;
            }

            if (ActivityIndicator != null)
            {
                ActivityIndicator.Dispose();
                ActivityIndicator = null;
            }

            if (BodyTextView != null)
            {
                BodyTextView.Dispose();
                BodyTextView = null;
            }

            if (BodyTextViewHeightConstraint != null)
            {
                BodyTextViewHeightConstraint.Dispose();
                BodyTextViewHeightConstraint = null;
            }

            if (CommentButton != null)
            {
                CommentButton.Dispose();
                CommentButton = null;
            }

            if (ContainerView != null)
            {
                ContainerView.Dispose();
                ContainerView = null;
            }

            if (LikeButton != null)
            {
                LikeButton.Dispose();
                LikeButton = null;
            }

            if (NameLabel != null)
            {
                NameLabel.Dispose();
                NameLabel = null;
            }

            if (PhotoImageView != null)
            {
                PhotoImageView.Dispose();
                PhotoImageView = null;
            }

            if (PhotoImageViewHeightConstraint != null)
            {
                PhotoImageViewHeightConstraint.Dispose();
                PhotoImageViewHeightConstraint = null;
            }

            if (ShareButton != null)
            {
                ShareButton.Dispose();
                ShareButton = null;
            }

            if (SocialTypeImageView != null)
            {
                SocialTypeImageView.Dispose();
                SocialTypeImageView = null;
            }

            if (TimeLabel != null)
            {
                TimeLabel.Dispose();
                TimeLabel = null;
            }

            if (UserImageView != null)
            {
                UserImageView.Dispose();
                UserImageView = null;
            }

            if (ContainerViewLeadingConstraint != null)
            {
                ContainerViewLeadingConstraint.Dispose();
                ContainerViewLeadingConstraint = null;
            }
        }
コード例 #33
0
		public Loupe (PhotoImageView view) : base ("Loupe")
		{ 
			this.view = view;
			Decorated = false;
			
			Gtk.Window win = (Gtk.Window) view.Toplevel;

			win.GetPosition (out old_win_pos.X, out old_win_pos.Y);
			win.ConfigureEvent += HandleToplevelConfigure;

			TransientFor = win;
			DestroyWithParent = true;

			BuildUI ();
		}
コード例 #34
0
ファイル: PhotoView.cs プロジェクト: Yetangitu/f-spot
        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;
        }
コード例 #35
0
ファイル: SingleView.cs プロジェクト: Yetangitu/f-spot
        public SingleView(SafeUri [] uris)
        {
            this.uri = uris [0];
            Log.Debug ("uri: " + this.uri);

            GtkBeans.Builder builder = new GtkBeans.Builder ("single_view.ui");
            builder.Autoconnect (this);

            LoadPreference (Preferences.VIEWER_WIDTH);
            LoadPreference (Preferences.VIEWER_MAXIMIZED);

            Gtk.Toolbar toolbar = new Gtk.Toolbar ();
            toolbar_hbox.PackStart (toolbar);

            rl_button = GtkUtil.ToolButtonFromTheme ("object-rotate-left", Catalog.GetString ("Rotate Left"), true);
            rl_button.Clicked += HandleRotate270Command;
            rl_button.TooltipText = Catalog.GetString ("Rotate photo left");
            toolbar.Insert (rl_button, -1);

            rr_button = GtkUtil.ToolButtonFromTheme ("object-rotate-right", Catalog.GetString ("Rotate Right"), true);
            rr_button.Clicked += HandleRotate90Command;
            rr_button.TooltipText = Catalog.GetString ("Rotate photo right");
            toolbar.Insert (rr_button, -1);

            toolbar.Insert (new SeparatorToolItem (), -1);

            ToolButton fs_button = GtkUtil.ToolButtonFromTheme ("view-fullscreen", Catalog.GetString ("Fullscreen"), true);
            fs_button.Clicked += HandleViewFullscreen;
            fs_button.TooltipText = Catalog.GetString ("View photos fullscreen");
            toolbar.Insert (fs_button, -1);

            ToolButton ss_button = GtkUtil.ToolButtonFromTheme ("media-playback-start", Catalog.GetString ("Slideshow"), true);
            ss_button.Clicked += HandleViewSlideshow;
            ss_button.TooltipText = Catalog.GetString ("View photos in a slideshow");
            toolbar.Insert (ss_button, -1);

            collection = new UriCollection (uris);

            TargetList targetList = new TargetList();
            targetList.AddTextTargets((uint)DragDropTargets.TargetType.PlainText);
            targetList.AddUriTargets((uint)DragDropTargets.TargetType.UriList);

            directory_view = new SelectionCollectionGridView (collection);
            directory_view.Selection.Changed += HandleSelectionChanged;
            directory_view.DragDataReceived += HandleDragDataReceived;
            Gtk.Drag.DestSet (directory_view, DestDefaults.All, (TargetEntry[])targetList,
                    DragAction.Copy | DragAction.Move);
            directory_view.DisplayTags = false;
            directory_view.DisplayDates = false;
            directory_view.DisplayRatings = false;

            directory_scrolled = new ScrolledWindow();
            directory_scrolled.Add (directory_view);

            sidebar = new Sidebar ();

            info_vbox.Add (sidebar);
            sidebar.AppendPage (directory_scrolled, Catalog.GetString ("Folder"), "gtk-directory");

            AddinManager.AddExtensionNodeHandler ("/FSpot/Sidebar", OnSidebarExtensionChanged);

            sidebar.Context = ViewContext.Single;

            sidebar.CloseRequested += HandleHideSidePane;
            sidebar.Show ();

            ThumbnailLoader.Default.OnPixbufLoaded += delegate { directory_view.QueueDraw (); };

            image_view = new PhotoImageView (collection);
            GtkUtil.ModifyColors (image_view);
            GtkUtil.ModifyColors (image_scrolled);
            image_view.ZoomChanged += HandleZoomChanged;
            image_view.Item.Changed += HandleItemChanged;
            image_view.ButtonPressEvent += HandleImageViewButtonPressEvent;
            image_view.DragDataReceived += HandleDragDataReceived;
            Gtk.Drag.DestSet (image_view, DestDefaults.All, (TargetEntry[])targetList,
                    DragAction.Copy | DragAction.Move);
            image_scrolled.Add (image_view);

            Window.ShowAll ();

            zoom_scale.ValueChanged += HandleZoomScaleValueChanged;

            LoadPreference (Preferences.VIEWER_SHOW_TOOLBAR);
            LoadPreference (Preferences.VIEWER_INTERPOLATION);
            LoadPreference (Preferences.VIEWER_TRANSPARENCY);
            LoadPreference (Preferences.VIEWER_TRANS_COLOR);

            ShowSidebar = collection.Count > 1;

            LoadPreference (Preferences.VIEWER_SHOW_FILENAMES);

            Preferences.SettingChanged += OnPreferencesChanged;
            Window.DeleteEvent += HandleDeleteEvent;

            collection.Changed += HandleCollectionChanged;

            // wrap the methods to fit to the delegate
            image_view.Item.Changed += delegate (object sender, BrowsablePointerChangedEventArgs old) {
                    BrowsablePointer pointer = sender as BrowsablePointer;
                    if (pointer == null)
                        return;
                    IPhoto [] item = {pointer.Current};
                    sidebar.HandleSelectionChanged (new PhotoList (item));
            };

            image_view.Item.Collection.ItemsChanged += sidebar.HandleSelectionItemsChanged;

            UpdateStatusLabel ();

            if (collection.Count > 0)
                directory_view.Selection.Add (0);

            export.Submenu = (Mono.Addins.AddinManager.GetExtensionNode ("/FSpot/Menus/Exports") as FSpot.Extensions.SubmenuNode).GetMenuItem (this).Submenu;
            export.Submenu.ShowAll ();
            export.Activated += HandleExportActivated ;
        }
コード例 #36
0
        public EditTagIconDialog(Db db, Tag t, Gtk.Window parent_window) : base("EditTagIconDialog.ui", "edit_tag_icon_dialog")
        {
            TransientFor = parent_window;
            Title        = String.Format(Catalog.GetString("Edit Icon for Tag {0}"), t.Name);

            preview_pixbuf = t.Icon;
            Cms.Profile screen_profile;
            if (preview_pixbuf != null && ColorManagement.Profiles.TryGetValue(Preferences.Get <string> (Preferences.COLOR_MANAGEMENT_DISPLAY_PROFILE), out screen_profile))
            {
                preview_image.Pixbuf = preview_pixbuf.Copy();
                ColorManagement.ApplyProfile(preview_image.Pixbuf, screen_profile);
            }
            else
            {
                preview_image.Pixbuf = preview_pixbuf;
            }

            query = new PhotoQuery(db.Photos);

            if (db.Tags.Hidden != null)
            {
                query.Terms = OrTerm.FromTags(new [] { t });
            }
            else
            {
                query.Terms = new Literal(t);
            }

            image_view = new PhotoImageView(query)
            {
                CropHelpers = false
            };
            image_view.SelectionXyRatio  = 1.0;
            image_view.SelectionChanged += HandleSelectionChanged;
            image_view.PhotoChanged     += HandlePhotoChanged;

            external_photo_chooser = new Gtk.FileChooserButton(Catalog.GetString("Select Photo from file"),
                                                               Gtk.FileChooserAction.Open);

            external_photo_chooser.Filter = new FileFilter();
            external_photo_chooser.Filter.AddPixbufFormats();
            external_photo_chooser.LocalOnly = false;
            external_photo_chooser_hbox.PackStart(external_photo_chooser);
            external_photo_chooser.Show();
            external_photo_chooser.SelectionChanged += HandleExternalFileSelectionChanged;

            photo_scrolled_window.Add(image_view);

            if (query.Count > 0)
            {
                photo_spin_button.Wrap                     = true;
                photo_spin_button.Adjustment.Lower         = 1.0;
                photo_spin_button.Adjustment.Upper         = (double)query.Count;
                photo_spin_button.Adjustment.StepIncrement = 1.0;
                photo_spin_button.ValueChanged            += HandleSpinButtonChanged;

                image_view.Item.Index = 0;
            }
            else
            {
                from_photo_label.Markup = String.Format(Catalog.GetString(
                                                            "\n<b>From Photo</b>\n" +
                                                            " You can use one of your library photos as an icon for this tag.\n" +
                                                            " However, first you must have at least one photo associated\n" +
                                                            " with this tag. Please tag a photo as '{0}' and return here\n" +
                                                            " to use it as an icon."), t.Name);
                photo_scrolled_window.Visible = false;
                photo_label.Visible           = false;
                photo_spin_button.Visible     = false;
            }

            icon_store = new ListStore(typeof(string), typeof(Gdk.Pixbuf));

            icon_view = new Gtk.IconView(icon_store);
            icon_view.PixbufColumn      = 1;
            icon_view.SelectionMode     = SelectionMode.Single;
            icon_view.SelectionChanged += HandleIconSelectionChanged;

            icon_scrolled_window.Add(icon_view);

            icon_view.Show();

            image_view.Show();

            DelayedOperation fill_delay = new DelayedOperation(FillIconView);

            fill_delay.Start();
        }
コード例 #37
0
		public FullScreenView (IBrowsableCollection collection) : base ("Full Screen Mode")
		{
			Name = "FullscreenContainer";
			try {
				//scroll = new Gtk.ScrolledWindow (null, null);
				actions = new ActionGroup ("joe");
				
				actions.Add (new ActionEntry [] {
					new ActionEntry (HideToolbar, Stock.Close, 
							 Catalog.GetString ("Hide"), 
							 null, 
							 Catalog.GetString ("Hide Toolbar"), 
							 HideToolbarAction),
					new ActionEntry (ExitFullScreen, 
							 "f-spot-view-restore", 
							 Catalog.GetString ("Exit fullscreen"), 
							 null, 
							 null, 
							 ExitAction),
					new ActionEntry (SlideShow,
							 "f-spot-slideshow",
							 Catalog.GetString ("Slideshow"),
							 null,
							 Catalog.GetString ("Start slideshow"),
							 SlideShowAction),
						});

				actions.Add (new ToggleActionEntry [] {
					new ToggleActionEntry (Info,
							       Stock.Info,
							       Catalog.GetString ("Info"),
							       null,
							       Catalog.GetString ("Image Information"),
							       InfoAction,
							       false)
						});
				
				new Fader (this, 1.0, 3);
				notebook = new Notebook ();
				notebook.ShowBorder = false;
				notebook.ShowTabs = false;
				notebook.Show ();

				scroll = new ScrolledView ();
				view = new PhotoImageView (collection);
				// FIXME this should be handled by the new style setting code
				view.ModifyBg (Gtk.StateType.Normal, this.Style.Black);
				view.PointerMode = ImageView.PointerModeType.Scroll;
				this.Add (notebook);
				view.Show ();
				view.MotionNotifyEvent += HandleViewMotion;
				
				Action rotate_left = new RotateLeftAction (view.Item);
				actions.Add (rotate_left);
				
				Action rotate_right = new RotateRightAction (view.Item);
				actions.Add (rotate_right);

				scroll.ScrolledWindow.Add (view);
				HBox hhbox = new HBox ();
				hhbox.PackEnd (GetButton (HideToolbar), false, true, 0);
				hhbox.PackEnd (GetButton (Info), false, true, 0);
				hhbox.PackStart (GetButton (ExitFullScreen, true), false, false, 0);
				hhbox.PackStart (Add (new PreviousPictureAction (view.Item)), false, false, 0);
				hhbox.PackStart (GetButton (SlideShow), false, true, 0);
				hhbox.PackStart (Add (new NextPictureAction (view.Item)), false, false, 0);
				//hhbox.PackStart (Add (new AutoColor (view.Item)), false, false, 0);

				display = new TextureDisplay (view.Item);
				display.AddEvents ((int) (Gdk.EventMask.PointerMotionMask));
				display.ModifyBg (Gtk.StateType.Normal, this.Style.Black);
				display.MotionNotifyEvent += HandleViewMotion;
				Label effect = new Label (Catalog.GetString ("Slide transition: "));
				hhbox.PackStart (effect, false, false, 5);
				hhbox.PackStart (display.GetCombo (), false, false, 0);
				display.Show ();

				hhbox.PackStart (Add (new RotateLeftAction (view.Item)), false, false, 0);
				hhbox.PackStart (Add (new RotateRightAction (view.Item)), false, false, 0);
				hhbox.BorderWidth = 15;

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

				//display = new ImageDisplay (view.Item);

				notebook.AppendPage (scroll, null);
				notebook.AppendPage (display, null);

				hhbox.ShowAll ();
				//scroll.ShowControls ();
				
				scroll.Show ();
				this.Decorated = false;
				this.Fullscreen ();
				this.ButtonPressEvent += HandleButtonPressEvent;
				
				view.Item.Changed += HandleItemChanged;
				view.GrabFocus ();
				
				controls = new ControlOverlay (this);
				controls.Add (hhbox);
				controls.Dismiss ();

				notebook.CurrentPage = 0;
			} catch (System.Exception e) {
				System.Console.WriteLine (e);
			}	

		}
コード例 #38
0
		protected override void SetView (PhotoImageView value)
		{
			if (view != null) {
				view.ExposeEvent -= ExposeEvent;
				view.QueueDraw ();
			}

			base.SetView (value);

			if (value == null)
				return;

			view.ExposeEvent += ExposeEvent;
			view.QueueDraw ();
		}
コード例 #39
0
ファイル: ImportCommand.cs プロジェクト: iainlane/f-spot
    public int ImportFromFile(PhotoStore store, string path)
    {
        this.store = store;
        this.CreateDialog ("import_dialog");
        this.Dialog.TransientFor = main_window;
        this.Dialog.WindowPosition = Gtk.WindowPosition.CenterOnParent;
        this.Dialog.Response += HandleDialogResponse;
        this.Dialog.DefaultResponse = ResponseType.Ok;

        AllowFinish = false;

        LoadPreferences ();

        //import_folder_entry.Activated += HandleEntryActivate;
        duplicate_check.Toggled += HandleRecurseToggled;
        recurse_check.Toggled += HandleRecurseToggled;
        copy_check.Toggled += HandleRecurseToggled;

        menu = new SourceMenu (this);
        source_option_menu.Menu = menu;

        collection = new FSpot.PhotoList (new Photo [0]);
        tray = new ScalingIconView (collection);
        tray.Selection.Changed += HandleTraySelectionChanged;
        icon_scrolled.SetSizeRequest (400, 200);
        icon_scrolled.Add (tray);
        //icon_scrolled.Visible = false;
        tray.DisplayTags = false;
        tray.Show ();

        photo_view = new PhotoImageView (collection);
        photo_scrolled.Add (photo_view);
        photo_scrolled.SetSizeRequest (200, 200);
        photo_view.Show ();

        //GtkUtil.ModifyColors (frame_eventbox);
        GtkUtil.ModifyColors (photo_scrolled);
        GtkUtil.ModifyColors (photo_view);

        photo_view.Pixbuf = GtkUtil.TryLoadIcon (FSpot.Global.IconTheme, "f-spot", 128, (Gtk.IconLookupFlags)0);
        photo_view.ZoomFit (false);

        tag_entry = new FSpot.Widgets.TagEntry (MainWindow.Toplevel.Database.Tags, false);
        tag_entry.UpdateFromTagNames (new string []{});
        tagentry_box.Add (tag_entry);

        tag_entry.Show ();

        this.Dialog.Show ();

        //source_option_menu.Changed += HandleSourceChanged;
        if (path != null) {
            SetImportPath (path);
            int i = menu.FindItemPosition (path);

            if (i > 0) {
                source_option_menu.SetHistory ((uint)i);
            } else if (Directory.Exists (path)) {
                SourceItem path_item = new SourceItem (new VfsSource (path));
                menu.Prepend (path_item);
                path_item.ShowAll ();
                SetImportPath (path);
                source_option_menu.SetHistory (0);
            }
            idle_start.Start ();
        }

        ResponseType response = (ResponseType) this.Dialog.Run ();

        while (response == ResponseType.Ok) {
            try {
                if (Directory.Exists (this.ImportPath))
                    break;
            } catch (System.Exception e){
                System.Console.WriteLine (e);
                break;
            }

            HigMessageDialog md = new HigMessageDialog (this.Dialog,
                    DialogFlags.DestroyWithParent,
                MessageType.Error,
                ButtonsType.Ok,
                Catalog.GetString ("Directory does not exist."),
                String.Format (Catalog.GetString ("The directory you selected \"{0}\" does not exist.  " +
                                  "Please choose a different directory"), this.ImportPath));

            md.Run ();
            md.Destroy ();

            response = (Gtk.ResponseType) this.Dialog.Run ();
        }

        if (response == ResponseType.Ok) {
            this.UpdateTagStore (tag_entry.GetTypedTagNames ());
            SavePreferences ();
            this.Finish ();

            if (tags_selected != null && tags_selected.Count > 0) {
                for (int i = 0; i < collection.Count; i++) {
                    Photo p = collection [i] as Photo;

                    if (p == null)
                        continue;

                    p.AddTag ((Tag [])tags_selected.ToArray(typeof(Tag)));
                    store.Commit (p);
                }
            }

            int width, height;
            this.Dialog.GetSize (out width, out height);

            FSpot.Preferences.Set (FSpot.Preferences.IMPORT_WINDOW_WIDTH, width);
            FSpot.Preferences.Set (FSpot.Preferences.IMPORT_WINDOW_HEIGHT, height);
            FSpot.Preferences.Set (FSpot.Preferences.IMPORT_WINDOW_PANE_POSITION, import_hpaned.Position);

            this.Dialog.Destroy ();
            return collection.Count;
        } else {
            this.Cancel ();
            //this.Dialog.Destroy();
            return 0;
        }
    }
コード例 #40
0
#pragma warning restore 649

        public EditTagIconDialog(Db db, Tag t, Gtk.Window parent_window) : base("EditTagIconDialog.ui", "edit_tag_icon_dialog")
        {
            TransientFor = parent_window;
            Title        = Strings.EditIconForTagName(t.Name);

            // FIXME, Icon
            //preview_pixbuf = t.Icon;
            if (preview_pixbuf != null && ColorManagement.Profiles.TryGetValue(Preferences.Get <string> (Preferences.COLOR_MANAGEMENT_DISPLAY_PROFILE), out var screen_profile))
            {
                preview_image.Pixbuf = preview_pixbuf.Copy();
                ColorManagement.ApplyProfile(preview_image.Pixbuf, screen_profile);
            }
            else
            {
                preview_image.Pixbuf = preview_pixbuf;
            }

            query = new PhotoQuery(db.Photos);

            if (db.Tags.Hidden != null)
            {
                query.Terms = OrTerm.FromTags(new[] { t });
            }
            else
            {
                query.Terms = new Literal(t);
            }

            image_view = new PhotoImageView(query)
            {
                CropHelpers = false
            };
            image_view.SelectionXyRatio  = 1.0;
            image_view.SelectionChanged += HandleSelectionChanged;
            image_view.PhotoChanged     += HandlePhotoChanged;

            external_photo_chooser = new Gtk.FileChooserButton(Strings.SelectPhotoFromFile, Gtk.FileChooserAction.Open)
            {
                Filter = new FileFilter()
            };
            external_photo_chooser.Filter.AddPixbufFormats();
            external_photo_chooser.LocalOnly = false;
            external_photo_chooser_hbox.PackStart(external_photo_chooser);
            external_photo_chooser.Show();
            external_photo_chooser.SelectionChanged += HandleExternalFileSelectionChanged;

            photo_scrolled_window.Add(image_view);

            if (query.Count > 0)
            {
                photo_spin_button.Wrap                     = true;
                photo_spin_button.Adjustment.Lower         = 1.0;
                photo_spin_button.Adjustment.Upper         = query.Count;
                photo_spin_button.Adjustment.StepIncrement = 1.0;
                photo_spin_button.ValueChanged            += HandleSpinButtonChanged;

                image_view.Item.Index = 0;
            }
            else
            {
                from_photo_label.Markup       = string.Format($"\n<b>{Strings.FromPhoto}</b>\n{Strings.TagFromPhotoLabelMessage}", t.Name);
                photo_scrolled_window.Visible = false;
                photo_label.Visible           = false;
                photo_spin_button.Visible     = false;
            }

            icon_store = new ListStore(typeof(string), typeof(Gdk.Pixbuf));

            icon_view = new Gtk.IconView(icon_store)
            {
                PixbufColumn  = 1,
                SelectionMode = SelectionMode.Single
            };
            icon_view.SelectionChanged += HandleIconSelectionChanged;

            icon_scrolled_window.Add(icon_view);

            icon_view.Show();

            image_view.Show();

            //var fill_delay = new DelayedOperation (FillIconView);
            //fill_delay.Start ();
        }
コード例 #41
0
        void InitUI()
        {
            // Adjust constraints as needed
            PhotoImageViewHeightConstraint.Constant = ViewModel.ShowImage ? _photoImageViewDefaultHeightConstraint : 0;

            // Map values to UI elements
            BodyTextView.Text = null;
            BodyTextView.Text = ViewModel.Text;
            BodyTextViewHeightConstraint.Constant = BodyTextView.SizeThatFits(new CGSize(BodyTextView.Frame.Width, nfloat.MaxValue)).Height;
            TimeLabel.Text = ViewModel.ShowDateTime ? ViewModel.DisplayDateTime : string.Empty;
            NameLabel.SetHighlightText(ViewModel.UserName, ViewModel.UserName.IndexOf("@"), UIColor.LightGray);

            LikeButton.SetTitle(ViewModel.LikeButtonText, UIControlState.Normal);
            LikeButton.SetTitleColor(ViewModel.LikeButtonTextColor.ToUIColor(), UIControlState.Normal);

            CommentButton.SetTitle(ViewModel.CommentButtonText, UIControlState.Normal);
            CommentButton.SetTitleColor(ViewModel.CommentButtonTextColor.ToUIColor(), UIControlState.Normal);

            ShareButton.SetTitle(ViewModel.ShareButtonText, UIControlState.Normal);
            ShareButton.SetTitleColor(ViewModel.ShareButtonTextColor.ToUIColor(), UIControlState.Normal);

            if (ViewModel.ShowImage)
            {
                ActivityIndicator.StartAnimating();
            }
            else
            {
                ActivityIndicator.StopAnimating();
            }

            SocialTypeImageView.Image  = UIImage.FromBundle(ViewModel.SocialMediaImage);
            SocialTypeImageView.Hidden = !ViewModel.ShowSocialMediaImage;
            UserImageView.SetImage(
                url: new NSUrl(ViewModel.UserImageUrl),
                placeholder: UIImage.FromBundle(ViewModel.UserImagePlaceholder)
                );

            if (ViewModel.ShowImage)
            {
                PhotoImageView.SetImage(
                    url: new NSUrl(ViewModel.ImageUrl),
                    completionHandler: ((UIImage image, NSError error, SDImageCacheType cacheType, NSUrl imageUrl) => {
                    ActivityIndicator.StopAnimating();
                })
                    );
            }
            else
            {
                PhotoImageView.Image = null;
            }

            if (ViewModel.ShowTimeline)
            {
                ContainerViewLeadingConstraint.Constant = _containerViewTimelineLeadingConstraint;
                TimelineView.Hidden = false;
            }
            else
            {
                ContainerViewLeadingConstraint.Constant = _containerViewDefaultLeadingConstraint;
                TimelineView.Hidden = true;
            }

            CommentButton.Hidden = !ViewModel.ShowCommentButton;
            ShareButton.Hidden   = !ViewModel.ShowShareButton;

            // TODO: Remove this when we're ready to support sharing
            ShareButton.Hidden = true;
        }
コード例 #42
0
 public Editor(PhotoImageView view)
 {
     SetView(view);
 }
コード例 #43
0
 public SoftFocus(PhotoImageView view) : base(view)
 {
 }
コード例 #44
0
 public EffectEditor(PhotoImageView view) : base(view)
 {
 }
コード例 #45
0
        void ReleaseDesignerOutlets()
        {
            if (NewRestaurantCloseButton != null)
            {
                NewRestaurantCloseButton.Dispose();
                NewRestaurantCloseButton = null;
            }

            if (NewRestaurantSaveButton != null)
            {
                NewRestaurantSaveButton.Dispose();
                NewRestaurantSaveButton = null;
            }

            if (PhotoImageView != null)
            {
                PhotoImageView.Dispose();
                PhotoImageView = null;
            }

            if (RestaurantAddressLabel != null)
            {
                RestaurantAddressLabel.Dispose();
                RestaurantAddressLabel = null;
            }

            if (RestaurantAddressTextField != null)
            {
                RestaurantAddressTextField.Dispose();
                RestaurantAddressTextField = null;
            }

            if (RestaurantDescriptionLabel != null)
            {
                RestaurantDescriptionLabel.Dispose();
                RestaurantDescriptionLabel = null;
            }

            if (RestaurantDescriptionTextView != null)
            {
                RestaurantDescriptionTextView.Dispose();
                RestaurantDescriptionTextView = null;
            }

            if (RestaurantNameLabel != null)
            {
                RestaurantNameLabel.Dispose();
                RestaurantNameLabel = null;
            }

            if (RestaurantNameTextField != null)
            {
                RestaurantNameTextField.Dispose();
                RestaurantNameTextField = null;
            }

            if (RestaurantPhoneLabel != null)
            {
                RestaurantPhoneLabel.Dispose();
                RestaurantPhoneLabel = null;
            }

            if (RestaurantPhoneTextField != null)
            {
                RestaurantPhoneTextField.Dispose();
                RestaurantPhoneTextField = null;
            }

            if (RestaurantTypeLabel != null)
            {
                RestaurantTypeLabel.Dispose();
                RestaurantTypeLabel = null;
            }

            if (RestaurantTypeTextField != null)
            {
                RestaurantTypeTextField.Dispose();
                RestaurantTypeTextField = null;
            }
        }
コード例 #46
0
		public GlEditor (PhotoImageView view) : base (view)
		{
			transition = new GlTransition.Flip ();
		}