Simplify layout ZeroSpace -> Filler

This commit is contained in:
Ben Olden-Cooligan 2022-10-22 20:30:14 -07:00
parent f100479401
commit 895ff04ef7
6 changed files with 14 additions and 21 deletions

View File

@ -76,14 +76,11 @@ public static class C
}
/// <summary>
/// Creates a null placeholder for Eto layouts.
///
/// For example, it can be added to a row or column to absorb scaling.
/// If it isn't at the end of the row/column, it must be annotated with .XScale() or .YScale().
/// Creates a null placeholder for Eto layouts that absorbs scaling.
/// </summary>
/// <returns></returns>
public static ControlWithLayoutAttributes ZeroSpace() =>
new ControlWithLayoutAttributes(null);
public static ControlWithLayoutAttributes Filler() =>
new ControlWithLayoutAttributes(null).XScale().YScale();
/// <summary>
/// Creates an label of default height to be used as a visual paragraph separator.

View File

@ -52,10 +52,10 @@ public class AboutForm : EtoDialogBase
L.Row(
L.Column(
C.NoWrap(string.Format(MiscResources.Version, AssemblyHelper.Version)),
C.Link(NAPS2_HOMEPAGE)
C.UrlLink(NAPS2_HOMEPAGE)
),
L.Column(
C.ZeroSpace().YScale(),
C.Filler(),
_donateButton
).Padding(left: 10)
),
@ -68,14 +68,13 @@ public class AboutForm : EtoDialogBase
L.Row(
L.Column(
C.NoWrap(UiStrings.IconsFrom),
C.Link(ICONS_HOMEPAGE)
C.UrlLink(ICONS_HOMEPAGE)
).XScale(),
L.Column(
C.ZeroSpace().YScale(),
C.Filler(),
C.Button(UiStrings.OK, Close)
).Padding(left: 20)
),
C.ZeroSpace()
)
)
);
}

View File

@ -152,13 +152,12 @@ public class EditProfileForm : EtoDialogBase
),
L.Row(
_enableAutoSave,
_autoSaveSettings,
C.ZeroSpace().XScale()
_autoSaveSettings
),
C.ZeroSpace().YScale(),
C.Filler(),
L.Row(
_advanced,
C.ZeroSpace().XScale(),
C.Filler(),
_ok,
_cancel
)

View File

@ -138,8 +138,7 @@ public class ProfilesForm : EtoDialogBase
L.Row(
C.Button(_addCommand, ButtonImagePosition.Left),
C.Button(_editCommand, ButtonImagePosition.Left),
C.Button(_deleteCommand, ButtonImagePosition.Left),
C.ZeroSpace().XScale()
C.Button(_deleteCommand, ButtonImagePosition.Left)
)
),
C.Button(UiStrings.Done, Close)

View File

@ -31,7 +31,7 @@ public class ProgressForm : EtoDialogBase
_progressBar.Size(420, 40),
L.Row(
_numeric,
C.ZeroSpace().XScale(),
C.Filler(),
_runInBg,
_cancel
)

View File

@ -37,8 +37,7 @@ public class SelectDeviceForm : EtoDialogBase
_devices.NaturalSize(150, 100).XScale(),
L.Column(
selectButton,
cancelButton,
C.ZeroSpace().YScale()
cancelButton
)
);
}