Add hotkey filtering functionality (by name and by context)

This commit is contained in:
Ivaylo Draganov
2022-03-30 21:17:54 +03:00
committed by abcdefg30
parent 56153aac9f
commit f0e69c3f64
5 changed files with 427 additions and 209 deletions

View File

@@ -40,7 +40,7 @@ namespace OpenRA
} }
foreach (var hd in definitions) foreach (var hd in definitions)
hd.Value.HasDuplicates = GetFirstDuplicate(hd.Value.Name, this[hd.Value.Name].GetValue(), hd.Value) != null; hd.Value.HasDuplicates = GetFirstDuplicate(hd.Value, this[hd.Value.Name].GetValue()) != null;
} }
internal Func<Hotkey> GetHotkeyReference(string name) internal Func<Hotkey> GetHotkeyReference(string name)
@@ -68,7 +68,7 @@ namespace OpenRA
settings.Remove(name); settings.Remove(name);
var hadDuplicates = definition.HasDuplicates; var hadDuplicates = definition.HasDuplicates;
definition.HasDuplicates = GetFirstDuplicate(definition.Name, this[definition.Name].GetValue(), definition) != null; definition.HasDuplicates = GetFirstDuplicate(definition, this[definition.Name].GetValue()) != null;
if (hadDuplicates || definition.HasDuplicates) if (hadDuplicates || definition.HasDuplicates)
{ {
@@ -77,16 +77,19 @@ namespace OpenRA
if (hd.Value == definition) if (hd.Value == definition)
continue; continue;
hd.Value.HasDuplicates = GetFirstDuplicate(hd.Value.Name, this[hd.Value.Name].GetValue(), hd.Value) != null; hd.Value.HasDuplicates = GetFirstDuplicate(hd.Value, this[hd.Value.Name].GetValue()) != null;
} }
} }
} }
public HotkeyDefinition GetFirstDuplicate(string name, Hotkey value, HotkeyDefinition definition) public HotkeyDefinition GetFirstDuplicate(HotkeyDefinition definition, Hotkey value)
{ {
if (definition == null)
return null;
foreach (var kv in keys) foreach (var kv in keys)
{ {
if (kv.Key == name) if (kv.Key == definition.Name)
continue; continue;
if (kv.Value == value && definitions[kv.Key].Contexts.Overlaps(definition.Contexts)) if (kv.Value == value && definitions[kv.Key].Contexts.Overlaps(definition.Contexts))

View File

@@ -31,6 +31,16 @@ namespace OpenRA.Mods.Common.Widgets.Logic
bool isHotkeyValid; bool isHotkeyValid;
bool isHotkeyDefault; bool isHotkeyDefault;
string currentContext = "Any";
readonly HashSet<string> contexts = new HashSet<string>() { "Any" };
readonly Dictionary<string, HashSet<string>> hotkeyGroups = new Dictionary<string, HashSet<string>>();
TextFieldWidget filterInput;
Widget headerTemplate;
Widget template;
Widget emptyListMessage;
Widget remapDialog;
static HotkeysSettingsLogic() { } static HotkeysSettingsLogic() { }
[ObjectCreator.UseCtor] [ObjectCreator.UseCtor]
@@ -44,7 +54,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
void BindHotkeyPref(HotkeyDefinition hd, Widget template) void BindHotkeyPref(HotkeyDefinition hd, Widget template)
{ {
var key = template.Clone() as Widget; var key = template.Clone();
key.Id = hd.Name; key.Id = hd.Name;
key.IsVisible = () => true; key.IsVisible = () => true;
@@ -86,46 +96,57 @@ namespace OpenRA.Mods.Common.Widgets.Logic
{ {
hotkeyList = panel.Get<ScrollPanelWidget>("HOTKEY_LIST"); hotkeyList = panel.Get<ScrollPanelWidget>("HOTKEY_LIST");
hotkeyList.Layout = new GridLayout(hotkeyList); hotkeyList.Layout = new GridLayout(hotkeyList);
var headerTemplate = hotkeyList.Get("HEADER"); headerTemplate = hotkeyList.Get("HEADER");
var template = hotkeyList.Get("TEMPLATE"); template = hotkeyList.Get("TEMPLATE");
hotkeyList.RemoveChildren(); emptyListMessage = panel.Get("HOTKEY_EMPTY_LIST");
remapDialog = panel.Get("HOTKEY_REMAP_DIALOG");
if (logicArgs.TryGetValue("HotkeyGroups", out var hotkeyGroups)) foreach (var hd in modData.Hotkeys.Definitions)
contexts.UnionWith(hd.Contexts);
filterInput = panel.Get<TextFieldWidget>("FILTER_INPUT");
filterInput.OnTextEdited = () => InitHotkeyList();
filterInput.OnEscKey = _ =>
{ {
InitHotkeyRemapDialog(panel); if (string.IsNullOrEmpty(filterInput.Text))
filterInput.YieldKeyboardFocus();
else
{
filterInput.Text = "";
filterInput.OnTextEdited();
}
foreach (var hg in hotkeyGroups.Nodes) return true;
};
var contextDropdown = panel.GetOrNull<DropDownButtonWidget>("CONTEXT_DROPDOWN");
if (contextDropdown != null)
{
contextDropdown.OnMouseDown = _ => ShowContextDropdown(contextDropdown);
var contextName = new CachedTransform<string, string>(GetContextDisplayName);
contextDropdown.GetText = () => contextName.Update(currentContext);
}
if (logicArgs.TryGetValue("HotkeyGroups", out var hotkeyGroupsYaml))
{
foreach (var hg in hotkeyGroupsYaml.Nodes)
{ {
var typesNode = hg.Value.Nodes.FirstOrDefault(n => n.Key == "Types"); var typesNode = hg.Value.Nodes.FirstOrDefault(n => n.Key == "Types");
if (typesNode == null) if (typesNode != null)
continue; hotkeyGroups.Add(hg.Key, FieldLoader.GetValue<HashSet<string>>("Types", typesNode.Value.Value));
var header = headerTemplate.Clone();
header.Get<LabelWidget>("LABEL").GetText = () => hg.Key;
hotkeyList.AddChild(header);
var types = FieldLoader.GetValue<string[]>("Types", typesNode.Value.Value);
var added = new HashSet<HotkeyDefinition>();
foreach (var t in types)
{
foreach (var hd in modData.Hotkeys.Definitions.Where(k => k.Types.Contains(t)))
{
if (added.Add(hd))
{
if (selectedHotkeyDefinition == null)
selectedHotkeyDefinition = hd;
BindHotkeyPref(hd, template);
}
}
}
} }
InitHotkeyRemapDialog(panel);
InitHotkeyList();
} }
return () => return () =>
{ {
hotkeyEntryWidget.Key = modData.Hotkeys[selectedHotkeyDefinition.Name].GetValue(); hotkeyEntryWidget.Key =
selectedHotkeyDefinition != null ?
modData.Hotkeys[selectedHotkeyDefinition.Name].GetValue() :
Hotkey.Invalid;
hotkeyEntryWidget.ForceYieldKeyboardFocus(); hotkeyEntryWidget.ForceYieldKeyboardFocus();
return false; return false;
@@ -144,21 +165,67 @@ namespace OpenRA.Mods.Common.Widgets.Logic
}; };
} }
void InitHotkeyList()
{
hotkeyList.RemoveChildren();
selectedHotkeyDefinition = null;
foreach (var hg in hotkeyGroups)
{
var typesInGroup = hg.Value;
var keysInGroup = modData.Hotkeys.Definitions
.Where(hd => IsHotkeyVisibleInFilter(hd) && hd.Types.Overlaps(typesInGroup));
if (!keysInGroup.Any())
continue;
var header = headerTemplate.Clone();
header.Get<LabelWidget>("LABEL").GetText = () => hg.Key;
hotkeyList.AddChild(header);
var added = new HashSet<HotkeyDefinition>();
foreach (var type in typesInGroup)
{
foreach (var hd in keysInGroup.Where(k => k.Types.Contains(type)))
{
if (added.Add(hd))
{
if (selectedHotkeyDefinition == null)
selectedHotkeyDefinition = hd;
BindHotkeyPref(hd, template);
}
}
}
}
emptyListMessage.Visible = selectedHotkeyDefinition == null;
remapDialog.Visible = selectedHotkeyDefinition != null;
hotkeyList.ScrollToTop();
}
void InitHotkeyRemapDialog(Widget panel) void InitHotkeyRemapDialog(Widget panel)
{ {
var label = new CachedTransform<HotkeyDefinition, string>(hd => hd.Description + ":"); var label = panel.Get<LabelWidget>("HOTKEY_LABEL");
panel.Get<LabelWidget>("HOTKEY_LABEL").GetText = () => label.Update(selectedHotkeyDefinition); var labelText = new CachedTransform<HotkeyDefinition, string>(hd => hd?.Description + ":");
label.IsVisible = () => selectedHotkeyDefinition != null;
label.GetText = () => labelText.Update(selectedHotkeyDefinition);
var duplicateNotice = panel.Get<LabelWidget>("DUPLICATE_NOTICE"); var duplicateNotice = panel.Get<LabelWidget>("DUPLICATE_NOTICE");
duplicateNotice.TextColor = ChromeMetrics.Get<Color>("NoticeErrorColor"); duplicateNotice.TextColor = ChromeMetrics.Get<Color>("NoticeErrorColor");
duplicateNotice.IsVisible = () => !isHotkeyValid; duplicateNotice.IsVisible = () => !isHotkeyValid;
var duplicateNoticeText = new CachedTransform<HotkeyDefinition, string>(hd => hd != null ? duplicateNotice.Text.F(hd.Description) : duplicateNotice.Text); var duplicateNoticeText = new CachedTransform<HotkeyDefinition, string>(hd =>
hd != null ?
duplicateNotice.Text.F(hd.Description, hd.Contexts.First(c => selectedHotkeyDefinition.Contexts.Contains(c))) :
"");
duplicateNotice.GetText = () => duplicateNoticeText.Update(duplicateHotkeyDefinition); duplicateNotice.GetText = () => duplicateNoticeText.Update(duplicateHotkeyDefinition);
var originalNotice = panel.Get<LabelWidget>("ORIGINAL_NOTICE"); var originalNotice = panel.Get<LabelWidget>("ORIGINAL_NOTICE");
originalNotice.TextColor = ChromeMetrics.Get<Color>("NoticeInfoColor"); originalNotice.TextColor = ChromeMetrics.Get<Color>("NoticeInfoColor");
originalNotice.IsVisible = () => isHotkeyValid && !isHotkeyDefault; originalNotice.IsVisible = () => isHotkeyValid && !isHotkeyDefault;
var originalNoticeText = new CachedTransform<HotkeyDefinition, string>(hd => originalNotice.Text.F(hd.Default.DisplayString())); var originalNoticeText = new CachedTransform<HotkeyDefinition, string>(hd => originalNotice.Text.F(hd?.Default.DisplayString()));
originalNotice.GetText = () => originalNoticeText.Update(selectedHotkeyDefinition); originalNotice.GetText = () => originalNoticeText.Update(selectedHotkeyDefinition);
var resetButton = panel.Get<ButtonWidget>("RESET_HOTKEY_BUTTON"); var resetButton = panel.Get<ButtonWidget>("RESET_HOTKEY_BUTTON");
@@ -188,7 +255,10 @@ namespace OpenRA.Mods.Common.Widgets.Logic
void ValidateHotkey() void ValidateHotkey()
{ {
duplicateHotkeyDefinition = modData.Hotkeys.GetFirstDuplicate(selectedHotkeyDefinition.Name, hotkeyEntryWidget.Key, selectedHotkeyDefinition); if (selectedHotkeyDefinition == null)
return;
duplicateHotkeyDefinition = modData.Hotkeys.GetFirstDuplicate(selectedHotkeyDefinition, hotkeyEntryWidget.Key);
isHotkeyValid = duplicateHotkeyDefinition == null; isHotkeyValid = duplicateHotkeyDefinition == null;
isHotkeyDefault = hotkeyEntryWidget.Key == selectedHotkeyDefinition.Default || (!hotkeyEntryWidget.Key.IsValid() && !selectedHotkeyDefinition.Default.IsValid()); isHotkeyDefault = hotkeyEntryWidget.Key == selectedHotkeyDefinition.Default || (!hotkeyEntryWidget.Key.IsValid() && !selectedHotkeyDefinition.Default.IsValid());
@@ -231,5 +301,42 @@ namespace OpenRA.Mods.Common.Widgets.Logic
Game.Settings.Save(); Game.Settings.Save();
hotkeyEntryWidget.YieldKeyboardFocus(); hotkeyEntryWidget.YieldKeyboardFocus();
} }
bool IsHotkeyVisibleInFilter(HotkeyDefinition hd)
{
var filter = filterInput.Text;
var isFilteredByName = string.IsNullOrWhiteSpace(filter) || hd.Description.Contains(filter, StringComparison.OrdinalIgnoreCase);
var isFilteredByContext = currentContext == "Any" || hd.Contexts.Contains(currentContext);
return isFilteredByName && isFilteredByContext;
}
bool ShowContextDropdown(DropDownButtonWidget dropdown)
{
hotkeyEntryWidget.YieldKeyboardFocus();
var contextName = new CachedTransform<string, string>(GetContextDisplayName);
ScrollItemWidget SetupItem(string context, ScrollItemWidget itemTemplate)
{
var item = ScrollItemWidget.Setup(itemTemplate,
() => currentContext == context,
() => { currentContext = context; InitHotkeyList(); });
item.Get<LabelWidget>("LABEL").GetText = () => contextName.Update(context);
return item;
}
dropdown.ShowDropDown("LABEL_DROPDOWN_TEMPLATE", 280, contexts, SetupItem);
return true;
}
static string GetContextDisplayName(string context)
{
if (string.IsNullOrEmpty(context))
return "Any";
return context;
}
} }
} }

View File

@@ -25,9 +25,31 @@ Container@HOTKEYS_PANEL:
Width: PARENT_RIGHT Width: PARENT_RIGHT
Height: PARENT_BOTTOM Height: PARENT_BOTTOM
Children: Children:
Label@FILTER_INPUT_LABEL:
Width: 100
Height: 25
Font: Bold
Text: Filter by name:
TextField@FILTER_INPUT:
X: 108
Width: 180
Height: 25
Label@CONTEXT_DROPDOWN_LABEL:
X: PARENT_RIGHT - WIDTH - 195 - 5
Width: 100
Height: 25
Font: Bold
Text: Context:
Align: Right
DropDownButton@CONTEXT_DROPDOWN:
X: PARENT_RIGHT - WIDTH
Width: 195
Height: 25
Font: Bold
ScrollPanel@HOTKEY_LIST: ScrollPanel@HOTKEY_LIST:
Y: 35
Width: PARENT_RIGHT Width: PARENT_RIGHT
Height: PARENT_BOTTOM - 65 Height: PARENT_BOTTOM - 65 - 35
TopBottomSpacing: 5 TopBottomSpacing: 5
ItemSpacing: 5 ItemSpacing: 5
Children: Children:
@@ -60,64 +82,78 @@ Container@HOTKEYS_PANEL:
Width: 90 Width: 90
Height: 25 Height: 25
TooltipContainer: SETTINGS_TOOLTIP_CONTAINER TooltipContainer: SETTINGS_TOOLTIP_CONTAINER
Background@HOTKEY_DIALOG_ROOT: Container@HOTKEY_EMPTY_LIST:
Width: PARENT_RIGHT
Height: PARENT_BOTTOM
Visible: false
Children:
Label@HOTKEY_EMPTY_LIST_MESSAGE:
Width: PARENT_RIGHT
Height: PARENT_BOTTOM
Align: Center
Text: No hotkeys match the filter criteria.
Background@HOTKEY_REMAP_BGND:
Y: PARENT_BOTTOM - HEIGHT - 1 Y: PARENT_BOTTOM - HEIGHT - 1
Width: PARENT_RIGHT Width: PARENT_RIGHT
Height: 65 + 1 Height: 65 + 1
Background: panel-gray Background: panel-gray
Children: Children:
Label@HOTKEY_LABEL: Container@HOTKEY_REMAP_DIALOG:
X: 15 Width: PARENT_RIGHT
Y: 19 Height: PARENT_BOTTOM
Width: 200
Height: 25
Font: Bold
Align: Right
HotkeyEntry@HOTKEY_ENTRY:
X: 15 + 200 + 5
Y: 20
Width: 220
Height: 25
Container@NOTICES:
X: 15 + 200 + 5
Y: 42
Width: 220
Height: 25
Children: Children:
Label@ORIGINAL_NOTICE: Label@HOTKEY_LABEL:
Width: PARENT_RIGHT X: 15
Height: PARENT_BOTTOM Y: 19
Font: Tiny Width: 200
Text: The default is "{0}" Height: 25
Label@DUPLICATE_NOTICE: Font: Bold
Width: PARENT_RIGHT Align: Right
Height: PARENT_BOTTOM HotkeyEntry@HOTKEY_ENTRY:
Font: Tiny X: 15 + 200 + 5
Text: This is already used for "{0}" Y: 20
Button@OVERRIDE_HOTKEY_BUTTON: Width: 220
X: PARENT_RIGHT - 3 * WIDTH - 30 Height: 25
Y: 20 Container@NOTICES:
Width: 70 X: 15 + 200 + 5
Height: 25 Y: 42
Text: Override Width: 220
Font: Bold Height: 25
Button@CLEAR_HOTKEY_BUTTON: Children:
X: PARENT_RIGHT - 2 * WIDTH - 30 Label@ORIGINAL_NOTICE:
Y: 20 Width: PARENT_RIGHT
Width: 65 Height: PARENT_BOTTOM
Height: 25 Font: Tiny
Text: Clear Text: The default is "{0}"
Font: Bold Label@DUPLICATE_NOTICE:
TooltipText: Unbind the hotkey Width: PARENT_RIGHT
TooltipContainer: SETTINGS_TOOLTIP_CONTAINER Height: PARENT_BOTTOM
TooltipTemplate: SIMPLE_TOOLTIP Font: Tiny
Button@RESET_HOTKEY_BUTTON: Text: This is already used for "{0}" in the {1} context
X: PARENT_RIGHT - WIDTH - 20 Button@OVERRIDE_HOTKEY_BUTTON:
Y: 20 X: PARENT_RIGHT - 3 * WIDTH - 30
Width: 65 Y: 20
Height: 25 Width: 70
Text: Reset Height: 25
Font: Bold Text: Override
TooltipText: Reset to default Font: Bold
TooltipContainer: SETTINGS_TOOLTIP_CONTAINER Button@CLEAR_HOTKEY_BUTTON:
TooltipTemplate: SIMPLE_TOOLTIP X: PARENT_RIGHT - 2 * WIDTH - 30
Y: 20
Width: 65
Height: 25
Text: Clear
Font: Bold
TooltipText: Unbind the hotkey
TooltipContainer: SETTINGS_TOOLTIP_CONTAINER
TooltipTemplate: SIMPLE_TOOLTIP
Button@RESET_HOTKEY_BUTTON:
X: PARENT_RIGHT - WIDTH - 20
Y: 20
Width: 65
Height: 25
Text: Reset
Font: Bold
TooltipText: Reset to default
TooltipContainer: SETTINGS_TOOLTIP_CONTAINER
TooltipTemplate: SIMPLE_TOOLTIP

View File

@@ -25,9 +25,31 @@ Container@HOTKEYS_PANEL:
Width: PARENT_RIGHT Width: PARENT_RIGHT
Height: PARENT_BOTTOM Height: PARENT_BOTTOM
Children: Children:
Label@FILTER_INPUT_LABEL:
Width: 100
Height: 25
Font: Bold
Text: Filter by name:
TextField@FILTER_INPUT:
X: 108
Width: 180
Height: 25
Label@CONTEXT_DROPDOWN_LABEL:
X: PARENT_RIGHT - WIDTH - 195 - 5
Width: 100
Height: 25
Font: Bold
Text: Context:
Align: Right
DropDownButton@CONTEXT_DROPDOWN:
X: PARENT_RIGHT - WIDTH
Width: 195
Height: 25
Font: Bold
ScrollPanel@HOTKEY_LIST: ScrollPanel@HOTKEY_LIST:
Y: 35
Width: PARENT_RIGHT Width: PARENT_RIGHT
Height: PARENT_BOTTOM - 65 Height: PARENT_BOTTOM - 65 - 35
TopBottomSpacing: 5 TopBottomSpacing: 5
ItemSpacing: 5 ItemSpacing: 5
Children: Children:
@@ -60,64 +82,78 @@ Container@HOTKEYS_PANEL:
Width: 120 Width: 120
Height: 25 Height: 25
TooltipContainer: SETTINGS_TOOLTIP_CONTAINER TooltipContainer: SETTINGS_TOOLTIP_CONTAINER
Background@HOTKEY_DIALOG_ROOT: Container@HOTKEY_EMPTY_LIST:
Width: PARENT_RIGHT
Height: PARENT_BOTTOM
Visible: false
Children:
Label@HOTKEY_EMPTY_LIST_MESSAGE:
Width: PARENT_RIGHT
Height: PARENT_BOTTOM
Align: Center
Text: No hotkeys match the filter criteria.
Background@HOTKEY_REMAP_BGND:
Y: PARENT_BOTTOM - HEIGHT Y: PARENT_BOTTOM - HEIGHT
Width: PARENT_RIGHT Width: PARENT_RIGHT
Height: 65 Height: 65
Background: dialog3 Background: dialog3
Children: Children:
Label@HOTKEY_LABEL: Container@HOTKEY_REMAP_DIALOG:
X: 15 Width: PARENT_RIGHT
Y: 19 Height: PARENT_BOTTOM
Width: 200
Height: 25
Font: Bold
Align: Right
HotkeyEntry@HOTKEY_ENTRY:
X: 15 + 200 + 5
Y: 20
Width: 300
Height: 25
Container@NOTICES:
X: 15 + 200 + 5
Y: 42
Width: 300
Height: 25
Children: Children:
Label@ORIGINAL_NOTICE: Label@HOTKEY_LABEL:
Width: PARENT_RIGHT X: 15
Height: PARENT_BOTTOM Y: 19
Font: Tiny Width: 200
Text: The default is "{0}" Height: 25
Label@DUPLICATE_NOTICE: Font: Bold
Width: PARENT_RIGHT Align: Right
Height: PARENT_BOTTOM HotkeyEntry@HOTKEY_ENTRY:
Font: Tiny X: 15 + 200 + 5
Text: This is already used for "{0}" Y: 20
Button@OVERRIDE_HOTKEY_BUTTON: Width: 300
X: PARENT_RIGHT - 3 * WIDTH - 30 Height: 25
Y: 20 Container@NOTICES:
Width: 70 X: 15 + 200 + 5
Height: 25 Y: 42
Text: Override Width: 300
Font: Bold Height: 25
Button@CLEAR_HOTKEY_BUTTON: Children:
X: PARENT_RIGHT - 2 * WIDTH - 30 Label@ORIGINAL_NOTICE:
Y: 20 Width: PARENT_RIGHT
Width: 65 Height: PARENT_BOTTOM
Height: 25 Font: Tiny
Text: Clear Text: The default is "{0}"
Font: Bold Label@DUPLICATE_NOTICE:
TooltipText: Unbind the hotkey Width: PARENT_RIGHT
TooltipContainer: SETTINGS_TOOLTIP_CONTAINER Height: PARENT_BOTTOM
TooltipTemplate: SIMPLE_TOOLTIP Font: Tiny
Button@RESET_HOTKEY_BUTTON: Text: This is already used for "{0}" in the {1} context
X: PARENT_RIGHT - WIDTH - 20 Button@OVERRIDE_HOTKEY_BUTTON:
Y: 20 X: PARENT_RIGHT - 3 * WIDTH - 30
Width: 65 Y: 20
Height: 25 Width: 70
Text: Reset Height: 25
Font: Bold Text: Override
TooltipText: Reset to default Font: Bold
TooltipContainer: SETTINGS_TOOLTIP_CONTAINER Button@CLEAR_HOTKEY_BUTTON:
TooltipTemplate: SIMPLE_TOOLTIP X: PARENT_RIGHT - 2 * WIDTH - 30
Y: 20
Width: 65
Height: 25
Text: Clear
Font: Bold
TooltipText: Unbind the hotkey
TooltipContainer: SETTINGS_TOOLTIP_CONTAINER
TooltipTemplate: SIMPLE_TOOLTIP
Button@RESET_HOTKEY_BUTTON:
X: PARENT_RIGHT - WIDTH - 20
Y: 20
Width: 65
Height: 25
Text: Reset
Font: Bold
TooltipText: Reset to default
TooltipContainer: SETTINGS_TOOLTIP_CONTAINER
TooltipTemplate: SIMPLE_TOOLTIP

View File

@@ -27,9 +27,31 @@ Container@HOTKEYS_PANEL:
Width: PARENT_RIGHT Width: PARENT_RIGHT
Height: PARENT_BOTTOM Height: PARENT_BOTTOM
Children: Children:
Label@FILTER_INPUT_LABEL:
Width: 100
Height: 25
Font: Bold
Text: Filter by name:
TextField@FILTER_INPUT:
X: 108
Width: 180
Height: 25
Label@CONTEXT_DROPDOWN_LABEL:
X: PARENT_RIGHT - WIDTH - 195 - 5
Width: 100
Height: 25
Font: Bold
Text: Context:
Align: Right
DropDownButton@CONTEXT_DROPDOWN:
X: PARENT_RIGHT - WIDTH
Width: 195
Height: 25
Font: Bold
ScrollPanel@HOTKEY_LIST: ScrollPanel@HOTKEY_LIST:
Y: 35
Width: PARENT_RIGHT Width: PARENT_RIGHT
Height: PARENT_BOTTOM - 65 Height: PARENT_BOTTOM - 65 - 35
TopBottomSpacing: 5 TopBottomSpacing: 5
ItemSpacing: 5 ItemSpacing: 5
Children: Children:
@@ -62,64 +84,78 @@ Container@HOTKEYS_PANEL:
Width: 120 Width: 120
Height: 25 Height: 25
TooltipContainer: SETTINGS_TOOLTIP_CONTAINER TooltipContainer: SETTINGS_TOOLTIP_CONTAINER
Background@HOTKEY_DIALOG_ROOT: Container@HOTKEY_EMPTY_LIST:
Width: PARENT_RIGHT
Height: PARENT_BOTTOM
Visible: false
Children:
Label@HOTKEY_EMPTY_LIST_MESSAGE:
Width: PARENT_RIGHT
Height: PARENT_BOTTOM
Align: Center
Text: No hotkeys match the filter criteria.
Background@HOTKEY_REMAP_BGND:
Y: PARENT_BOTTOM - HEIGHT Y: PARENT_BOTTOM - HEIGHT
Width: PARENT_RIGHT Width: PARENT_RIGHT
Height: 65 Height: 65
Background: dialog3 Background: dialog3
Children: Children:
Label@HOTKEY_LABEL: Container@HOTKEY_REMAP_DIALOG:
X: 15 Width: PARENT_RIGHT
Y: 19 Height: PARENT_BOTTOM
Width: 200
Height: 25
Font: Bold
Align: Right
HotkeyEntry@HOTKEY_ENTRY:
X: 15 + 200 + 5
Y: 20
Width: 300
Height: 25
Container@NOTICES:
X: 15 + 200 + 5
Y: 42
Width: 300
Height: 25
Children: Children:
Label@ORIGINAL_NOTICE: Label@HOTKEY_LABEL:
Width: PARENT_RIGHT X: 15
Height: PARENT_BOTTOM Y: 19
Font: Tiny Width: 200
Text: The default is "{0}" Height: 25
Label@DUPLICATE_NOTICE: Font: Bold
Width: PARENT_RIGHT Align: Right
Height: PARENT_BOTTOM HotkeyEntry@HOTKEY_ENTRY:
Font: Tiny X: 15 + 200 + 5
Text: This is already used for "{0}" Y: 20
Button@OVERRIDE_HOTKEY_BUTTON: Width: 300
X: PARENT_RIGHT - 3 * WIDTH - 30 Height: 25
Y: 20 Container@NOTICES:
Width: 70 X: 15 + 200 + 5
Height: 25 Y: 42
Text: Override Width: 300
Font: Bold Height: 25
Button@CLEAR_HOTKEY_BUTTON: Children:
X: PARENT_RIGHT - 2 * WIDTH - 30 Label@ORIGINAL_NOTICE:
Y: 20 Width: PARENT_RIGHT
Width: 65 Height: PARENT_BOTTOM
Height: 25 Font: Tiny
Text: Clear Text: The default is "{0}"
Font: Bold Label@DUPLICATE_NOTICE:
TooltipText: Unbind the hotkey Width: PARENT_RIGHT
TooltipContainer: SETTINGS_TOOLTIP_CONTAINER Height: PARENT_BOTTOM
TooltipTemplate: SIMPLE_TOOLTIP Font: Tiny
Button@RESET_HOTKEY_BUTTON: Text: This is already used for "{0}" in the {1} context
X: PARENT_RIGHT - WIDTH - 20 Button@OVERRIDE_HOTKEY_BUTTON:
Y: 20 X: PARENT_RIGHT - 3 * WIDTH - 30
Width: 65 Y: 20
Height: 25 Width: 70
Text: Reset Height: 25
Font: Bold Text: Override
TooltipText: Reset to default Font: Bold
TooltipContainer: SETTINGS_TOOLTIP_CONTAINER Button@CLEAR_HOTKEY_BUTTON:
TooltipTemplate: SIMPLE_TOOLTIP X: PARENT_RIGHT - 2 * WIDTH - 30
Y: 20
Width: 65
Height: 25
Text: Clear
Font: Bold
TooltipText: Unbind the hotkey
TooltipContainer: SETTINGS_TOOLTIP_CONTAINER
TooltipTemplate: SIMPLE_TOOLTIP
Button@RESET_HOTKEY_BUTTON:
X: PARENT_RIGHT - WIDTH - 20
Y: 20
Width: 65
Height: 25
Text: Reset
Font: Bold
TooltipText: Reset to default
TooltipContainer: SETTINGS_TOOLTIP_CONTAINER
TooltipTemplate: SIMPLE_TOOLTIP