From: smorloc Date: Sat, 26 Jan 2013 05:20:28 +0000 (-0500) Subject: UI update to support MacOS X-Git-Tag: 13.03~64^2~3 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=5bfc255d5bd98f244aa0806a0694d7bb950480ab;p=cura.git UI update to support MacOS --- diff --git a/Cura/gui/configBase.py b/Cura/gui/configBase.py index caedc4e1..6388822e 100644 --- a/Cura/gui/configBase.py +++ b/Cura/gui/configBase.py @@ -1,5 +1,6 @@ from __future__ import absolute_import +import platform import wx, wx.lib.stattext, types from Cura.util import validators @@ -69,6 +70,9 @@ class configPanelBase(wx.Panel): leftConfigPanel.main = self rightConfigPanel.main = self + configPanel.leftPanel = leftConfigPanel + configPanel.rightPanel = rightConfigPanel + nb.AddPage(configPanel, name) return leftConfigPanel, rightConfigPanel, configPanel @@ -107,15 +111,6 @@ class configPanelBase(wx.Panel): setting.SetValue(profile.getPreference(setting.configName)) self.Update() - def XXXgetLabelColumnWidth(self): - maxWidth = 0 - for setting in self.settingControlList: - maxWidth = max(maxWidth, setting.label.GetWidth()) - - def XXXsetLabelColumnWidth(self, newWidth): - for setting in self.settingControlList: - setting.label.SetWidth(newWidth) - def getLabelColumnWidth(self, panel): maxWidth = 0 for child in panel.GetChildren(): @@ -128,10 +123,7 @@ class configPanelBase(wx.Panel): if isinstance(child, wx.lib.stattext.GenStaticText): size = child.GetSize() size[0] = width - #child.SetSize(size) child.SetBestSize(size) - #child.GetContainingSizer().Layout() - #child.SetBackgroundColour('Green') class TitleRow(): def __init__(self, panel, name): @@ -186,7 +178,12 @@ class SettingRow(): # Set the minimum size of control to something other than the humungous default minSize = self.ctrl.GetMinSize() - minSize[0] = 50 + + if platform.system() == "Darwin": + # Under MacOS, it appears that the minSize is used for the actual size... + minSize[0] = 150 + else: + minSize[0] = 50 self.ctrl.SetMinSize(minSize) sizer.Add(self.label, (x,y), flag=wx.ALIGN_CENTER_VERTICAL|wx.LEFT,border=10) diff --git a/Cura/gui/mainWindow.py b/Cura/gui/mainWindow.py index 37b45a3f..9cbbc5ee 100644 --- a/Cura/gui/mainWindow.py +++ b/Cura/gui/mainWindow.py @@ -692,10 +692,10 @@ class normalSettingsPanel(configBase.configPanelBase): # switch to horizontal # - col1 = configPanel.Children[0] + col1 = configPanel.leftPanel colSize1 = col1.GetSize() colBestSize1 = col1.GetBestSize() - col2 = configPanel.Children[1] + col2 = configPanel.rightPanel colSize2 = col2.GetSize() colBestSize2 = col2.GetBestSize() @@ -705,8 +705,8 @@ class normalSettingsPanel(configBase.configPanelBase): if (colSize1[0] <= colBestSize1[0]) or (colSize2[0] <= colBestSize2[0]): configPanel.Freeze() sizer = wx.BoxSizer(wx.VERTICAL) - sizer.Add(configPanel.Children[0], flag=wx.EXPAND) - sizer.Add(configPanel.Children[1], flag=wx.EXPAND) + sizer.Add(configPanel.leftPanel, flag=wx.EXPAND) + sizer.Add(configPanel.rightPanel, flag=wx.EXPAND) configPanel.SetSizer(sizer) #sizer.Layout() configPanel.Layout() @@ -716,8 +716,8 @@ class normalSettingsPanel(configBase.configPanelBase): if colSize1[0] > (colBestSize1[0] + colBestSize2[0]): configPanel.Freeze() sizer = wx.BoxSizer(wx.HORIZONTAL) - sizer.Add(configPanel.Children[0], proportion=1, border=35, flag=wx.EXPAND) - sizer.Add(configPanel.Children[1], proportion=1, flag=wx.EXPAND) + sizer.Add(configPanel.leftPanel, proportion=1, border=35, flag=wx.EXPAND) + sizer.Add(configPanel.rightPanel, proportion=1, flag=wx.EXPAND) configPanel.SetSizer(sizer) #sizer.Layout() configPanel.Layout()