Skip to content

Commit

Permalink
File-scoped namespace for OffsetSelectionDialog.cs (#821)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lehonti authored May 31, 2024
1 parent 0635255 commit 97eb3ac
Showing 1 changed file with 30 additions and 31 deletions.
61 changes: 30 additions & 31 deletions Pinta/Dialogs/OffsetSelectionDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,45 +28,44 @@
using Pinta.Core;
using Pinta.Gui.Widgets;

namespace Pinta
namespace Pinta;

public sealed class OffsetSelectionDialog : Dialog
{
public class OffsetSelectionDialog : Dialog
{
private HScaleSpinButtonWidget offset_spinbox;
private readonly HScaleSpinButtonWidget offset_spinbox;

public int Offset => offset_spinbox.ValueAsInt;
public int Offset => offset_spinbox.ValueAsInt;

public OffsetSelectionDialog ()
{
Title = Translations.GetString ("Offset Selection");
TransientFor = PintaCore.Chrome.MainWindow;
Modal = true;
this.AddCancelOkButtons ();
this.SetDefaultResponse (ResponseType.Ok);
public OffsetSelectionDialog ()
{
Title = Translations.GetString ("Offset Selection");
TransientFor = PintaCore.Chrome.MainWindow;
Modal = true;
this.AddCancelOkButtons ();
this.SetDefaultResponse (ResponseType.Ok);

Resizable = false;
Resizable = false;

var content_area = this.GetContentAreaBox ();
content_area.WidthRequest = 400;
content_area.SetAllMargins (6);
content_area.Spacing = 6;
var content_area = this.GetContentAreaBox ();
content_area.WidthRequest = 400;
content_area.SetAllMargins (6);
content_area.Spacing = 6;

offset_spinbox = new HScaleSpinButtonWidget {
Label = Translations.GetString ("Offset")
};
InitSpinBox (offset_spinbox);
content_area.Append (offset_spinbox);
offset_spinbox = new HScaleSpinButtonWidget {
Label = Translations.GetString ("Offset")
};
InitSpinBox (offset_spinbox);
content_area.Append (offset_spinbox);

DefaultWidth = 400;
DefaultHeight = 100;
}
DefaultWidth = 400;
DefaultHeight = 100;
}

private static void InitSpinBox (HScaleSpinButtonWidget spinbox)
{
spinbox.DefaultValue = 0;
spinbox.MaximumValue = 100;
spinbox.MinimumValue = -100;
}
private static void InitSpinBox (HScaleSpinButtonWidget spinbox)
{
spinbox.DefaultValue = 0;
spinbox.MaximumValue = 100;
spinbox.MinimumValue = -100;
}
}

0 comments on commit 97eb3ac

Please sign in to comment.