Conversation
|
clang-tidy review says "All clean, LGTM! 👍" |
dacap
left a comment
There was a problem hiding this comment.
Thanks for your PR @zoldyck13, actually if we're going to refactor the [MiniEditor] to Preferences, it'd be nice to use the "preview" section and start listening to the changes of the preview.enabled option so we sync the "Preview" window visibility with the option value.
| <option id="allow_nonlinear_history" type="bool" default="false" /> | ||
| <option id="show_tooltip" type="bool" default="true" /> | ||
| </section> | ||
| <section id="miniEditor" text="Mini Editor"> |
There was a problem hiding this comment.
We're using another kind of standard for these preferences, it should be:
<section id="mini_editor" text="Mini Editor">
Anyway we should move this preference to the already existing "preview" section. E.g.
<section id="preview" text="Preview">
<option id="enabled" type="bool" default="true" />
<option id="play_once" type="bool" default="false" />
<option id="play_all" type="bool" default="false" />
<option id="play_subtags" type="bool" default="true" />
</section>
| setWantFocus(false); | ||
|
|
||
| m_isEnabled = get_config_bool("MiniEditor", "Enabled", true); | ||
| m_isEnabled = app::Preferences::instance().miniEditor.enabled(); |
There was a problem hiding this comment.
Actually if we refactor this, we should impl this "Preview" visibility switching listening the app::Preferences::instance().preview.enabled() changes, and if one script changes the value the Preview should change its visibility too.
| { | ||
| set_config_bool("MiniEditor", "Enabled", m_isEnabled); | ||
| app::Preferences::instance().miniEditor.enabled(m_isEnabled); | ||
| save_window_pos(this, "MiniEditor"); |
There was a problem hiding this comment.
save_window_pos() is called from kCloseMessage, is this call needed? What case does it fix?
=### Description
This pull request migrates the "MiniEditor" configuration from the legacy ini_file system to the modern app::Preferences API.
Contribution Agreement
I declare that my contributions are not co-authored using a generative AI technology.
I agree that my contributions are licensed under the Individual Contributor License Agreement V4.0 ("CLA") as stated in https://github.com/igarastudio/cla/blob/main/cla.md
I have signed the CLA following the steps given in https://github.com/igarastudio/cla#signing