Skip to content

Commit

Permalink
Added spacer item
Browse files Browse the repository at this point in the history
  • Loading branch information
justalemon committed Dec 16, 2023
1 parent 3f36b63 commit 258deb9
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions LemonUI/Menus/NativeSpacerItem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
using System.Drawing;
using GTA.UI;

Check failure on line 2 in LemonUI/Menus/NativeSpacerItem.cs

View workflow job for this annotation

GitHub Actions / lint-and-compile (Debug)

The type or namespace name 'GTA' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 2 in LemonUI/Menus/NativeSpacerItem.cs

View workflow job for this annotation

GitHub Actions / lint-and-compile (Debug)

The type or namespace name 'GTA' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 2 in LemonUI/Menus/NativeSpacerItem.cs

View workflow job for this annotation

GitHub Actions / lint-and-compile (Debug)

The type or namespace name 'GTA' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 2 in LemonUI/Menus/NativeSpacerItem.cs

View workflow job for this annotation

GitHub Actions / lint-and-compile (Debug)

The type or namespace name 'GTA' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 2 in LemonUI/Menus/NativeSpacerItem.cs

View workflow job for this annotation

GitHub Actions / lint-and-compile (Debug)

The type or namespace name 'GTA' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 2 in LemonUI/Menus/NativeSpacerItem.cs

View workflow job for this annotation

GitHub Actions / lint-and-compile (Debug)

The type or namespace name 'GTA' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 2 in LemonUI/Menus/NativeSpacerItem.cs

View workflow job for this annotation

GitHub Actions / lint-and-compile (Debug)

The type or namespace name 'GTA' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 2 in LemonUI/Menus/NativeSpacerItem.cs

View workflow job for this annotation

GitHub Actions / lint-and-compile (Debug)

The type or namespace name 'GTA' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 2 in LemonUI/Menus/NativeSpacerItem.cs

View workflow job for this annotation

GitHub Actions / lint-and-compile (Debug)

The type or namespace name 'GTA' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 2 in LemonUI/Menus/NativeSpacerItem.cs

View workflow job for this annotation

GitHub Actions / lint-and-compile (Debug)

The type or namespace name 'GTA' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 2 in LemonUI/Menus/NativeSpacerItem.cs

View workflow job for this annotation

GitHub Actions / lint-and-compile (Release)

The type or namespace name 'GTA' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 2 in LemonUI/Menus/NativeSpacerItem.cs

View workflow job for this annotation

GitHub Actions / lint-and-compile (Release)

The type or namespace name 'GTA' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 2 in LemonUI/Menus/NativeSpacerItem.cs

View workflow job for this annotation

GitHub Actions / lint-and-compile (Release)

The type or namespace name 'GTA' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 2 in LemonUI/Menus/NativeSpacerItem.cs

View workflow job for this annotation

GitHub Actions / lint-and-compile (Release)

The type or namespace name 'GTA' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 2 in LemonUI/Menus/NativeSpacerItem.cs

View workflow job for this annotation

GitHub Actions / lint-and-compile (Release)

The type or namespace name 'GTA' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 2 in LemonUI/Menus/NativeSpacerItem.cs

View workflow job for this annotation

GitHub Actions / lint-and-compile (Release)

The type or namespace name 'GTA' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 2 in LemonUI/Menus/NativeSpacerItem.cs

View workflow job for this annotation

GitHub Actions / lint-and-compile (Release)

The type or namespace name 'GTA' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 2 in LemonUI/Menus/NativeSpacerItem.cs

View workflow job for this annotation

GitHub Actions / lint-and-compile (Release)

The type or namespace name 'GTA' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 2 in LemonUI/Menus/NativeSpacerItem.cs

View workflow job for this annotation

GitHub Actions / lint-and-compile (Release)

The type or namespace name 'GTA' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 2 in LemonUI/Menus/NativeSpacerItem.cs

View workflow job for this annotation

GitHub Actions / lint-and-compile (Release)

The type or namespace name 'GTA' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 2 in LemonUI/Menus/NativeSpacerItem.cs

View workflow job for this annotation

GitHub Actions / lint-and-compile (Debug)

The type or namespace name 'GTA' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 2 in LemonUI/Menus/NativeSpacerItem.cs

View workflow job for this annotation

GitHub Actions / lint-and-compile (Debug)

