mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2025-02-17 05:18:27 +00:00
better 'Clear' button
This commit is contained in:
parent
d58482d524
commit
5bdcf84ee0
2 changed files with 7 additions and 3 deletions
|
@ -239,7 +239,7 @@ namespace SanAndreasUnity.UI
|
|||
|
||||
GUILayout.BeginHorizontal ();
|
||||
|
||||
if (GUILayout.Button (s_clearLabel, GUILayout.Width(80), GUILayout.Height(25)))
|
||||
if (Utilities.GUIUtils.ButtonWithCalculatedSize (s_clearLabel))
|
||||
{
|
||||
m_logs.Clear();
|
||||
m_selectedLogIndex = -1;
|
||||
|
|
|
@ -82,10 +82,14 @@ namespace SanAndreasUnity.Utilities
|
|||
}
|
||||
|
||||
public static bool ButtonWithCalculatedSize( string text ) {
|
||||
return ButtonWithCalculatedSize(new GUIContent(text));
|
||||
}
|
||||
|
||||
Vector2 size = CalcScreenSizeForText (text, GUI.skin.button);
|
||||
public static bool ButtonWithCalculatedSize(GUIContent content)
|
||||
{
|
||||
Vector2 size = CalcScreenSizeForContent (content, GUI.skin.button);
|
||||
|
||||
return GUILayout.Button (text, GUILayout.Width (size.x), GUILayout.Height (size.y));
|
||||
return GUILayout.Button (content, GUILayout.Width (size.x), GUILayout.Height (size.y));
|
||||
}
|
||||
|
||||
public static bool ButtonWithColor( Rect rect, string text, Color color) {
|
||||
|
|
Loading…
Add table
Reference in a new issue