chiark / gitweb /
Moved the youmagine button to the 3D view, still not really happy about it yet.
authordaid <daid303@gmail.com>
Tue, 20 Aug 2013 10:27:38 +0000 (12:27 +0200)
committerdaid <daid303@gmail.com>
Tue, 20 Aug 2013 10:27:38 +0000 (12:27 +0200)
Cura/gui/mainWindow.py
Cura/gui/sceneView.py
Cura/gui/util/openglGui.py
Cura/resources/images/glButtons.png

index 3e7fa396d53e723bc2fe3d0e05dcea063550b0b8..9671c6ac542eb2ce29a3cfaa9c7563497b85351c 100644 (file)
@@ -18,7 +18,6 @@ from Cura.gui.util import dropTarget
 #from Cura.gui.tools import batchRun
 from Cura.gui.tools import pidDebugger
 from Cura.gui.tools import minecraftImport
-from Cura.gui.tools import youmagineGui
 from Cura.util import profile
 from Cura.util import version
 from Cura.util import meshLoader
@@ -167,14 +166,9 @@ class mainWindow(wx.Frame):
                self.simpleSettingsPanel = simpleMode.simpleModePanel(self.leftPane, lambda : self.scene.sceneUpdated())
                self.normalSettingsPanel = normalSettingsPanel(self.leftPane, lambda : self.scene.sceneUpdated())
 
-               self.youmagineButton = wx.BitmapButton(self.leftPane, -1, wx.Bitmap(resources.getPathForImage('youmagine-icon.png')))
-               self.youmagineButton.SetToolTipString("Share your design to YouMagine.com")
-               self.youmagineButton.Bind(wx.EVT_BUTTON, self.OnYouMagine)
-
                self.leftSizer = wx.BoxSizer(wx.VERTICAL)
                self.leftSizer.Add(self.simpleSettingsPanel, 1)
                self.leftSizer.Add(self.normalSettingsPanel, 1, wx.EXPAND)
-               self.leftSizer.Add(self.youmagineButton, 0, wx.ALIGN_CENTER)
                self.leftPane.SetSizer(self.leftSizer)
                
                #Preview window
@@ -255,7 +249,6 @@ class mainWindow(wx.Frame):
                        
                        # Change location of sash to width of quick mode pane 
                        (width, height) = self.simpleSettingsPanel.GetSizer().GetSize() 
-                       (width, height) = self.youmagineButton.GetSize()
                        self.splitter.SetSashPosition(width, True)
                        
                        # Disable sash
@@ -412,12 +405,6 @@ class mainWindow(wx.Frame):
                debugger.Centre()
                debugger.Show(True)
 
-       def OnYouMagine(self, e):
-               if len(self.scene._scene.objects()) < 1:
-                       wx.MessageBox('You cannot upload to YouMagine without have a file loaded.', 'Cura', wx.OK | wx.ICON_ERROR)
-                       return
-               youmagineGui.youmagineManager(self, self.scene._scene)
-
        def OnCheckForUpdate(self, e):
                newVersion = version.checkForNewerVersion()
                if newVersion is not None:
index 52daba81ef08a9c3172442b744e91ea8b7eb561a..ace09257f3e5e544318f60cadc3209e27b1020a9 100644 (file)
@@ -26,6 +26,7 @@ from Cura.util import gcodeInterpreter
 from Cura.gui.util import previewTools
 from Cura.gui.util import opengl
 from Cura.gui.util import openglGui
+from Cura.gui.tools import youmagineGui
 
 class SceneView(openglGui.glGuiPanel):
        def __init__(self, parent):
@@ -103,6 +104,8 @@ class SceneView(openglGui.glGuiPanel):
                self.viewSelection = openglGui.glComboButton(self, 'View mode', [7,19,11,15,23], ['Normal', 'Overhang', 'Transparent', 'X-Ray', 'Layers'], (-1,0), self.OnViewChange)
                self.layerSelect = openglGui.glSlider(self, 10000, 0, 1, (-1,-2), lambda : self.QueueRefresh())
 
+               self.youMagineButton = openglGui.glButton(self, 26, 'YouMagine', (2,0), lambda button: youmagineGui.youmagineManager(self.GetTopLevelParent(), self))
+
                self.notification = openglGui.glNotification(self, (0, 0))
 
                self._slicer = sliceEngine.Slicer(self._updateSliceProgress)
index ede15b6414d8a51492fa0e910733c75f1e39ddf6..4799cc3f3f3b3928dc2ad212a230cd362d19b36b 100644 (file)
@@ -266,24 +266,25 @@ class glGuiPanel(glcanvas.GLCanvas):
 
                self._container.draw()
 
-               glBindTexture(GL_TEXTURE_2D, self._glRobotTexture)
-               glEnable(GL_TEXTURE_2D)
-               glPushMatrix()
-               glColor4f(1,1,1,1)
-               glTranslate(size.GetWidth() - 8,size.GetHeight() - 32,0)
-               s = self._buttonSize * 1.4
-               glScale(s,s,s)
-               glBegin(GL_QUADS)
-               glTexCoord2f(1, 0)
-               glVertex2f(0,-1)
-               glTexCoord2f(0, 0)
-               glVertex2f(-1,-1)
-               glTexCoord2f(0, 1)
-               glVertex2f(-1, 0)
-               glTexCoord2f(1, 1)
-               glVertex2f(0, 0)
-               glEnd()
-               glDisable(GL_TEXTURE_2D)
+               # glBindTexture(GL_TEXTURE_2D, self._glRobotTexture)
+               # glEnable(GL_TEXTURE_2D)
+               # glPushMatrix()
+               # glColor4f(1,1,1,1)
+               # glTranslate(size.GetWidth(),size.GetHeight(),0)
+               # s = self._buttonSize * 1
+               # glScale(s,s,s)
+               # glTranslate(-1.2,-0.2,0)
+               # glBegin(GL_QUADS)
+               # glTexCoord2f(1, 0)
+               # glVertex2f(0,-1)
+               # glTexCoord2f(0, 0)
+               # glVertex2f(-1,-1)
+               # glTexCoord2f(0, 1)
+               # glVertex2f(-1, 0)
+               # glTexCoord2f(1, 1)
+               # glVertex2f(0, 0)
+               # glEnd()
+               # glDisable(GL_TEXTURE_2D)
                glPopMatrix()
 
        def _OnEraseBackground(self,event):
@@ -337,7 +338,7 @@ class glGuiLayoutButtons(object):
                        else:
                                x = pos[0] * gridSize + bs * 0.2
                        if pos[1] < 0:
-                               y = h + pos[1] * gridSize * 1.2 - bs * 0.2
+                               y = h + pos[1] * gridSize * 1.2 - bs * 0.0
                        else:
                                y = pos[1] * gridSize * 1.2 + bs * 0.2
                        ctrl.setSize(x, y, gridSize, gridSize)
index 2b91dda57bbad3a9a0742cc6e803c6a4e7fa9d78..a738ef5639c454587e30e7558a7095fcf5cd3f2b 100644 (file)
Binary files a/Cura/resources/images/glButtons.png and b/Cura/resources/images/glButtons.png differ