| 219 | |
| 220 | |
| 221 | struct CableOpacityQuantity : Quantity { |
| 222 | void setValue(float value) override { |
| 223 | settings::cableOpacity = math::clamp(value, getMinValue(), getMaxValue()); |
| 224 | } |
| 225 | float getValue() override { |
| 226 | return settings::cableOpacity; |
| 227 | } |
| 228 | float getDefaultValue() override { |
| 229 | return 0.5; |
| 230 | } |
| 231 | float getDisplayValue() override { |
| 232 | return getValue() * 100; |
| 233 | } |
| 234 | void setDisplayValue(float displayValue) override { |
| 235 | setValue(displayValue / 100); |
| 236 | } |
| 237 | std::string getLabel() override { |
| 238 | return string::translate("MenuBar.view.cableOpacity"); |
| 239 | } |
| 240 | std::string getUnit() override { |
| 241 | return "%"; |
| 242 | } |
| 243 | }; |
| 244 | struct CableOpacitySlider : ui::Slider { |
| 245 | CableOpacitySlider() { |
| 246 | quantity = new CableOpacityQuantity; |
nothing calls this directly
no outgoing calls
no test coverage detected