Allow to pass new title controls layout value to notifier

In case the getter is trivial (has only one implementation)
This commit is contained in:
Ilya Fedin 2023-07-19 11:38:53 +04:00 committed by John Preston
parent 048156ecda
commit b9aa8a17d4
2 changed files with 5 additions and 3 deletions

View file

@ -19,8 +19,9 @@ auto &CachedTitleControlsLayout() {
} // namespace } // namespace
void NotifyTitleControlsLayoutChanged() { void NotifyTitleControlsLayoutChanged(
CachedTitleControlsLayout() = TitleControlsLayout(); const std::optional<TitleControls::Layout> &layout) {
CachedTitleControlsLayout() = layout ? *layout : TitleControlsLayout();
} }
} // namespace internal } // namespace internal

View file

@ -21,7 +21,8 @@ namespace internal {
// Actual requestor, cached by the public interface // Actual requestor, cached by the public interface
[[nodiscard]] TitleControls::Layout TitleControlsLayout(); [[nodiscard]] TitleControls::Layout TitleControlsLayout();
void NotifyTitleControlsLayoutChanged(); void NotifyTitleControlsLayoutChanged(
const std::optional<TitleControls::Layout> &layout = std::nullopt);
} // namespace internal } // namespace internal