Add slider colour modifier and active-highlight
parent
47d1d19a6c
commit
3009f08a76
|
@ -89,7 +89,7 @@ void HSlider::OnPaint() const
|
||||||
|
|
||||||
glBindTexture(GL_TEXTURE_2D, tex->tex[t]);
|
glBindTexture(GL_TEXTURE_2D, tex->tex[t]);
|
||||||
glBegin(GL_QUADS);
|
glBegin(GL_QUADS);
|
||||||
glColor4f(1.0, 0.0, 0.0, 0.5);
|
if (this->colour.a) glColor4f(colour.r, colour.g, colour.b, colour.a);
|
||||||
glTexCoord2f(0.0, 0.0);
|
glTexCoord2f(0.0, 0.0);
|
||||||
glVertex2f( mx, my);
|
glVertex2f( mx, my);
|
||||||
glTexCoord2f(0.0, 1.0);
|
glTexCoord2f(0.0, 1.0);
|
||||||
|
@ -196,7 +196,7 @@ void VSlider::OnPaint() const
|
||||||
|
|
||||||
glBindTexture(GL_TEXTURE_2D, tex->tex[t]);
|
glBindTexture(GL_TEXTURE_2D, tex->tex[t]);
|
||||||
glBegin(GL_QUADS);
|
glBegin(GL_QUADS);
|
||||||
if (big) glColor3f(1.f, 0.f, 0.f);
|
if (this->colour.a) glColor4f(colour.r, colour.g, colour.b, colour.a);
|
||||||
glTexCoord2f(0.0, 0.0);
|
glTexCoord2f(0.0, 0.0);
|
||||||
glVertex2f( mx, my);
|
glVertex2f( mx, my);
|
||||||
glTexCoord2f(0.0, 1.0);
|
glTexCoord2f(0.0, 1.0);
|
||||||
|
@ -209,12 +209,14 @@ void VSlider::OnPaint() const
|
||||||
|
|
||||||
glDisable(GL_TEXTURE_2D);
|
glDisable(GL_TEXTURE_2D);
|
||||||
|
|
||||||
/* glBegin(GL_QUADS);
|
if (this->active) {
|
||||||
glColor4f(0.5f, 0.3f, 0.5f, 0.5f);
|
glBegin(GL_LINE_LOOP);
|
||||||
glVertex2f( x, y);
|
glColor4f(1.f, 1.f, 1.0f, 0.25f);
|
||||||
glVertex2f( x, h + y);
|
glVertex2f( x + .5f, y + .5f);
|
||||||
glVertex2f(w + x, h + y);
|
glVertex2f( x + .5f, h + y - .5f);
|
||||||
glVertex2f(w + x, y);
|
glVertex2f(w + x - .5f, h + y - .5f);
|
||||||
glEnd();*/
|
glVertex2f(w + x - .5f, y + .5f);
|
||||||
|
glEnd();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
#define SLIDER_H
|
#define SLIDER_H
|
||||||
|
|
||||||
struct Slider : Widget {
|
struct Slider : Widget {
|
||||||
|
Colour colour;
|
||||||
bool big;
|
bool big;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue