karaoke-dev / karaoke

Will be the best karaoke system.
http://blog.karaoke.dev
GNU General Public License v3.0
199 stars 16 forks source link

Block the editable area in the lyric editor if property is not editable. #1563

Open andy840119 opened 1 year ago

andy840119 commented 1 year ago

UI part of #1444.

image https://karaoke-dev.notion.site/Lyric-editor-mode-and-block-area-c45017e171f043b2b66fc5a5a6d8530d List all the edit mode, parts and edit property in the parts.

andy840119 commented 1 year ago

Notice an issue while implementing #1590: We make the state interface for each rows in the #1582, but it will be hard to trigger the event if trigger the change by keyboard

e.g:

andy840119 commented 1 year ago

And it might be a waste if need to check editable before actually change everywhere. Not really sure should be able to get invalid change event in the change handler instead?

But still need to consider the pre-check case. e.g: should block the drag feature instead of return value not changeable even after actually drag. So should not remove the IsSelectionsLocked() in the ILyricPropertyChangeHandler.

Solution:

  1. add the fallback action in every change handler. e.g: void SetLanguage(CultureInfo? language); -> void SetLanguage(CultureInfo? language, Action lockAction = null);
  2. Should have lock action event in every change handlers inherit HitObjectPropertyChangeHandler.