Remove some GTK-specific close buttons (as gnome now has close titlebar in dialogs for a while) and resize some dialogs

This commit is contained in:
DarkPhoenix
2019-04-18 16:58:28 +03:00
parent 72ecc62732
commit febc98045c
3 changed files with 13 additions and 25 deletions

View File

@@ -90,8 +90,9 @@ class ItemStatsDialog(wx.Dialog):
" (%d)" % item.ID if config.debug else ""))
self.SetMinSize((300, 200))
if "wxGTK" in wx.PlatformInfo: # GTK has huge tab widgets, give it a bit more room
self.SetSize((640, 620))
# GTK has huge tab widgets, give it a bit more room
if "wxGTK" in wx.PlatformInfo:
self.SetSize((640, 600))
else:
self.SetSize((550, 500))
# self.SetMaxSize((500, -1))
@@ -99,11 +100,6 @@ class ItemStatsDialog(wx.Dialog):
self.container = ItemStatsContainer(self, victim, item, itmContext)
self.mainSizer.Add(self.container, 1, wx.EXPAND)
if "wxGTK" in wx.PlatformInfo:
self.closeBtn = wx.Button(self, wx.ID_ANY, "Close", wx.DefaultPosition, wx.DefaultSize, 0)
self.mainSizer.Add(self.closeBtn, 0, wx.ALL | wx.ALIGN_RIGHT, 5)
self.closeBtn.Bind(wx.EVT_BUTTON, (lambda e: self.Close()))
self.SetSizer(self.mainSizer)
self.parentWnd = gui.mainFrame.MainFrame.getInstance()

View File

@@ -89,7 +89,11 @@ class DmgPatternEditorDlg(wx.Dialog):
DAMAGE_TYPES = ("em", "thermal", "kinetic", "explosive")
def __init__(self, parent):
wx.Dialog.__init__(self, parent, id=wx.ID_ANY, title="Damage Pattern Editor", size=wx.Size(400, 240))
wx.Dialog.__init__(
self, parent, id=wx.ID_ANY,
title="Damage Pattern Editor",
# Dropdown list widget is scaled to its longest content line on GTK, adapt to that
size=wx.Size(500, 240) if "wxGTK" in wx.PlatformInfo else wx.Size(400, 240))
self.block = False
self.SetSizeHints(wx.DefaultSize, wx.DefaultSize)
@@ -159,11 +163,6 @@ class DmgPatternEditorDlg(wx.Dialog):
mainSizer.Add(contentSizer, 1, wx.EXPAND, 0)
if "wxGTK" in wx.PlatformInfo:
self.closeBtn = wx.Button(self, wx.ID_ANY, "Close", wx.DefaultPosition, wx.DefaultSize, 0)
mainSizer.Add(self.closeBtn, 0, wx.ALL | wx.ALIGN_RIGHT, 5)
self.closeBtn.Bind(wx.EVT_BUTTON, self.closeEvent)
self.SetSizer(mainSizer)
importExport = (("Import", wx.ART_FILE_OPEN, "from"),
@@ -192,9 +191,6 @@ class DmgPatternEditorDlg(wx.Dialog):
self.patternChanged()
def closeEvent(self, event):
self.Destroy()
def ValuesUpdated(self, event=None):
if self.block:
return

View File

@@ -87,7 +87,11 @@ class ResistsEditorDlg(wx.Dialog):
DAMAGE_TYPES = ("em", "thermal", "kinetic", "explosive")
def __init__(self, parent):
wx.Dialog.__init__(self, parent, id=wx.ID_ANY, title="Target Resists Editor", size=wx.Size(350, 240))
wx.Dialog.__init__(
self, parent, id=wx.ID_ANY,
# Dropdown list widget is scaled to its longest content line on GTK, adapt to that
title="Target Resists Editor",
size=wx.Size(500, 240) if "wxGTK" in wx.PlatformInfo else wx.Size(350, 240))
self.block = False
self.SetSizeHints(wx.DefaultSize, wx.DefaultSize)
@@ -150,11 +154,6 @@ class ResistsEditorDlg(wx.Dialog):
mainSizer.Add(contentSizer, 1, wx.EXPAND, 0)
if "wxGTK" in wx.PlatformInfo:
self.closeBtn = wx.Button(self, wx.ID_ANY, "Close", wx.DefaultPosition, wx.DefaultSize, 0)
mainSizer.Add(self.closeBtn, 0, wx.ALL | wx.ALIGN_RIGHT, 5)
self.closeBtn.Bind(wx.EVT_BUTTON, self.closeEvent)
self.SetSizer(mainSizer)
importExport = (("Import", wx.ART_FILE_OPEN, "from"),
@@ -189,9 +188,6 @@ class ResistsEditorDlg(wx.Dialog):
self.ShowModal()
def closeEvent(self, event):
self.Destroy()
def ValuesUpdated(self, event=None):
"""
Event that is fired when resists values change. Iterates through all