Skip to content

Commit

Permalink
Fixes for attribute dialog and color editor
Browse files Browse the repository at this point in the history
- Save attribute dialog bounds properly
- Set size of label in color editor properly
  • Loading branch information
cwensley committed Jan 30, 2021
1 parent b858bac commit 358166f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
18 changes: 10 additions & 8 deletions Source/Pablo/Formats/Character/Controls/AttributeDialog.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.ComponentModel;
using Eto.Drawing;
using Eto.Forms;

Expand Down Expand Up @@ -38,7 +39,7 @@ public AttributeDialog(CharacterHandler handler, Palette palette, Attribute attr
#if DESKTOP
this.Resizable = true;
#endif

TableLayout layout = new TableLayout(1, 2);

colours = new ColourSelection(palette, attribute);
Expand All @@ -52,15 +53,15 @@ public AttributeDialog(CharacterHandler handler, Palette palette, Attribute attr
Content = layout;
}

protected override void OnLoadComplete (EventArgs e)
protected override void OnLoadComplete(EventArgs e)
{
base.OnLoadComplete (e);
colours.Focus ();
base.OnLoadComplete(e);
Application.Instance.AsyncInvoke(colours.Focus);
}
protected override void OnClosed (EventArgs e)

protected override void OnClosing(CancelEventArgs e)
{
base.OnClosed (e);
base.OnClosing(e);
handler.CharacterDocument.Info.AttributeDialogBounds = this.RestoreBounds;
handler.CharacterDocument.Info.AttributeDialogSize = this.ClientSize;
}
Expand All @@ -73,7 +74,8 @@ void colours_Selected(object sender, EventArgs e)

private Control GenerateButtons()
{
TableLayout layout = new TableLayout(1,1) {
TableLayout layout = new TableLayout(1, 1)
{
Size = new Size(150, 28)
};
layout.Spacing = new Size(5, 5);
Expand Down
4 changes: 2 additions & 2 deletions Source/Pablo/Formats/Character/Controls/ColourEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,11 @@ public ColourEditor(CharacterHandler handler)
};
layout.Add(new Label
{
Text = "Double click a colour to change it. Note that most formats only support up to 16 colours, except for Tundra and Ansi format",
Text = "Double click a colour to change it.\nNote that most formats only support up to 16 colours, except for Tundra and Ansi format.",
Wrap = WrapMode.Word,
TextAlignment = TextAlignment.Center,
VerticalAlignment = VerticalAlignment.Center,
Width = 1, Height = Platform.IsWinForms ? 46 : -1
Width = 300
});

layout.BeginVertical(xscale: true, yscale: true);
Expand Down

0 comments on commit 358166f

Please sign in to comment.