Skip to content

Commit 51ea6a0

Browse files
authored
Merge pull request #201 from Unity-Technologies/Uni-26011_Align_UI_better
Uni-26011 align UI elements better in inspector
2 parents 3988f76 + 99e0dc5 commit 51ea6a0

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

Assets/FbxExporters/Editor/FbxExportSettings.cs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ namespace FbxExporters.EditorTools {
1010
[CustomEditor(typeof(ExportSettings))]
1111
public class ExportSettingsEditor : UnityEditor.Editor {
1212
Vector2 scrollPos = Vector2.zero;
13-
const float LabelWidth = 225;
14-
const float SelectableLabelMinWidth = 100;
15-
const float BrowseButtonWidth = 55;
13+
const float LabelWidth = 130;
14+
const float SelectableLabelMinWidth = 90;
15+
const float BrowseButtonWidth = 25;
1616

1717
public override void OnInspectorGUI() {
1818
ExportSettings exportSettings = (ExportSettings)target;
@@ -29,7 +29,7 @@ public override void OnInspectorGUI() {
2929
}
3030
GUILayout.BeginVertical();
3131
exportSettings.mayaCompatibleNames = EditorGUILayout.Toggle (
32-
new GUIContent ("Convert to Maya Compatible Naming:",
32+
new GUIContent ("Compatible Naming:",
3333
"In Maya some symbols such as spaces and accents get replaced when importing an FBX " +
3434
"(e.g. \"foo bar\" becomes \"fooFBXASC032bar\"). " +
3535
"On export, convert the names of GameObjects so they are Maya compatible." +
@@ -48,15 +48,16 @@ public override void OnInspectorGUI() {
4848
GUILayout.BeginHorizontal ();
4949
GUILayout.Label (new GUIContent (
5050
"Export Path:",
51-
"Relative path for saving Model Prefabs."));
51+
"Relative path for saving Model Prefabs."), GUILayout.Width(LabelWidth - 3));
52+
5253
var pathLabel = ExportSettings.GetRelativeSavePath();
5354
if (pathLabel == ".") { pathLabel = "(Assets root)"; }
5455
EditorGUILayout.SelectableLabel(pathLabel,
5556
EditorStyles.textField,
5657
GUILayout.MinWidth(SelectableLabelMinWidth),
5758
GUILayout.Height(EditorGUIUtility.singleLineHeight));
5859

59-
if (GUILayout.Button ("Browse", EditorStyles.miniButton, GUILayout.Width (BrowseButtonWidth))) {
60+
if (GUILayout.Button (new GUIContent("...", "Browse to a new location for saving model prefabs"), EditorStyles.miniButton, GUILayout.Width (BrowseButtonWidth))) {
6061
string initialPath = ExportSettings.GetAbsoluteSavePath();
6162

6263
// if the directory doesn't exist, set it to the default save path
@@ -91,13 +92,13 @@ public override void OnInspectorGUI() {
9192
GUILayout.BeginHorizontal ();
9293
GUILayout.Label (new GUIContent (
9394
"3D Application:",
94-
"Select the 3D Application for which you would like to install the Unity integration."));
95+
"Select the 3D Application for which you would like to install the Unity integration."), GUILayout.Width(LabelWidth - 3));
9596

9697
// dropdown to select Maya version to use
9798
var options = ExportSettings.GetDCCOptions();
9899

99100
exportSettings.selectedDCCApp = EditorGUILayout.Popup(exportSettings.selectedDCCApp, options);
100-
if (GUILayout.Button("Browse", EditorStyles.miniButton, GUILayout.Width(BrowseButtonWidth))) {
101+
if (GUILayout.Button(new GUIContent("...", "Browse to a 3D application in a non-default location"), EditorStyles.miniButton, GUILayout.Width(BrowseButtonWidth))) {
101102
var ext = "";
102103
switch (Application.platform) {
103104
case RuntimePlatform.WindowsEditor:

0 commit comments

Comments
 (0)