Skip to content

Commit a9d60ae

Browse files
FIX: UI inconsistencies - Add buttons use add icon in input actions window (1/x) (#2302)
1 parent 71886a6 commit a9d60ae

File tree

7 files changed

+31
-5
lines changed

7 files changed

+31
-5
lines changed

Packages/com.unity.inputsystem/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ however, it has to be formatted properly to pass verification tests.
1717

1818
### Fixed
1919

20+
- Fixed add buttons use add icon in input actions window (ISX-2340)
2021
- Fixed warnings being generated on Unity 6.4 and 6.5. (ISX-2395).
2122
- Fixed extra empty lines being displayed in the control binding list when mouse buttons are pressed [ISXB-1677](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-1677)
2223
- Fixed InputActionReference not being set when attempting to set it on a Prefab or ScriptableObject [ISXB-1787](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-1787)

Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/PackageResources/InputActionMapsTreeViewItem.uxml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
<ui:TextField picking-mode="Ignore" name="rename-text-field" is-delayed="true" focusable="true" class="unity-input-actions-editor-hidden" style="visibility: visible; flex-shrink: 1;" />
66
<ui:Label text="binding-name" display-tooltip-when-elided="true" name="name" style="flex-grow: 1; justify-content: center; align-items: stretch; margin-left: 4px; -unity-font-style: normal;" />
77
</ui:VisualElement>
8-
<ui:Button text="+" display-tooltip-when-elided="true" enable-rich-text="false" name="add-new-binding-button" style="opacity: 1; background-color: rgba(255, 255, 255, 0); border-left-color: rgba(255, 255, 255, 0); border-right-color: rgba(255, 255, 255, 0); border-top-color: rgba(255, 255, 255, 0); border-bottom-color: rgba(255, 255, 255, 0); display: none; align-items: flex-end; align-self: auto; flex-direction: row-reverse;" />
8+
<ui:Button display-tooltip-when-elided="true" enable-rich-text="false" name="add-new-binding-button" style="opacity: 1; background-color: rgba(255, 255, 255, 0); border-left-color: rgba(255, 255, 255, 0); border-right-color: rgba(255, 255, 255, 0); border-top-color: rgba(255, 255, 255, 0); border-bottom-color: rgba(255, 255, 255, 0); display: none; align-items: flex-end; align-self: auto; flex-direction: row-reverse;" />
99
</ui:VisualElement>
1010
</ui:UXML>

Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/PackageResources/InputActionsEditor.uxml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,18 @@
2121
<ui:VisualElement name="action-maps-container" class="body-panel-container actions-container">
2222
<ui:VisualElement name="header" class="body-panel-header">
2323
<ui:Label text="Action Maps" display-tooltip-when-elided="true" style="flex-grow: 1;" />
24-
<ui:Button text="+" display-tooltip-when-elided="true" name="add-new-action-map-button" style="align-items: auto;" />
24+
<ui:Button display-tooltip-when-elided="true" name="add-new-action-map-button" style="align-items: auto; background-color: rgba(255, 255, 255, 0);" />
2525
</ui:VisualElement>
2626
<ui:VisualElement name="body">
2727
<ui:ListView focusable="true" name="action-maps-list-view" />
2828
</ui:VisualElement>
2929
<ui:VisualElement name="rclick-area-to-add-new-action-map" style="flex-direction: column; flex-grow: 1;" />
3030
</ui:VisualElement>
31-
<ui:TwoPaneSplitView name="actions-and-properties-split-view" fixed-pane-index="1" fixed-pane-initial-dimension="320" style="height: auto; min-width: 450px;" view-data-key="actions-editor-splitter-2">
31+
<ui:TwoPaneSplitView name="actions-and-properties-split-view" fixed-pane-index="1" fixed-pane-initial-dimension="320" view-data-key="actions-editor-splitter-2" style="height: auto; min-width: 450px;">
3232
<ui:VisualElement name="actions-container" class="body-panel-container">
3333
<ui:VisualElement name="header" class="body-panel-header" style="justify-content: space-between;">
3434
<ui:Label text="Actions" display-tooltip-when-elided="true" name="actions-label" />
35-
<ui:Button text="+" display-tooltip-when-elided="true" name="add-new-action-button" style="align-items: auto;" />
35+
<ui:Button display-tooltip-when-elided="true" name="add-new-action-button" style="align-items: auto; background-color: rgba(188, 188, 188, 0);" />
3636
</ui:VisualElement>
3737
<ui:VisualElement name="body">
3838
<ui:TreeView view-data-key="unity-tree-view" focusable="true" name="actions-tree-view" show-border="false" reorderable="true" show-alternating-row-backgrounds="None" fixed-item-height="20" />

Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/PackageResources/InputActionsEditorStyles.uss

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,15 +175,33 @@
175175
}
176176

