chiark / gitweb /
Update the progressbar to look better.
authordaid303 <daid303@gmail.com>
Tue, 11 Jun 2013 09:41:43 +0000 (11:41 +0200)
committerdaid303 <daid303@gmail.com>
Tue, 11 Jun 2013 09:41:43 +0000 (11:41 +0200)
Cura/gui/util/opengl.py
Cura/gui/util/openglGui.py

index a9de759c599288c8f2d47d4ef1af81d0cc2f1926..89d79606e81d696a16b70636ecb22c2ad8b3c780 100644 (file)
@@ -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
index 8a194b5506266da6e8ad3d05d6b04dc2b9a04ec7..aee5ac979403d36b451c8045f0820f1ae7dc9a9b 100644 (file)
@@ -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)