From: Daid Date: Mon, 15 Oct 2012 09:58:00 +0000 (+0200) Subject: Various fixes to improve button layout on MacOS. X-Git-Tag: 13.03~248 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=45212294db9778398b1df5c1346313d32f11976a;p=cura.git Various fixes to improve button layout on MacOS. --- diff --git a/Cura/gui/configBase.py b/Cura/gui/configBase.py index 491d3325..0539ae0d 100644 --- a/Cura/gui/configBase.py +++ b/Cura/gui/configBase.py @@ -64,12 +64,8 @@ class configWindowBase(wx.Frame): self.popup.text.SetLabel(setting.helpText) self.popup.text.Wrap(350) self.popup.Fit() - if sys.platform == 'darwin': - x, y = self.ClientToScreenXY(0, 0) - sx, sy = self.GetClientSizeTuple() - else: - x, y = setting.ctrl.ClientToScreenXY(0, 0) - sx, sy = setting.ctrl.GetSizeTuple() + x, y = setting.ctrl.ClientToScreenXY(0, 0) + sx, sy = setting.ctrl.GetSizeTuple() #if platform.system() == "Windows": # for some reason, under windows, the popup is relative to the main window... in some cases. (Wierd ass bug) # wx, wy = self.ClientToScreenXY(0, 0) @@ -93,8 +89,8 @@ class TitleRow(): x = sizer.GetRows() self.title = wx.StaticText(panel, -1, name) self.title.SetFont(wx.Font(wx.SystemSettings.GetFont(wx.SYS_ANSI_VAR_FONT).GetPointSize(), wx.FONTFAMILY_DEFAULT, wx.NORMAL, wx.FONTWEIGHT_BOLD)) - sizer.Add(self.title, (x,0), (1,3), flag=wx.EXPAND|wx.TOP, border=10) - sizer.Add(wx.StaticLine(panel), (x+1,0), (1,3), flag=wx.EXPAND) + sizer.Add(self.title, (x,0), (1,3), flag=wx.EXPAND|wx.TOP|wx.LEFT, border=10) + sizer.Add(wx.StaticLine(panel), (x+1,0), (1,3), flag=wx.EXPAND|wx.LEFT,border=10) sizer.SetRows(x + 2) class SettingRow(): @@ -136,7 +132,7 @@ class SettingRow(): self.ctrl.Bind(wx.EVT_COMBOBOX, self.OnSettingChange) flag = wx.EXPAND - sizer.Add(self.label, (x,y), flag=wx.ALIGN_CENTER_VERTICAL) + sizer.Add(self.label, (x,y), flag=wx.ALIGN_CENTER_VERTICAL|wx.LEFT,border=10) sizer.Add(self.ctrl, (x,y+1), flag=wx.ALIGN_BOTTOM|flag) sizer.SetRows(x+1) diff --git a/Cura/gui/mainWindow.py b/Cura/gui/mainWindow.py index ec8b53cb..3da92975 100644 --- a/Cura/gui/mainWindow.py +++ b/Cura/gui/mainWindow.py @@ -238,15 +238,15 @@ class mainWindow(configBase.configWindowBase): sizer.Add(self.preview3d, (0,1), span=(1,2+extruderCount), flag=wx.EXPAND) sizer.AddGrowableCol(2 + extruderCount) sizer.AddGrowableRow(0) - sizer.Add(loadButton, (1,1), flag=wx.RIGHT, border=5) + sizer.Add(loadButton, (1,1), flag=wx.RIGHT|wx.BOTTOM|wx.TOP, border=5) if extruderCount > 1: - sizer.Add(loadButton2, (1,2), flag=wx.RIGHT, border=5) + sizer.Add(loadButton2, (1,2), flag=wx.RIGHT|wx.BOTTOM|wx.TOP, border=5) if extruderCount > 2: - sizer.Add(loadButton3, (1,3), flag=wx.RIGHT, border=5) + sizer.Add(loadButton3, (1,3), flag=wx.RIGHT|wx.BOTTOM|wx.TOP, border=5) if extruderCount > 3: - sizer.Add(loadButton4, (1,4), flag=wx.RIGHT, border=5) - sizer.Add(sliceButton, (1,1+extruderCount), flag=wx.RIGHT, border=5) - sizer.Add(printButton, (1,2+extruderCount), flag=wx.RIGHT, border=5) + sizer.Add(loadButton4, (1,4), flag=wx.RIGHT|wx.BOTTOM|wx.TOP, border=5) + sizer.Add(sliceButton, (1,1+extruderCount), flag=wx.RIGHT|wx.BOTTOM|wx.TOP, border=5) + sizer.Add(printButton, (1,2+extruderCount), flag=wx.RIGHT|wx.BOTTOM|wx.TOP, border=5) self.sizer = sizer if len(self.filelist) > 0: diff --git a/Cura/gui/preferencesDialog.py b/Cura/gui/preferencesDialog.py index 0909697d..d849af29 100644 --- a/Cura/gui/preferencesDialog.py +++ b/Cura/gui/preferencesDialog.py @@ -67,7 +67,7 @@ class preferencesDialog(configBase.configWindowBase): c = configBase.SettingRow(right, 'Copy to SD with 8.3 names', 'sdshortnames', False, 'Save the gcode files in short filenames, so they are properly shown on the UltiController', type = 'preference') self.okButton = wx.Button(right, -1, 'Ok') - right.GetSizer().Add(self.okButton, (right.GetSizer().GetRows(), 0)) + right.GetSizer().Add(self.okButton, (right.GetSizer().GetRows(), 0), flag=wx.BOTTOM, border=5) self.okButton.Bind(wx.EVT_BUTTON, self.OnClose) self.MakeModal(True) diff --git a/Cura/gui/printWindow.py b/Cura/gui/printWindow.py index 1f5dcf51..36926250 100644 --- a/Cura/gui/printWindow.py +++ b/Cura/gui/printWindow.py @@ -44,7 +44,6 @@ class printProcessMonitor(): if platform.machine() == 'i386': cmdList.insert(0, 'arch') cmdList.insert(1, '-i386') - print cmdList self.handle = subprocess.Popen(cmdList, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE) self.thread = threading.Thread(target=self.Monitor) self.thread.start() @@ -301,7 +300,7 @@ class printWindow(wx.Frame): self.Centre() self.statsText.SetMinSize(self.statsText.GetSize()) - + self.UpdateButtonStates() #self.UpdateProgress() diff --git a/Cura/gui/simpleMode.py b/Cura/gui/simpleMode.py index 4a7470b7..faf7dd31 100644 --- a/Cura/gui/simpleMode.py +++ b/Cura/gui/simpleMode.py @@ -116,9 +116,9 @@ class simpleModeWindow(configBase.configWindowBase): sizer.Add(self.preview3d, (0,1), span=(1,3), flag=wx.EXPAND) sizer.AddGrowableCol(2) sizer.AddGrowableRow(0) - sizer.Add(loadButton, (1,1), flag=wx.RIGHT, border=5) - sizer.Add(sliceButton, (1,2), flag=wx.RIGHT, border=5) - sizer.Add(printButton, (1,3), flag=wx.RIGHT, border=5) + sizer.Add(loadButton, (1,1), flag=wx.RIGHT|wx.BOTTOM|wx.TOP, border=5) + sizer.Add(sliceButton, (1,2), flag=wx.RIGHT|wx.BOTTOM|wx.TOP, border=5) + sizer.Add(printButton, (1,3), flag=wx.RIGHT|wx.BOTTOM|wx.TOP, border=5) self.sizer = sizer if len(self.filelist) > 0: @@ -126,6 +126,9 @@ class simpleModeWindow(configBase.configWindowBase): self.updateProfileToControls() + self.printTypeNormal.SetValue(True) + self.printMaterialPLA.SetValue(True) + self.Fit() self.SetMinSize(self.GetSize()) self.Centre() diff --git a/Cura/gui/toolbarUtil.py b/Cura/gui/toolbarUtil.py index 64dc9840..ad7770a2 100644 --- a/Cura/gui/toolbarUtil.py +++ b/Cura/gui/toolbarUtil.py @@ -48,12 +48,8 @@ class Toolbar(wx.ToolBar): popup.text.SetLabel(control.helpText) popup.text.Wrap(350) popup.Fit(); - if sys.platform == 'darwin': - x, y = self.GetParent().ClientToScreenXY(0, 0) - sx, sy = self.GetParent().GetClientSizeTuple() - else: - x, y = control.ClientToScreenXY(0, 0) - sx, sy = control.GetSizeTuple() + x, y = control.ClientToScreenXY(0, 0) + sx, sy = control.GetSizeTuple() popup.SetPosition((x, y+sy)) class ToggleButton(buttons.GenBitmapToggleButton):