177177
.add-binging-button-dark-theme {
178+
width: 14px;
179+
height: 14px;
178180
background-image: resource('d_Toolbar Plus More.png');
179181
-unity-background-scale-mode: scale-to-fit;
180182
}
181183

182184
.add-binging-button {
185+
width: 14px;
186+
height: 14px;
183187
background-image: resource('Toolbar Plus More.png');
184188
-unity-background-scale-mode: scale-to-fit;
185189
}
186190

191+
.add-button-dark-theme {
192+
width: 18px;
193+
height: 18px;
194+
background-image: resource('d_Toolbar Plus.png');
195+
-unity-background-scale-mode: scale-to-fit;
196+
}
197+
198+
.add-button {
199+
width: 18px;
200+
height: 18px;
201+
background-image: resource('Toolbar Plus.png');
202+
-unity-background-scale-mode: scale-to-fit;
203+
}
204+
187205
.search-field {
188206
display: none;
189207
width: 190px;

Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Views/ActionMapsView.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using CmdEvents = UnityEngine.InputSystem.Editor.InputActionsEditorConstants.CommandEvents;
33
using System.Collections.Generic;
44
using System.Linq;
5+
using UnityEditor;
56
using UnityEngine.UIElements;
67

78
namespace UnityEngine.InputSystem.Editor
@@ -65,6 +66,8 @@ public ActionMapsView(VisualElement root, StateContainer stateContainer)
6566
CreateSelector(Selectors.GetActionMapNames, Selectors.GetSelectedActionMap, (actionMapNames, actionMap, state) => new ViewState(actionMap, actionMapNames, state.GetDisabledActionMaps(actionMapNames.ToList())));
6667

6768
m_AddActionMapButton = root.Q<Button>("add-new-action-map-button");
69+
m_AddActionMapButton.AddToClassList(EditorGUIUtility.isProSkin ? "add-button-dark-theme" : "add-button");
70+
6871
m_AddActionMapButton.clicked += AddActionMap;
6972

7073
ContextMenu.GetContextMenuForActionMapsEmptySpace(this, root.Q<VisualElement>("rclick-area-to-add-new-action-map"));

Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Views/ActionsTreeView.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ public ActionsTreeView(VisualElement root, StateContainer stateContainer)
3232
{
3333
m_ActionMapsListView = root.Q<ListView>("action-maps-list-view");
3434
m_AddActionButton = root.Q<Button>("add-new-action-button");
35+
m_AddActionButton.AddToClassList(EditorGUIUtility.isProSkin ? "add-button-dark-theme" : "add-button");
3536
m_PropertiesScrollview = root.Q<ScrollView>("properties-scrollview");
3637
m_ActionsTreeView = root.Q<TreeView>("actions-tree-view");
3738
//assign unique viewDataKey to store treeView states like expanded/collapsed items - make it unique to avoid conflicts with other TreeViews

Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Views/PropertiesView.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,21 +39,24 @@ public PropertiesView(VisualElement root, StateContainer stateContainer)
3939
if (addInteractionButton == null)
4040
{
4141
addInteractionButton = CreateAddButton(interactionsToggle, "add-new-interaction-button");
42+
addInteractionButton.AddToClassList(EditorGUIUtility.isProSkin ? "add-binging-button-dark-theme" : "add-binging-button");
43+
4244
new ContextualMenuManipulator(_ => {}){target = addInteractionButton, activators = {new ManipulatorActivationFilter(){button = MouseButton.LeftMouse}}};
4345
}
4446
var processorToggle = processorsFoldout.Q<Toggle>();
4547
processorToggle.AddToClassList("properties-foldout-toggle");
4648
if (addProcessorButton == null)
4749
{
4850
addProcessorButton = CreateAddButton(processorToggle, "add-new-processor-button");
51+
addProcessorButton.AddToClassList(EditorGUIUtility.isProSkin ? "add-binging-button-dark-theme" : "add-binging-button");
52+
4953
new ContextualMenuManipulator(_ => {}){target = addProcessorButton, activators = {new ManipulatorActivationFilter(){button = MouseButton.LeftMouse}}};
5054
}
5155
}
5256

5357
private TextElement CreateAddButton(Toggle toggle, string name)
5458
{
5559
var addButton = new Button();
56-
addButton.text = "+";
5760
addButton.name = name;
5861
addButton.focusable = false;
5962
#if UNITY_EDITOR_OSX

0 commit comments

Comments
 (0)