Skip to content

Commit

Permalink
Update ResizeCanvasDialog.cs (PintaProject#184)
Browse files Browse the repository at this point in the history
* Update ResizeCanvasDialog.cs

Сonstant aspect ratio is disabled by default, default anchor position moved to NW, changed default size from percent to absolute

* Update ResizeCanvasDialog.cs

Moved the percent resize type above; removed the commented-out line
  • Loading branch information
nikita-yfh authored Mar 21, 2021
1 parent fb8946a commit 30af578
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions Pinta/Dialogs/ResizeCanvasDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,7 @@ public ResizeCanvasDialog () : base (Catalog.GetString ("Resize Canvas"), PintaC
Build ();

Icon = PintaCore.Resources.GetIcon ("Menu.Image.CanvasSize.png");

aspectCheckbox.Active = true;


widthSpinner.Value = PintaCore.Workspace.ImageSize.Width;
heightSpinner.Value = PintaCore.Workspace.ImageSize.Height;

Expand All @@ -87,7 +85,7 @@ public ResizeCanvasDialog () : base (Catalog.GetString ("Resize Canvas"), PintaC
SButton.Clicked += HandleSButtonClicked;
SEButton.Clicked += HandleSEButtonClicked;

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

Expand Down Expand Up @@ -310,8 +308,8 @@ private void Build()
DefaultWidth = 300;
DefaultHeight = 200;

percentageRadio = new RadioButton (Catalog.GetString ("By percentage:"));
absoluteRadio = new RadioButton (percentageRadio, Catalog.GetString ("By absolute size:"));
absoluteRadio = new RadioButton (Catalog.GetString ("By absolute size:"));
percentageRadio = new RadioButton (absoluteRadio, Catalog.GetString ("By percentage:"));

percentageSpinner = new SpinButton (1, 1000, 1);
widthSpinner = new SpinButton (1, 10000, 1);
Expand All @@ -326,7 +324,6 @@ private void Build()
hbox_percent.PackStart (percentageRadio, true, true, 0);
hbox_percent.PackStart (percentageSpinner, false, false, 0);
hbox_percent.PackEnd (new Label ("%"), false, false, 0);
main_vbox.PackStart (hbox_percent, false, false, 0);

main_vbox.PackStart (absoluteRadio, false, false, 0);

Expand All @@ -344,6 +341,7 @@ private void Build()

main_vbox.PackStart (aspectCheckbox, false, false, 0);
main_vbox.PackStart (new HSeparator (), false, false, 0);
main_vbox.PackStart (hbox_percent, false, false, 0);

var align_label = new Label (Catalog.GetString ("Anchor:")) { Xalign = 0 };
main_vbox.PackStart (align_label, false, false, 0);
Expand Down Expand Up @@ -371,7 +369,7 @@ private void Build()

var grid_align = new Alignment (0.5f, 0.5f, 0, 0);
grid_align.Add (grid);

main_vbox.PackStart (grid_align, false, false, 0);

VBox.BorderWidth = 2;
Expand Down

0 comments on commit 30af578

Please sign in to comment.