Skip to content

Commit

Permalink
LineEdit placeholder tweaks (#5153)
Browse files Browse the repository at this point in the history
* LineEdit focus tweaks

* Doing it the correct way

* Reviews
  • Loading branch information
AJCM-git authored May 21, 2024
1 parent 85f74c3 commit 512ebd8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Robust.Client/UserInterface/Controls/LineEdit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public class LineEdit : Control
private TimeSpan? _lastClickTime;
private Vector2? _lastClickPosition;

private bool IsPlaceHolderVisible => string.IsNullOrEmpty(_text) && _placeHolder != null;
private bool IsPlaceHolderVisible => !(HidePlaceHolderOnFocus && HasKeyboardFocus()) && string.IsNullOrEmpty(_text) && _placeHolder != null;

public event Action<LineEditEventArgs>? OnTextChanged;
public event Action<LineEditEventArgs>? OnTextEntered;
Expand Down Expand Up @@ -186,6 +186,8 @@ public int SelectionStart
public int SelectionLower => Math.Min(_selectionStart, _cursorPosition);
public int SelectionUpper => Math.Max(_selectionStart, _cursorPosition);

public bool HidePlaceHolderOnFocus { get; set; }

public bool IgnoreNext { get; set; }

private (int start, int length)? _imeData;
Expand Down

0 comments on commit 512ebd8

Please sign in to comment.