Commit 34e03b83 authored by Guillaume Seguin's avatar Guillaume Seguin

Add a Compact mode for 4/3 screens (#381)

parent 8e697fac
......@@ -292,9 +292,9 @@ class VizPane(wx.BoxSizer):
extrusion_width = root.settings.preview_extrusion_width)
root.gwindow.Bind(wx.EVT_CLOSE, lambda x: root.gwindow.Hide())
if not isinstance(root.gviz, NoViz):
self.Add(root.gviz.widget, 1, flag = wx.SHAPED)
self.Add(root.gviz.widget, 1, flag = wx.SHAPED | wx.ALIGN_CENTER_HORIZONTAL)
root.centersizer = wx.GridBagSizer()
self.Add(root.centersizer, 0, flag = wx.EXPAND)
self.Add(root.centersizer, 0, flag = wx.ALIGN_CENTER)
class LogPane(wx.BoxSizer):
......@@ -436,15 +436,29 @@ class MainWindow(wx.Frame):
self.cbuttons_panel = page1panel2
self.cbuttons_reload()
def createGui(self):
def createGui(self, compact = False):
self.mainsizer = wx.BoxSizer(wx.VERTICAL)
self.uppersizer = MainToolbar(self)
self.lowersizer = wx.BoxSizer(wx.HORIZONTAL)
self.lowersizer.Add(LeftPane(self), 0)
self.lowersizer.Add(VizPane(self), 1, wx.EXPAND|wx.ALIGN_CENTER_HORIZONTAL)
self.lowersizer.Add(LogPane(self), 1, wx.EXPAND)
self.mainsizer.Add(self.uppersizer, 0)
self.mainsizer.Add(self.lowersizer, 1, wx.EXPAND)
upperpanel = self.newPanel(self.panel)
self.uppersizer = MainToolbar(self, upperpanel)
lowerpanel = self.newPanel(self.panel)
upperpanel.SetSizer(self.uppersizer)
lowerpanel.SetSizer(self.lowersizer)
left_pane = LeftPane(self, lowerpanel)
left_pane.Layout() # required to get correct rows/cols counts
left_sizer = wx.BoxSizer(wx.VERTICAL)
left_sizer.Add(left_pane, 0)
self.lowersizer.Add(left_sizer, 0, wx.EXPAND)
self.lowersizer.Add(VizPane(self, lowerpanel), 1, wx.EXPAND | wx.ALIGN_CENTER)
logpanel = self.newPanel(lowerpanel)
log_pane = LogPane(self, logpanel)
logpanel.SetSizer(log_pane)
if compact:
left_sizer.Add(logpanel, 1, wx.EXPAND)
else:
self.lowersizer.Add(logpanel, 1, wx.EXPAND)
self.mainsizer.Add(upperpanel, 0)
self.mainsizer.Add(lowerpanel, 1, wx.EXPAND)
self.panel.SetSizer(self.mainsizer)
self.status = self.CreateStatusBar()
self.status.SetStatusText(_("Not connected to printer."))
......@@ -467,5 +481,5 @@ class MainWindow(wx.Frame):
i.Disable()
#self.panel.Fit()
self.cbuttons_panel = self.panel
self.cbuttons_panel = lowerpanel
self.cbuttons_reload()
......@@ -183,7 +183,7 @@ class PronterWindow(MainWindow, pronsole.pronsole):
self.settings._add(monitorsetting)
self.settings._add(BuildDimensionsSetting("build_dimensions", "200x200x100+0+0+0+0+0+0", _("Build dimensions"), _("Dimensions of Build Platform\n & optional offset of origin\n & optional switch position\n\nExamples:\n XXXxYYY\n XXX,YYY,ZZZ\n XXXxYYYxZZZ+OffX+OffY+OffZ\nXXXxYYYxZZZ+OffX+OffY+OffZ+HomeX+HomeY+HomeZ"), "Printer"))
self.settings._add(StringSetting("bgcolor", "#FFFFFF", _("Background color"), _("Pronterface background color (default: #FFFFFF)"), "UI"))
self.settings._add(BooleanSetting("tabbed", False, _("Use tabbed interface"), _("Use tabbed interface instead of the single window one"), "UI"))
self.settings._add(ComboSetting("uimode", "Standard", ["Standard", "Compact", "Tabbed"], _("Interface mode"), _("Standard interface is a one-page, three columns layout with controls/visualization/log\nCompact mode is a one-page, two columns layout with controls + log/visualization\nTabbed mode is a two-pages mode, where the first page shows controls and the second one shows visualization and log."), "UI"))
self.settings._add(BooleanSetting("viz3d", False, _("Enable 3D viewer (requires restarting)"), _("Use 3D visualization instead of 2D layered visualization"), "UI"))
self.settings._add(ComboSetting("mainviz", "2D", ["2D", "3D", "None"], _("Main visualization"), _("Select visualization for main window."), "UI"))
self.settings._add(BooleanSetting("tempgauges", False, _("Display temperature gauges"), _("Display graphical gauges for temperatures visualization"), "UI"))
......@@ -277,10 +277,10 @@ class PronterWindow(MainWindow, pronsole.pronsole):
except:
pass
self.popmenu()
if self.settings.tabbed:
if self.settings.uimode == "Tabbed":
self.createTabbedGui()
else:
self.createGui()
self.createGui(self.settings.uimode == "Compact")
self.t = Tee(self.catchprint)
self.stdout = sys.stdout
self.skeining = 0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment