Added direct access to sections of discrete slider to derived classes.

This commit is contained in:
23rd 2024-11-05 06:56:20 +03:00
parent 146409844d
commit 63a8fe7ee8
2 changed files with 6 additions and 0 deletions

View file

@ -68,6 +68,10 @@ void DiscreteSlider::setSelectOnPress(bool selectOnPress) {
_selectOnPress = selectOnPress;
}
std::vector<DiscreteSlider::Section> &DiscreteSlider::sectionsRef() {
return _sections;
}
void DiscreteSlider::addSection(const QString &label) {
_sections.push_back(Section(label, getLabelStyle()));
resizeToWidth(width());

View file

@ -97,6 +97,8 @@ protected:
void setSelectOnPress(bool selectOnPress);
std::vector<Section> &sectionsRef();
private:
void activateCallback();
virtual const style::TextStyle &getLabelStyle() const = 0;