diff --git a/gui/builtinPreferenceViews/pyfaMarketPreferences.py b/gui/builtinPreferenceViews/pyfaMarketPreferences.py index 26c647557..200993e5a 100644 --- a/gui/builtinPreferenceViews/pyfaMarketPreferences.py +++ b/gui/builtinPreferenceViews/pyfaMarketPreferences.py @@ -34,6 +34,21 @@ class PFMarketPref(PreferenceView): self.m_staticline1 = wx.StaticLine(panel, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL) mainSizer.Add(self.m_staticline1, 0, wx.EXPAND | wx.TOP | wx.BOTTOM, 5) + self.tbTotalPriceBox = wx.StaticBoxSizer(wx.VERTICAL, panel, "Total Price Includes") + self.tbTotalPriceDrones = wx.CheckBox(panel, -1, "Drones", wx.DefaultPosition, wx.DefaultSize, 1) + self.tbTotalPriceDrones.SetValue(self.priceSettings.get("drones")) + self.tbTotalPriceDrones.Bind(wx.EVT_CHECKBOX, self.OnTotalPriceDroneChange) + self.tbTotalPriceBox.Add(self.tbTotalPriceDrones) + self.tbTotalPriceCargo = wx.CheckBox(panel, -1, "Cargo", wx.DefaultPosition, wx.DefaultSize, 1) + self.tbTotalPriceCargo.SetValue(self.priceSettings.get("cargo")) + self.tbTotalPriceCargo.Bind(wx.EVT_CHECKBOX, self.OnTotalPriceCargoChange) + self.tbTotalPriceBox.Add(self.tbTotalPriceCargo) + self.tbTotalPriceCharacter = wx.CheckBox(panel, -1, "Implants && Boosters", wx.DefaultPosition, wx.DefaultSize, 1) + self.tbTotalPriceCharacter.SetValue(self.priceSettings.get("character")) + self.tbTotalPriceCharacter.Bind(wx.EVT_CHECKBOX, self.OnTotalPriceCharacterChange) + self.tbTotalPriceBox.Add(self.tbTotalPriceCharacter) + mainSizer.Add(self.tbTotalPriceBox, 0, wx.TOP | wx.RIGHT | wx.EXPAND, 5) + priceSizer = wx.BoxSizer(wx.HORIZONTAL) self.stDefaultSystem = wx.StaticText(panel, wx.ID_ANY, "Default Market Prices:", wx.DefaultPosition, wx.DefaultSize, 0) self.stDefaultSystem.Wrap(-1) @@ -52,21 +67,6 @@ class PFMarketPref(PreferenceView): self.chPriceSystem.SetStringSelection(self.sFit.serviceFittingOptions["priceSystem"]) self.chPriceSystem.Bind(wx.EVT_CHOICE, self.onPriceSelection) - self.tbTotalPriceBox = wx.StaticBoxSizer(wx.VERTICAL, panel, "Total Price Includes") - self.tbTotalPriceDrones = wx.CheckBox(panel, -1, "Drones", wx.DefaultPosition, wx.DefaultSize, 1) - self.tbTotalPriceDrones.SetValue(self.priceSettings.get("drones")) - self.tbTotalPriceDrones.Bind(wx.EVT_CHECKBOX, self.OnTotalPriceDroneChange) - self.tbTotalPriceBox.Add(self.tbTotalPriceDrones) - self.tbTotalPriceCargo = wx.CheckBox(panel, -1, "Cargo", wx.DefaultPosition, wx.DefaultSize, 1) - self.tbTotalPriceCargo.SetValue(self.priceSettings.get("cargo")) - self.tbTotalPriceCargo.Bind(wx.EVT_CHECKBOX, self.OnTotalPriceCargoChange) - self.tbTotalPriceBox.Add(self.tbTotalPriceCargo) - self.tbTotalPriceCharacter = wx.CheckBox(panel, -1, "Implants && Boosters", wx.DefaultPosition, wx.DefaultSize, 1) - self.tbTotalPriceCharacter.SetValue(self.priceSettings.get("character")) - self.tbTotalPriceCharacter.Bind(wx.EVT_CHECKBOX, self.OnTotalPriceCharacterChange) - self.tbTotalPriceBox.Add(self.tbTotalPriceCharacter) - mainSizer.Add(self.tbTotalPriceBox, 1, wx.TOP | wx.RIGHT, 5) - delayTimer = wx.BoxSizer(wx.HORIZONTAL) self.stMarketDelay = wx.StaticText(panel, wx.ID_ANY, "Market Search Delay (ms):", wx.DefaultPosition, wx.DefaultSize, 0) self.stMarketDelay.Wrap(-1) @@ -81,17 +81,17 @@ class PFMarketPref(PreferenceView): self.rbMarketSearch = wx.RadioBox(panel, -1, "Market Search", wx.DefaultPosition, wx.DefaultSize, ["No changes to metagroups", "Temporarily enable all metagroups"], 1, wx.RA_SPECIFY_COLS) self.rbMarketSearch.SetSelection(self.priceSettings.get('marketMGSearchMode')) - mainSizer.Add(self.rbMarketSearch, 1, wx.ALL, 5) + mainSizer.Add(self.rbMarketSearch, 0, wx.ALL | wx.EXPAND, 5) self.rbMarketSearch.Bind(wx.EVT_RADIOBOX, self.OnMarketSearchChange) self.rbMarketJump = wx.RadioBox(panel, -1, "Item Market Group Jump", wx.DefaultPosition, wx.DefaultSize, ["No changes to metagroups", "Enable item's metagroup", "Enable item's metagroup, disable others", "Enable all metagroups"], 1, wx.RA_SPECIFY_COLS) self.rbMarketJump.SetSelection(self.priceSettings.get('marketMGJumpMode')) - mainSizer.Add(self.rbMarketJump, 1, wx.ALL, 5) + mainSizer.Add(self.rbMarketJump, 0, wx.ALL | wx.EXPAND, 5) self.rbMarketJump.Bind(wx.EVT_RADIOBOX, self.OnMarketJumpChange) self.rbMarketEmpty = wx.RadioBox(panel, -1, "Empty Market View", wx.DefaultPosition, wx.DefaultSize, ["No changes to metagroups", "Enable leftmost available metagroup", "Enable all available metagroups", "Enable all metagroups"], 1, wx.RA_SPECIFY_COLS) self.rbMarketEmpty.SetSelection(self.priceSettings.get('marketMGEmptyMode')) - mainSizer.Add(self.rbMarketEmpty, 1, wx.ALL, 5) + mainSizer.Add(self.rbMarketEmpty, 0, wx.ALL | wx.EXPAND, 5) self.rbMarketEmpty.Bind(wx.EVT_RADIOBOX, self.OnMarketEmptyChange) self.cbMarketShortcuts = wx.CheckBox(panel, wx.ID_ANY, "Show market shortcuts", wx.DefaultPosition, wx.DefaultSize, 0) diff --git a/gui/preferenceDialog.py b/gui/preferenceDialog.py index 37ca5ddaf..f65c8451f 100644 --- a/gui/preferenceDialog.py +++ b/gui/preferenceDialog.py @@ -66,12 +66,10 @@ class PreferenceDialog(wx.Dialog): self.listbook.AddPage(page, prefView.title, imageId=imgID) - minHeight = 550 bestFit = self.GetBestVirtualSize() - if minHeight > bestFit[1]: - self.SetSize(650, minHeight) - else: - self.SetSize(650, bestFit[1]) + width = max(bestFit[0], 800 if "wxGTK" in wx.PlatformInfo else 650) + height = max(bestFit[1], 550) + self.SetSize(width, height) self.Layout()