From 9c0d30c10572aeff10535c74001c8f42b0de10e6 Mon Sep 17 00:00:00 2001 From: andy840119 Date: Sun, 11 Sep 2022 15:42:25 +0800 Subject: [PATCH] Should not deselect the item from the selections after focus out. Because click the item in the row might cause the focus-out event in the object field textbox. --- .../Components/LabelledObjectFieldSwitchButton.cs | 11 ----------- .../Components/LabelledObjectFieldTextBox.cs | 11 ----------- .../Components/LabelledTextTagTextBox.cs | 14 -------------- 3 files changed, 36 deletions(-) diff --git a/osu.Game.Rulesets.Karaoke/Edit/Lyrics/Extends/Components/LabelledObjectFieldSwitchButton.cs b/osu.Game.Rulesets.Karaoke/Edit/Lyrics/Extends/Components/LabelledObjectFieldSwitchButton.cs index 5dd57cef6..6cb5c7014 100644 --- a/osu.Game.Rulesets.Karaoke/Edit/Lyrics/Extends/Components/LabelledObjectFieldSwitchButton.cs +++ b/osu.Game.Rulesets.Karaoke/Edit/Lyrics/Extends/Components/LabelledObjectFieldSwitchButton.cs @@ -59,11 +59,6 @@ protected void TriggerSelect() SelectedItems.Add(item); } - protected void TriggerUnselect() - { - SelectedItems.Remove(item); - } - protected abstract bool GetFieldValue(T item); protected abstract void ApplyValue(T item, bool value); @@ -73,13 +68,7 @@ protected void TriggerUnselect() Selected = selected => { if (selected) - { TriggerSelect(); - } - else - { - TriggerUnselect(); - } } }; diff --git a/osu.Game.Rulesets.Karaoke/Edit/Lyrics/Extends/Components/LabelledObjectFieldTextBox.cs b/osu.Game.Rulesets.Karaoke/Edit/Lyrics/Extends/Components/LabelledObjectFieldTextBox.cs index f9ebcab25..de829ef12 100644 --- a/osu.Game.Rulesets.Karaoke/Edit/Lyrics/Extends/Components/LabelledObjectFieldTextBox.cs +++ b/osu.Game.Rulesets.Karaoke/Edit/Lyrics/Extends/Components/LabelledObjectFieldTextBox.cs @@ -73,11 +73,6 @@ protected void TriggerSelect() SelectedItems.Add(item); } - protected void TriggerUnselect() - { - SelectedItems.Remove(item); - } - protected abstract string GetFieldValue(T item); protected abstract void ApplyValue(T item, string value); @@ -92,13 +87,7 @@ protected void TriggerUnselect() Selected = selected => { if (selected) - { TriggerSelect(); - } - else - { - TriggerUnselect(); - } } }; diff --git a/osu.Game.Rulesets.Karaoke/Edit/Lyrics/Extends/RubyRomaji/Components/LabelledTextTagTextBox.cs b/osu.Game.Rulesets.Karaoke/Edit/Lyrics/Extends/RubyRomaji/Components/LabelledTextTagTextBox.cs index bf614cc72..12e05607b 100644 --- a/osu.Game.Rulesets.Karaoke/Edit/Lyrics/Extends/RubyRomaji/Components/LabelledTextTagTextBox.cs +++ b/osu.Game.Rulesets.Karaoke/Edit/Lyrics/Extends/RubyRomaji/Components/LabelledTextTagTextBox.cs @@ -65,14 +65,6 @@ protected LabelledTextTagTextBox(Lyric lyric, T textTag) // trigger selected if hover on delete button. TriggerSelect(); } - else - { - // do not clear current selected if typing. - if (Component.HasFocus) - return; - - TriggerUnselect(); - } } } }); @@ -95,13 +87,7 @@ protected LabelledTextTagTextBox(Lyric lyric, T textTag) Selected = selected => { if (selected) - { TriggerSelect(); - } - else - { - TriggerUnselect(); - } }, Action = (indexType, action) => {