15 setTextBoxStyle(Slider::NoTextBox,
true, 0, 0);
16 setColour(Slider::backgroundColourId, Colour(0xff303030));
17 setColour(Slider::textBoxOutlineColourId, Colour(0x00000000));
24 static constexpr float kLightHeightPercent = 0.08f;
25 int selected = getValue();
26 int num_types = getMaximum() - getMinimum() + 1;
27 int from_highlight = getTabX(selected);
28 int to_highlight = getTabX(selected + 1);
29 int light_height = std::max<int>(getHeight() * kLightHeightPercent, 1);
33 highlight_color = highlight_color.withSaturation(0.0f);
36 g.fillRect(0, 0, getWidth(), light_height);
38 g.setColour(highlight_color);
39 g.fillRect(from_highlight, 0, to_highlight - from_highlight, light_height);
41 g.setFont(
Fonts::instance()->proportional_light().withPointHeight(getHeight() * font_height_percent_));
42 for (
int i = 0; i < num_types && i < names_.size(); ++i) {
43 std::string name = names_[i];
44 int from_x = getTabX(i);
45 int to_x = getTabX(i + 1);
47 g.setColour(highlight_color);
51 g.drawText(name, from_x, 0, to_x - from_x, getHeight(), Justification::centred);
void setComponent(Component *component)
Sets the component to be drawn into the OpenGL image. If not set, uses this component.
Definition open_gl_image_component.h:83