예제 #1
0
        public LevelsDialog(LevelsData effectData) : base(Translations.GetString("Levels Adjustment"),
                                                          PintaCore.Chrome.MainWindow, DialogFlags.Modal)
        {
            Build();

            EffectData = effectData;
            mask       = new bool[] { true, true, true };

            UpdateInputHistogram();
            Reset();
            UpdateLevels();

            checkRed.Toggled                   += HandleCheckRedToggled;
            checkGreen.Toggled                 += HandleCheckGreenToggled;
            checkBlue.Toggled                  += HandleCheckBlueToggled;
            buttonReset.Clicked                += HandleButtonResetClicked;
            buttonAuto.Clicked                 += HandleButtonAutoClicked;
            spinInLow.ValueChanged             += HandleSpinInLowValueChanged;
            spinInHigh.ValueChanged            += HandleSpinInHighValueChanged;
            spinOutLow.ValueChanged            += HandleSpinOutLowValueChanged;
            spinOutGamma.ValueChanged          += HandleSpinOutGammaValueChanged;
            spinOutHigh.ValueChanged           += HandleSpinOutHighValueChanged;
            gradientInput.ValueChanged         += HandleGradientInputValueChanged;
            gradientOutput.ValueChanged        += HandleGradientOutputValueChanged;
            gradientInput.ButtonReleaseEvent   += HandleGradientButtonReleaseEvent;
            gradientOutput.ButtonReleaseEvent  += HandleGradientButtonReleaseEvent;
            gradientInput.ButtonPressEvent     += HandleGradientButtonPressEvent;
            gradientOutput.ButtonPressEvent    += HandleGradientButtonPressEvent;
            colorpanelInLow.ButtonPressEvent   += HandleColorPanelButtonPressEvent;
            colorpanelInHigh.ButtonPressEvent  += HandleColorPanelButtonPressEvent;
            colorpanelOutLow.ButtonPressEvent  += HandleColorPanelButtonPressEvent;
            colorpanelOutHigh.ButtonPressEvent += HandleColorPanelButtonPressEvent;

            DefaultResponse               = ResponseType.Ok;
            spinInLow.ActivatesDefault    = true;
            spinInHigh.ActivatesDefault   = true;
            spinOutGamma.ActivatesDefault = true;
            spinOutLow.ActivatesDefault   = true;
            spinOutHigh.ActivatesDefault  = true;
        }
예제 #2
0
 public LevelsEffect()
 {
     EffectData = new LevelsData();
 }
예제 #3
0
        public LevelsDialog(LevelsData effectData) : base(Catalog.GetString("Levels Adjustment"),
                                                          PintaCore.Chrome.MainWindow, DialogFlags.Modal)
        {
            this.Build();

            EffectData = effectData;
            mask       = new bool[] { true, true, true };

            this.HasSeparator = false;
            //hack allowing adding hbox with rgb checkboxes into dialog action area
            VBox.Remove(hboxBottom);
            foreach (Widget widget in hboxBottom)
            {
                hboxBottom.Remove(widget);
                if (widget == buttonOk)
                {
                    AddActionWidget(widget, ResponseType.Ok);
                }
                else
                {
                    AddActionWidget(widget, ResponseType.None);
                }
            }

            UpdateInputHistogram();
            Reset();
            UpdateLevels();

            checkRed.Toggled                   += HandleCheckRedToggled;
            checkGreen.Toggled                 += HandleCheckGreenToggled;
            checkBlue.Toggled                  += HandleCheckBlueToggled;
            buttonReset.Clicked                += HandleButtonResetClicked;
            buttonAuto.Clicked                 += HandleButtonAutoClicked;
            buttonCancel.Clicked               += HandleButtonCancelClicked;
            buttonOk.Clicked                   += HandleButtonOkClicked;
            spinInLow.ValueChanged             += HandleSpinInLowValueChanged;
            spinInHigh.ValueChanged            += HandleSpinInHighValueChanged;
            spinOutLow.ValueChanged            += HandleSpinOutLowValueChanged;
            spinOutGamma.ValueChanged          += HandleSpinOutGammaValueChanged;
            spinOutHigh.ValueChanged           += HandleSpinOutHighValueChanged;
            gradientInput.ValueChanged         += HandleGradientInputValueChanged;
            gradientOutput.ValueChanged        += HandleGradientOutputValueChanged;
            gradientInput.ButtonReleaseEvent   += HandleGradientButtonReleaseEvent;
            gradientOutput.ButtonReleaseEvent  += HandleGradientButtonReleaseEvent;
            gradientInput.ButtonPressEvent     += HandleGradientButtonPressEvent;
            gradientOutput.ButtonPressEvent    += HandleGradientButtonPressEvent;
            colorpanelInLow.ButtonPressEvent   += HandleColorPanelButtonPressEvent;
            colorpanelInHigh.ButtonPressEvent  += HandleColorPanelButtonPressEvent;
            colorpanelOutLow.ButtonPressEvent  += HandleColorPanelButtonPressEvent;
            colorpanelOutHigh.ButtonPressEvent += HandleColorPanelButtonPressEvent;

            if (Gtk.Global.AlternativeDialogButtonOrder(this.Screen))
            {
                hboxBottom.ReorderChild(buttonCancel, 0);
            }

            buttonOk.CanDefault           = true;
            DefaultResponse               = ResponseType.Ok;
            spinInLow.ActivatesDefault    = true;
            spinInHigh.ActivatesDefault   = true;
            spinOutGamma.ActivatesDefault = true;
            spinOutLow.ActivatesDefault   = true;
            spinOutHigh.ActivatesDefault  = true;
        }