Пример #1
0
		private void Activated (object sender, EventArgs e)
		{
			// TODO - allow the layer to be zoomed in or out
			
			var data = new RotateZoomData ();
			var dialog = new SimpleEffectDialog (Catalog.GetString ("Rotate / Zoom Layer"),
				PintaCore.Resources.GetIcon ("Menu.Layers.RotateZoom.png"), data,
			                                     new PintaLocalizer ());

            // When parameters are modified, update the display transform of the layer.
		    dialog.EffectDataChanged += (o, args) =>
		    {
		        var xform = ComputeMatrix (data);
		        var doc = PintaCore.Workspace.ActiveDocument;
		        doc.CurrentUserLayer.Transform.InitMatrix (xform);
		        PintaCore.Workspace.Invalidate ();
		    };

			int response = dialog.Run ();
		    ClearLivePreview ();
			if (response == (int)Gtk.ResponseType.Ok && !data.IsDefault)
				ApplyTransform (data);

			dialog.Destroy ();
		}
Пример #2
0
		/// <summary>
		/// Helper function for the above methods. The IAddinLocalizer provides a generic way to
		/// get translated strings both for Pinta's effects and for effect add-ins.
		/// </summary>
		private static bool LaunchSimpleEffectDialog (BaseEffect effect, IAddinLocalizer localizer)
		{
			if (effect == null)
				throw new ArgumentNullException ("effect");
			
			if (effect.EffectData == null)
				throw new ArgumentException ("effect.EffectData is null.");
			
			var dialog = new SimpleEffectDialog (effect.Name,
			                                     PintaCore.Resources.GetIcon (effect.Icon),
			                                     effect.EffectData, localizer);
			
			// Hookup event handling for live preview.
			dialog.EffectDataChanged += (o, e) => {
				if (effect.EffectData != null)
					effect.EffectData.FirePropertyChanged (e.PropertyName);
			};
			
			int response = dialog.Run ();

			bool ret = false;
			if (response == (int)Gtk.ResponseType.Ok && effect.EffectData != null)
				ret = !effect.EffectData.IsDefault;

			dialog.Destroy ();

			return ret;
		}
Пример #3
0
        public override bool LaunchConfiguration()
        {
            SimpleEffectDialog dialog = new SimpleEffectDialog (Text, PintaCore.Resources.GetIcon (Icon), Data);

            int response = dialog.Run ();

            if (response == (int)Gtk.ResponseType.Ok) {
                dialog.Destroy ();
                return true;
            }

            dialog.Destroy ();

            return false;
        }
Пример #4
0
        private void Activated(object sender, EventArgs e)
        {
            // TODO - allow the layer to be zoomed in or out
            // TODO - show a live preview of the rotation

            var rotateZoomData = new RotateZoomData ();
            var dialog = new SimpleEffectDialog (Catalog.GetString ("Rotate / Zoom Layer"),
                PintaCore.Resources.GetIcon ("Menu.Layers.RotateZoom.png"), rotateZoomData);

            int response = dialog.Run ();

            if (response == (int)Gtk.ResponseType.Ok && !rotateZoomData.IsDefault)
            {
                DoRotate (rotateZoomData);
            }

            dialog.Destroy ();
        }
Пример #5
0
		public override bool LaunchConfiguration ()
		{
			SimpleEffectDialog dialog = new SimpleEffectDialog (Name, PintaCore.Resources.GetIcon (Icon), Data,
			                                                    new PintaLocalizer ());

			// Hookup event handling for live preview.
			dialog.EffectDataChanged += (o, e) => {
				if (EffectData != null) {
					op = new UnaryPixelOps.RedEyeRemove (Data.Tolerance, Data.Saturation);
					EffectData.FirePropertyChanged (e.PropertyName);
				}
			};
			
			int response = dialog.Run ();
			bool ret = (response == (int)Gtk.ResponseType.Ok);
			dialog.Destroy ();
			
			return ret;
		}
Пример #6
0
        public override bool LaunchConfiguration()
        {
            HueSaturationData data = new HueSaturationData ();
            SimpleEffectDialog dialog = new SimpleEffectDialog (Text, PintaCore.Resources.GetIcon (Icon), data);

            int response = dialog.Run ();

            if (response == (int)Gtk.ResponseType.Ok) {
                hue_delta = data.Hue;
                sat_delta = data.Saturation;
                lightness = data.Lightness;

                dialog.Destroy ();

                // Don't trigger anything if no options were changed
                return !data.IsDefault;
            }

            dialog.Destroy ();

            return false;
        }
Пример #7
0
        public override bool LaunchConfiguration()
        {
            Data = new BrightnessContrastData ();
            SimpleEffectDialog dialog = new SimpleEffectDialog (Text, PintaCore.Resources.GetIcon (Icon), Data);

            int response = dialog.Run ();

            if (response == (int)Gtk.ResponseType.Ok) {
                dialog.Destroy ();

                // Don't trigger anything if no options were changed
                return !Data.IsDefault;
            }

            dialog.Destroy ();

            return false;
        }