mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-30 09:47:58 +01:00
AlignmentModes -> GenerateEnumExtensionMethods
This commit is contained in:
@@ -88,12 +88,12 @@ public class Aligner : INotifyPropertyChanged
|
||||
}
|
||||
|
||||
var sizesCopy = sizes;
|
||||
if (alignmentMode.HasFlag (AlignmentModes.EndToStart))
|
||||
if (alignmentMode.FastHasFlags (AlignmentModes.EndToStart))
|
||||
{
|
||||
sizesCopy = sizes.Reverse ().ToArray ();
|
||||
}
|
||||
|
||||
int maxSpaceBetweenItems = alignmentMode.HasFlag (AlignmentModes.AddSpaceBetweenItems) ? 1 : 0;
|
||||
int maxSpaceBetweenItems = alignmentMode.FastHasFlags (AlignmentModes.AddSpaceBetweenItems) ? 1 : 0;
|
||||
int totalItemsSize = sizes.Sum ();
|
||||
int totalGaps = sizes.Length - 1; // total gaps between items
|
||||
int totalItemsAndSpaces = totalItemsSize + totalGaps * maxSpaceBetweenItems; // total size of items and spacesToGive if we had enough room
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
using Terminal.Gui.Analyzers.Internal.Attributes;
|
||||
|
||||
namespace Terminal.Gui;
|
||||
|
||||
/// <summary>
|
||||
/// Determines the position of items when arranged in a container.
|
||||
/// </summary>
|
||||
[GenerateEnumExtensionMethods (FastHasFlags = true)]
|
||||
|
||||
public enum Alignment
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -6,6 +6,7 @@ namespace Terminal.Gui;
|
||||
/// Determines alignment modes for <see cref="Alignment"/>.
|
||||
/// </summary>
|
||||
[Flags]
|
||||
[GenerateEnumExtensionMethods (FastHasFlags = true)]
|
||||
public enum AlignmentModes
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user