From: daid303 Date: Tue, 11 Jun 2013 09:41:43 +0000 (+0200) Subject: Update the progressbar to look better. X-Git-Tag: 13.06.2~18 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=20f4051835b2d929866afaa10624f586158c4590;p=cura.git Update the progressbar to look better. --- diff --git a/Cura/gui/util/opengl.py b/Cura/gui/util/opengl.py index a9de759c..89d79606 100644 --- a/Cura/gui/util/opengl.py +++ b/Cura/gui/util/opengl.py @@ -299,6 +299,18 @@ def glDrawStringRight(s): for c in s: glutBitmapCharacter(OpenGL.GLUT.GLUT_BITMAP_HELVETICA_18, ord(c)) +def glDrawQuad(x, y, w, h): + glPushMatrix() + glTranslatef(x, y, 0) + glDisable(GL_TEXTURE_2D) + glBegin(GL_QUADS) + glVertex2f(w, 0) + glVertex2f(0, 0) + glVertex2f(0, h) + glVertex2f(w, h) + glEnd() + glPopMatrix() + def glDrawTexturedQuad(x, y, w, h, texID, mirror = 0): tx = float(texID % 4) / 4 ty = float(int(texID / 4)) / 8 diff --git a/Cura/gui/util/openglGui.py b/Cura/gui/util/openglGui.py index 8a194b55..aee5ac97 100644 --- a/Cura/gui/util/openglGui.py +++ b/Cura/gui/util/openglGui.py @@ -475,10 +475,10 @@ class glButton(glGuiControl): glPopMatrix() progress = self._progressBar if progress is not None: - glColor4ub(255,255,255,192) - opengl.glDrawTexturedQuad(pos[0]-bs/2, pos[1]+bs/2, bs, bs / 4, 0) + glColor4ub(60,60,60,255) + opengl.glDrawQuad(pos[0]-bs/2, pos[1]+bs/2, bs, bs / 4) glColor4ub(255,255,255,255) - opengl.glDrawTexturedQuad(pos[0]-bs/2, pos[1]+bs/2, bs * progress, bs / 4, 0) + opengl.glDrawQuad(pos[0]-bs/2+2, pos[1]+bs/2+2, (bs - 5) * progress + 1, bs / 4 - 4) elif len(self._altTooltip) > 0: glPushMatrix() glTranslatef(pos[0], pos[1], 0)