mirror of
https://github.com/Caraxi/mare.client.git
synced 2025-12-12 20:07:21 +01:00
Child removed to be able to display buttons with icon and text also in tables
This commit is contained in:
parent
ae44599db0
commit
3efd198c6c
1 changed files with 10 additions and 14 deletions
|
|
@ -605,23 +605,19 @@ public class UiShared : IDisposable
|
||||||
var buttonSizeY = (iconSize.Y > textSize.Y ? iconSize.Y : textSize.Y) + padding.Y * 2;
|
var buttonSizeY = (iconSize.Y > textSize.Y ? iconSize.Y : textSize.Y) + padding.Y * 2;
|
||||||
var buttonSize = new Vector2(buttonSizeX, buttonSizeY);
|
var buttonSize = new Vector2(buttonSizeX, buttonSizeY);
|
||||||
|
|
||||||
if (ImGui.BeginChild(icon.ToIconString() + text, buttonSize))
|
if (ImGui.Button("###" + icon.ToIconString() + text, buttonSize))
|
||||||
{
|
{
|
||||||
if (ImGui.Button("", buttonSize))
|
buttonClicked = true;
|
||||||
{
|
|
||||||
buttonClicked = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
ImGui.SameLine();
|
|
||||||
ImGui.SetCursorPosX(padding.X);
|
|
||||||
ImGui.PushFont(UiBuilder.IconFont);
|
|
||||||
ImGui.Text(icon.ToIconString());
|
|
||||||
ImGui.PopFont();
|
|
||||||
ImGui.SameLine();
|
|
||||||
ImGui.Text(text);
|
|
||||||
ImGui.EndChild();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ImGui.SameLine();
|
||||||
|
ImGui.SetCursorPosX(ImGui.GetCursorPosX() - buttonSize.X - padding.X);
|
||||||
|
ImGui.PushFont(UiBuilder.IconFont);
|
||||||
|
ImGui.Text(icon.ToIconString());
|
||||||
|
ImGui.PopFont();
|
||||||
|
ImGui.SameLine();
|
||||||
|
ImGui.Text(text);
|
||||||
|
|
||||||
return buttonClicked;
|
return buttonClicked;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue