Beispiel #1
0
            static CloudsData()
            {
                BlendOps = new Dictionary <string, object> ();

                foreach (string name in UserBlendOps.GetAllBlendModeNames())
                {
                    BlendOps.Add(name, UserBlendOps.GetBlendModeByName(name));
                }
                defaultBlendOp = UserBlendOps.GetBlendModeName(Pinta.Core.BlendMode.Normal);
            }
Beispiel #2
0
        public LayerPropertiesDialog() : base(Translations.GetString("Layer Properties"),
                                              PintaCore.Chrome.MainWindow, DialogFlags.Modal,
                                              Core.GtkExtensions.DialogButtonsCancelOk())
        {
            var doc = PintaCore.Workspace.ActiveDocument;

            Build();

            IconName = Resources.Icons.LayerProperties;

            name      = doc.Layers.CurrentUserLayer.Name;
            hidden    = doc.Layers.CurrentUserLayer.Hidden;
            opacity   = doc.Layers.CurrentUserLayer.Opacity;
            blendmode = doc.Layers.CurrentUserLayer.BlendMode;

            initial_properties = new LayerProperties(
                name,
                hidden,
                opacity,
                blendmode);

            layerNameEntry.Text       = initial_properties.Name;
            visibilityCheckbox.Active = !initial_properties.Hidden;
            opacitySpinner.Value      = (int)(initial_properties.Opacity * 100);
            opacitySlider.Value       = (int)(initial_properties.Opacity * 100);

            var all_blendmodes = UserBlendOps.GetAllBlendModeNames().ToList();
            var index          = all_blendmodes.IndexOf(UserBlendOps.GetBlendModeName(blendmode));

            blendComboBox.Active = index;

            layerNameEntry.Changed      += OnLayerNameChanged;
            visibilityCheckbox.Toggled  += OnVisibilityToggled;
            opacitySpinner.ValueChanged += new EventHandler(OnOpacitySpinnerChanged);
            opacitySlider.ValueChanged  += new EventHandler(OnOpacitySliderChanged);
            blendComboBox.Changed       += OnBlendModeChanged;

            DefaultResponse = Gtk.ResponseType.Ok;

            layerNameEntry.ActivatesDefault = true;
            opacitySpinner.ActivatesDefault = true;
        }
Beispiel #3
0
        public LayerPropertiesDialog() : base(Mono.Unix.Catalog.GetString("Layer Properties"), PintaCore.Chrome.MainWindow, DialogFlags.Modal, Stock.Cancel, ResponseType.Cancel, Stock.Ok, ResponseType.Ok)
        {
            Build();

            this.Icon = PintaCore.Resources.GetIcon("Menu.Layers.LayerProperties.png");

            name      = PintaCore.Layers.CurrentLayer.Name;
            hidden    = PintaCore.Layers.CurrentLayer.Hidden;
            opacity   = PintaCore.Layers.CurrentLayer.Opacity;
            blendmode = PintaCore.Layers.CurrentLayer.BlendMode;

            initial_properties = new LayerProperties(
                name,
                hidden,
                opacity,
                blendmode);

            layerNameEntry.Text       = initial_properties.Name;
            visibilityCheckbox.Active = !initial_properties.Hidden;
            opacitySpinner.Value      = (int)(initial_properties.Opacity * 100);
            opacitySlider.Value       = (int)(initial_properties.Opacity * 100);

            var all_blendmodes = UserBlendOps.GetAllBlendModeNames().ToList();
            var index          = all_blendmodes.IndexOf(UserBlendOps.GetBlendModeName(blendmode));

            blendComboBox.Active = index;

            layerNameEntry.Changed      += OnLayerNameChanged;
            visibilityCheckbox.Toggled  += OnVisibilityToggled;
            opacitySpinner.ValueChanged += new EventHandler(OnOpacitySpinnerChanged);
            opacitySlider.ValueChanged  += new EventHandler(OnOpacitySliderChanged);
            blendComboBox.Changed       += OnBlendModeChanged;

            AlternativeButtonOrder = new int[] { (int)Gtk.ResponseType.Ok, (int)Gtk.ResponseType.Cancel };
            DefaultResponse        = Gtk.ResponseType.Ok;

            layerNameEntry.ActivatesDefault = true;
            opacitySpinner.ActivatesDefault = true;
        }