From ccd3665115b5fd44cada7935410b289c3ca75cb6 Mon Sep 17 00:00:00 2001 From: Ryan Holmes Date: Sun, 17 Mar 2019 09:01:40 -0400 Subject: [PATCH 1/4] Do not call Layout on the skill tree view. #1866 --- gui/characterEditor.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gui/characterEditor.py b/gui/characterEditor.py index 2b4d59341..6586f5936 100644 --- a/gui/characterEditor.py +++ b/gui/characterEditor.py @@ -427,7 +427,8 @@ class SkillTreeView(wx.Panel): self.levelChangeMenu.Bind(wx.EVT_MENU, self.changeLevel) self.SetSizer(pmainSizer) - self.Layout() + # This cuases issues with GTK, see #1866 + # self.Layout() def importSkills(self, evt): From 19f02ef914d358104e15276f184906933333b475 Mon Sep 17 00:00:00 2001 From: Ryan Holmes Date: Sun, 17 Mar 2019 09:06:47 -0400 Subject: [PATCH 2/4] Align skill column to the right (#1866) --- gui/characterEditor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gui/characterEditor.py b/gui/characterEditor.py index 6586f5936..2bcda4598 100644 --- a/gui/characterEditor.py +++ b/gui/characterEditor.py @@ -353,7 +353,7 @@ class SkillTreeView(wx.Panel): self.skillBookDirtyImageId = self.imageList.Add(wx.Icon(BitmapLoader.getBitmap("skill_small_red", "gui"))) tree.AppendColumn("Skill") - tree.AppendColumn("Level") + tree.AppendColumn("Level", align=wx.ALIGN_RIGHT) # tree.SetMainColumn(0) self.root = tree.GetRootItem() From 3c98aad4ba5bc38f1dd4107324ffe0363329744e Mon Sep 17 00:00:00 2001 From: Ryan Holmes Date: Sun, 17 Mar 2019 19:35:19 -0400 Subject: [PATCH 3/4] Autosize the item attribute columns (#1878). --- gui/builtinItemStatsViews/itemAttributes.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/gui/builtinItemStatsViews/itemAttributes.py b/gui/builtinItemStatsViews/itemAttributes.py index 350501e61..20065b6b0 100644 --- a/gui/builtinItemStatsViews/itemAttributes.py +++ b/gui/builtinItemStatsViews/itemAttributes.py @@ -19,7 +19,8 @@ class AttributeView(IntEnum): class ItemParams(wx.Panel): def __init__(self, parent, stuff, item, context=None): - wx.Panel.__init__(self, parent) + # Had to manually set the size here, otherwise column widths couldn't be calculated correctly. See #1878 + wx.Panel.__init__(self, parent, size=(1000, 1000)) mainSizer = wx.BoxSizer(wx.VERTICAL) self.paramList = wx.lib.agw.hypertreelist.HyperTreeList(self, wx.ID_ANY, agwStyle=wx.TR_HIDE_ROOT | wx.TR_NO_LINES | wx.TR_FULL_ROW_HIGHLIGHT | wx.TR_HAS_BUTTONS) @@ -40,9 +41,6 @@ class ItemParams(wx.Panel): if self.stuff is not None: self.paramList.AddColumn("Base Value") - self.paramList.SetMainColumn(0) # the one with the tree in it... - self.paramList.SetColumnWidth(0, 300) - self.m_staticline = wx.StaticLine(self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL) mainSizer.Add(self.m_staticline, 0, wx.EXPAND) bSizer = wx.BoxSizer(wx.HORIZONTAL) @@ -255,6 +253,9 @@ class ItemParams(wx.Panel): self.Layout() + for i in range(self.paramList.GetMainWindow().GetColumnCount()): + self.paramList.SetColumnWidth(i, wx.LIST_AUTOSIZE) + def GetData(self, attr): info = self.attrInfo.get(attr) att = self.attrValues[attr] @@ -355,6 +356,7 @@ if __name__ == "__main__": #item = eos.db.getItem(526) # Stasis Webifier I item = eos.db.getItem(486) # 200mm AutoCannon I #item = eos.db.getItem(200) # Phased Plasma L + super().__init__(None, title="Test Attribute Window | {} - {}".format(item.ID, item.name), size=(1000, 500)) if 'wxMSW' in wx.PlatformInfo: @@ -368,6 +370,7 @@ if __name__ == "__main__": main_sizer.Add(panel, 1, wx.EXPAND | wx.ALL, 2) self.SetSizer(main_sizer) + self.Layout() app = wx.App(redirect=False) # Error messages go to popup window top = Frame() From 52a68adb11d52de859914f29ccb325fd132233f9 Mon Sep 17 00:00:00 2001 From: DarkPhoenix Date: Mon, 18 Mar 2019 14:33:17 +0300 Subject: [PATCH 4/4] Put character editor window into scope of main window This fixes various annoying things happening under linux: two separate applications shown when character editor open and various window focus bugs when opening stats of skills in character editor --- gui/characterEditor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gui/characterEditor.py b/gui/characterEditor.py index 2bcda4598..643b5963e 100644 --- a/gui/characterEditor.py +++ b/gui/characterEditor.py @@ -150,7 +150,7 @@ class CharacterEntityEditor(EntityEditor): class CharacterEditor(wx.Frame): def __init__(self, parent): wx.Frame.__init__(self, parent, id=wx.ID_ANY, title="pyfa: Character Editor", pos=wx.DefaultPosition, - size=wx.Size(640, 600), style=wx.DEFAULT_FRAME_STYLE ^ wx.RESIZE_BORDER) + size=wx.Size(640, 600), style=wx.DEFAULT_FRAME_STYLE ^ wx.RESIZE_BORDER | wx.FRAME_FLOAT_ON_PARENT) i = wx.Icon(BitmapLoader.getBitmap("character_small", "gui")) self.SetIcon(i)