|
43 | 43 |
|
44 | 44 | //============================================================================== |
45 | 45 |
|
46 | | -// Define to 1 to exclude the main slider graphics |
47 | | -#define DMT_EXCLUDE_SLIDER_GRAPHICS 0 |
48 | | - |
49 | | -// Define to 1 to exclude title/info labels |
50 | | -#define DMT_EXCLUDE_SLIDER_LABELS 0 |
| 46 | +// Slider graphics and labels are always included; remove conditional macros |
51 | 47 |
|
52 | 48 | //============================================================================== |
53 | 49 |
|
@@ -112,20 +108,12 @@ class LinearSliderComponent |
112 | 108 | TRACER("LinearSliderComponent::LinearSliderComponent"); |
113 | 109 | slider.addListener(this); |
114 | 110 | updateLabel(static_cast<float>(slider.getValue())); |
115 | | -#if DMT_EXCLUDE_SLIDER_GRAPHICS == 0 |
116 | 111 | addAndMakeVisible(slider); |
117 | | -#endif |
118 | | -#if DMT_EXCLUDE_SLIDER_LABELS == 0 |
119 | 112 | addAndMakeVisible(this->infoLabel); |
120 | | -#endif |
121 | 113 |
|
122 | 114 | if (_svgTitle) { |
123 | 115 | titleIcon = dmt::icons::getIcon(_param); |
124 | | -#if DMT_EXCLUDE_SLIDER_LABELS == 0 |
125 | | - this->titleLabel.setVisible(false); |
126 | | -#else |
127 | 116 | this->titleLabel.setVisible(false); |
128 | | -#endif |
129 | 117 | } |
130 | 118 |
|
131 | 119 | this->parameter = _apvts.getParameter(_param); |
@@ -166,36 +154,28 @@ class LinearSliderComponent |
166 | 154 | const auto titleSliderBounds = |
167 | 155 | titleLabelBounds.removeFromTop(titleLabelHeight) |
168 | 156 | .reduced(titleLabelOffset); |
169 | | -#if DMT_EXCLUDE_SLIDER_LABELS == 0 |
170 | 157 | this->titleLabel.setBounds(titleSliderBounds); |
171 | | -#endif |
172 | 158 | auto infoLabelBounds = sliderBounds; |
173 | 159 | const auto infoLabelHeight = |
174 | 160 | static_cast<int32_t>(2 * infoFontSize * this->size); |
175 | 161 | const auto infoLabelOffset = static_cast<int32_t>(9 * this->size); |
176 | 162 | const auto infoSliderBounds = |
177 | 163 | infoLabelBounds.removeFromBottom(infoLabelHeight) |
178 | 164 | .reduced(infoLabelOffset); |
179 | | -#if DMT_EXCLUDE_SLIDER_LABELS == 0 |
180 | 165 | this->infoLabel.setBounds(infoSliderBounds); |
181 | | -#endif |
182 | 166 | } |
183 | 167 | case Orientation::Vertical: { |
184 | | -#if DMT_EXCLUDE_SLIDER_LABELS == 0 |
185 | 168 | this->titleLabel.setBounds( |
186 | 169 | bounds.withTrimmedTop(static_cast<int32_t>(padding))); |
187 | 170 | this->infoLabel.setBounds( |
188 | 171 | bounds.withTrimmedBottom(static_cast<int32_t>(padding))); |
189 | | -#endif |
190 | 172 |
|
191 | 173 | auto sliderBounds = bounds; |
192 | 174 | sliderBounds.removeFromTop( |
193 | 175 | static_cast<int32_t>(titleFontSize * this->size + padding)); |
194 | 176 | sliderBounds.removeFromBottom( |
195 | 177 | static_cast<int32_t>(infoFontSize * this->size + padding)); |
196 | | -#if DMT_EXCLUDE_SLIDER_GRAPHICS == 0 |
197 | 178 | slider.setBounds(sliderBounds); |
198 | | -#endif |
199 | 179 | } |
200 | 180 | } |
201 | 181 | } |
|
0 commit comments