Mark ui::element::style_updated/own_style_updated as const

This commit is contained in:
Nikita Lisitsa 2022-05-14 16:05:24 +03:00
parent f66e8ceded
commit 49e3e2e07b
4 changed files with 8 additions and 8 deletions

View file

@ -70,8 +70,8 @@ namespace psemek::ui
virtual std::shared_ptr<struct style const> set_style(std::shared_ptr<struct style const> st); virtual std::shared_ptr<struct style const> set_style(std::shared_ptr<struct style const> st);
virtual std::shared_ptr<struct style const> set_own_style(std::shared_ptr<struct style const> st); virtual std::shared_ptr<struct style const> set_own_style(std::shared_ptr<struct style const> st);
virtual void style_updated(); virtual void style_updated() const;
virtual void own_style_updated(); virtual void own_style_updated() const;
virtual std::optional<std::string> const & hint() const { return hint_; } virtual std::optional<std::string> const & hint() const { return hint_; }
virtual std::optional<std::string> set_hint(std::optional<std::string> hint); virtual std::optional<std::string> set_hint(std::optional<std::string> hint);

View file

@ -72,8 +72,8 @@ namespace psemek::ui
geom::interval<float> width_constraints(float height) const override; geom::interval<float> width_constraints(float height) const override;
geom::interval<float> height_constraints(float width) const override; geom::interval<float> height_constraints(float width) const override;
void style_updated() override; void style_updated() const override;
void own_style_updated() override; void own_style_updated() const override;
bool transparent() const override { return !hint(); } bool transparent() const override { return !hint(); }

View file

@ -101,7 +101,7 @@ namespace psemek::ui
return st; return st;
} }
void element::style_updated() void element::style_updated() const
{ {
merged_style_ = nullptr; merged_style_ = nullptr;
own_style_updated(); own_style_updated();
@ -109,7 +109,7 @@ namespace psemek::ui
if (c) c->style_updated(); if (c) c->style_updated();
} }
void element::own_style_updated() void element::own_style_updated() const
{ {
merged_own_style_ = nullptr; merged_own_style_ = nullptr;
} }

View file

@ -84,14 +84,14 @@ namespace psemek::ui
return {state.size[1], inf}; return {state.size[1], inf};
} }
void label::style_updated() void label::style_updated() const
{ {
element::style_updated(); element::style_updated();
cached_state_.reset(); cached_state_.reset();
cached_state_inf_.reset(); cached_state_inf_.reset();
} }
void label::own_style_updated() void label::own_style_updated() const
{ {
element::own_style_updated(); element::own_style_updated();
cached_state_.reset(); cached_state_.reset();