The type or namespace name 'GTA' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 2 in LemonUI/Menus/NativeSpacerItem.cs

View workflow job for this annotation

GitHub Actions / lint-and-compile (Debug)

The type or namespace name 'GTA' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 2 in LemonUI/Menus/NativeSpacerItem.cs

View workflow job for this annotation

GitHub Actions / lint-and-compile (Debug)

The type or namespace name 'GTA' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 2 in LemonUI/Menus/NativeSpacerItem.cs

View workflow job for this annotation

GitHub Actions / lint-and-compile (Debug)

The type or namespace name 'GTA' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 2 in LemonUI/Menus/NativeSpacerItem.cs

View workflow job for this annotation

GitHub Actions / lint-and-compile (Debug)

The type or namespace name 'GTA' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 2 in LemonUI/Menus/NativeSpacerItem.cs

View workflow job for this annotation

GitHub Actions / lint-and-compile (Debug)

The type or namespace name 'GTA' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 2 in LemonUI/Menus/NativeSpacerItem.cs

View workflow job for this annotation

GitHub Actions / lint-and-compile (Debug)

The type or namespace name 'GTA' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 2 in LemonUI/Menus/NativeSpacerItem.cs

View workflow job for this annotation

GitHub Actions / lint-and-compile (Debug)

The type or namespace name 'GTA' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 2 in LemonUI/Menus/NativeSpacerItem.cs

View workflow job for this annotation

GitHub Actions / lint-and-compile (Debug)

The type or namespace name 'GTA' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 2 in LemonUI/Menus/NativeSpacerItem.cs

View workflow job for this annotation

GitHub Actions / lint-and-compile (Release)

The type or namespace name 'GTA' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 2 in LemonUI/Menus/NativeSpacerItem.cs

View workflow job for this annotation

GitHub Actions / lint-and-compile (Release)

The type or namespace name 'GTA' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 2 in LemonUI/Menus/NativeSpacerItem.cs

View workflow job for this annotation

GitHub Actions / lint-and-compile (Release)

The type or namespace name 'GTA' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 2 in LemonUI/Menus/NativeSpacerItem.cs

View workflow job for this annotation

GitHub Actions / lint-and-compile (Release)

The type or namespace name 'GTA' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 2 in LemonUI/Menus/NativeSpacerItem.cs

View workflow job for this annotation

GitHub Actions / lint-and-compile (Release)

The type or namespace name 'GTA' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 2 in LemonUI/Menus/NativeSpacerItem.cs

View workflow job for this annotation

GitHub Actions / lint-and-compile (Release)

The type or namespace name 'GTA' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 2 in LemonUI/Menus/NativeSpacerItem.cs

View workflow job for this annotation

GitHub Actions / lint-and-compile (Release)

The type or namespace name 'GTA' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 2 in LemonUI/Menus/NativeSpacerItem.cs

View workflow job for this annotation

GitHub Actions / lint-and-compile (Release)

The type or namespace name 'GTA' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 2 in LemonUI/Menus/NativeSpacerItem.cs

View workflow job for this annotation

GitHub Actions / lint-and-compile (Release)

The type or namespace name 'GTA' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 2 in LemonUI/Menus/NativeSpacerItem.cs

View workflow job for this annotation

GitHub Actions / lint-and-compile (Release)

The type or namespace name 'GTA' could not be found (are you missing a using directive or an assembly reference?)

namespace LemonUI.Menus
{
/// <summary>
/// An item used to have a space between the items with text.
/// </summary>
public class NativeSpacerItem : NativeItem
{
#region Constructor

/// <summary>
/// Creates a new Spacer with no text.
/// </summary>
public NativeSpacerItem() : this(string.Empty)
{
}
/// <summary>
/// Creates a new Spacer with a specific title.
/// </summary>
/// <param name="title">The title of the item.</param>
public NativeSpacerItem(string title) : base(title, string.Empty, string.Empty)
{
this.title.Alignment = Alignment.Center;
}

#endregion

#region Function

/// <inheritdoc/>
public override void Recalculate(PointF pos, SizeF size, bool selected)
{
base.Recalculate(pos, size, selected);

title.Position = new PointF(pos.X + (size.Width * 0.5f), title.Position.Y);
}
/// <inheritdoc/>
public override void Draw()
{
title.Draw();
}

#endregion
}
}

0 comments on commit 258deb9

Please sign in to comment.