示例#1
0
        private void HandlePintaCoreActionsLayersPropertiesActivated(object sender, EventArgs e)
        {
            LayerPropertiesDialog dialog = new LayerPropertiesDialog ();

            int response = dialog.Run ();

            if (response == (int)Gtk.ResponseType.Ok) {
                dialog.SaveChanges ();
                PintaCore.Workspace.Invalidate ();
            }

            dialog.Destroy ();
        }
示例#2
0
        private void HandlePintaCoreActionsLayersPropertiesActivated(object sender, EventArgs e)
        {
            var dialog = new LayerPropertiesDialog ();

            int response = dialog.Run ();

            if (response == (int)Gtk.ResponseType.Ok
                && dialog.AreLayerPropertiesUpdated) {

                var historyMessage = GetLayerPropertyUpdateMessage(
                        dialog.InitialLayerProperties,
                        dialog.UpdatedLayerProperties);

                var historyItem = new UpdateLayerPropertiesHistoryItem(
                    "Menu.Layers.LayerProperties.png",
                    historyMessage,
                    PintaCore.Layers.CurrentLayerIndex,
                    dialog.InitialLayerProperties,
                    dialog.UpdatedLayerProperties);

                PintaCore.Workspace.ActiveWorkspace.History.PushNewItem (historyItem);

                PintaCore.Workspace.ActiveWorkspace.Invalidate ();

            } else {

                var layer = PintaCore.Workspace.ActiveDocument.CurrentLayer;
                var initial = dialog.InitialLayerProperties;
                initial.SetProperties (layer);

                if (layer.Opacity != initial.Opacity)
                    PintaCore.Workspace.ActiveWorkspace.Invalidate ();
            }

            dialog.Destroy ();
        }