mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2025-02-17 05:18:27 +00:00
set button height to 25 in file browser
This commit is contained in:
parent
cefcf20510
commit
841f620fa9
1 changed files with 18 additions and 3 deletions
|
@ -111,6 +111,17 @@ public class FileBrowser {
|
|||
}
|
||||
protected GUIStyle m_centredText;
|
||||
|
||||
protected GUIStyle m_buttonStyle;
|
||||
protected GUIStyle ButtonStyle {
|
||||
get {
|
||||
if (null == m_buttonStyle) {
|
||||
m_buttonStyle = new GUIStyle(GUI.skin.button);
|
||||
m_buttonStyle.fixedHeight = 25;
|
||||
}
|
||||
return m_buttonStyle;
|
||||
}
|
||||
}
|
||||
|
||||
protected string m_name;
|
||||
protected Rect m_screenRect;
|
||||
|
||||
|
@ -289,7 +300,7 @@ public class FileBrowser {
|
|||
GUILayout.BeginHorizontal();
|
||||
|
||||
foreach (var drive in m_drives) {
|
||||
if (GUILayout.Button (drive)) {
|
||||
if (GUILayout.Button (drive, this.ButtonStyle)) {
|
||||
SetNewDirectory (drive);
|
||||
}
|
||||
}
|
||||
|
@ -304,7 +315,7 @@ public class FileBrowser {
|
|||
for (int parentIndex = 0; parentIndex < m_currentDirectoryParts.Length; ++parentIndex) {
|
||||
if (parentIndex == m_currentDirectoryParts.Length - 1) {
|
||||
GUILayout.Label(m_currentDirectoryParts[parentIndex], CentredText);
|
||||
} else if (GUILayout.Button(m_currentDirectoryParts[parentIndex])) {
|
||||
} else if (GUILayout.Button(m_currentDirectoryParts[parentIndex], this.ButtonStyle)) {
|
||||
string parentDirectoryName = m_currentDirectory;
|
||||
for (int i = m_currentDirectoryParts.Length - 1; i > parentIndex; --i) {
|
||||
parentDirectoryName = Path.GetDirectoryName(parentDirectoryName);
|
||||
|
@ -327,6 +338,7 @@ public class FileBrowser {
|
|||
m_selectedDirectory = xGUILayout.SelectionList(
|
||||
m_selectedDirectory,
|
||||
m_directoriesWithImages,
|
||||
this.ButtonStyle,
|
||||
DirectoryDoubleClickCallback
|
||||
);
|
||||
if (m_selectedDirectory > -1) {
|
||||
|
@ -335,6 +347,7 @@ public class FileBrowser {
|
|||
m_selectedNonMatchingDirectory = xGUILayout.SelectionList(
|
||||
m_selectedNonMatchingDirectory,
|
||||
m_nonMatchingDirectoriesWithImages,
|
||||
this.ButtonStyle,
|
||||
NonMatchingDirectoryDoubleClickCallback
|
||||
);
|
||||
if (m_selectedNonMatchingDirectory > -1) {
|
||||
|
@ -344,6 +357,7 @@ public class FileBrowser {
|
|||
m_selectedFile = xGUILayout.SelectionList(
|
||||
m_selectedFile,
|
||||
m_filesWithImages,
|
||||
this.ButtonStyle,
|
||||
FileDoubleClickCallback
|
||||
);
|
||||
GUI.enabled = true;
|
||||
|
@ -353,7 +367,8 @@ public class FileBrowser {
|
|||
GUI.enabled = false;
|
||||
xGUILayout.SelectionList(
|
||||
-1,
|
||||
m_nonMatchingFilesWithImages
|
||||
m_nonMatchingFilesWithImages,
|
||||
this.ButtonStyle
|
||||
);
|
||||
GUI.enabled = true;
|
||||
GUILayout.EndScrollView();
|
||||
|
|
Loading…
Add table
Reference in a new issue