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:
parent
048156ecda
commit
b9aa8a17d4
2 changed files with 5 additions and 3 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue