Skip to content

Commit

Permalink
name button width
Browse files Browse the repository at this point in the history
  • Loading branch information
dimmik committed Apr 24, 2024
1 parent 992e496 commit 84b64b7
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions TCBlazor/Client/Components/PersonNameAndActions.razor
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
@inject IJSRuntime JsRuntime

<span>
<Button Type="@AntDesign.ButtonType.Dashed" @onclick=@(() => open = !open)>
@((MarkupString)GetNameText(full: open).AsBreakable(3))
<Button Type="@AntDesign.ButtonType.Dashed" @onclick=@(() => open = !open) Style="min-width: 160px">
@GetNameText(full: open)
</Button>
@if (open)
{
Expand Down Expand Up @@ -85,8 +85,21 @@
if (full) return nameText;
bool crop = nameText.Length > triggerLength;
nameText = nameText.Substring(0, crop ? triggerLength : nameText.Length) + (crop ? "" : "");
//if (nameText.Length < triggerLength) nameText = MakeFullLength(nameText, triggerLength);
return nameText;
}
private string MakeFullLength(string str, int len)
{
var symToAdd = len - str.Length;
if (symToAdd <= 0) return str;
var sym = "_";
var ret = str;
for (int i = 0; i < symToAdd; i++)
{
ret = ret + sym;
}
return ret;
}

RenderFragment TitleTemplate(bool deleting, int idx, Person person)
{
Expand Down

0 comments on commit 84b64b7

Please sign in to comment.