pyfa-org / Pyfa

Python fitting assistant, cross-platform fitting tool for EVE Online
GNU General Public License v3.0
1.61k stars 409 forks source link

Upgrade to wxPython 3.0 #92

Closed blitzmann closed 9 years ago

blitzmann commented 10 years ago

Started a branch on my repo that includes current fixes, including fixes to grid layouts and tab rendering. branch can be found here: https://github.com/blitzmann/Pyfa/tree/wx3.0

The only current bug to my knowledge is one with fonts for custom widgets present on Win7, not sure about other platforms atm. Need to look into this.

This would also require new skeletons.

Pyfa now has branch for wx3.0 upgrade: wx3. Current known issues:

4/17/2015: [ ] ProgressDialogs don't seem to disappear when they are completed

DarkFenX commented 10 years ago

As i said, i can build windows skeleton easily.

By the way, we probably should care a bit about backward compatibility - i think most linux distributions do not have 3.0 yet. Debian, for example, has just 2.8.

blitzmann commented 10 years ago

I completely agree about keeping backwards compatibility. I'm having difficulties finding a 3.0 package on my own distro as well, so I'll have to build it from source.

blitzmann commented 10 years ago

Font issue seems to be caused by wx.FontFromPixelSize(). I was able to get it to look mostly like current Pyfa buy lowering the given values (14 -> 11). However, as expected, if switched back to 2.8, the font gets much smaller. I hope I can find a better way to handle it between the two versions - if not, we could store separate values depending on version.

I am still not sure if this is a problem across platforms, as I had issues with my Linux build of 3.0.

EDIT: possible related reading material? http://wxpython-users.1045709.n5.nabble.com/Setting-size-for-wx-FontFromPixelSize-td2350417.html https://groups.google.com/forum/#!topic/wxpython-users/DmhOM3s_TCQ

DarkFenX commented 10 years ago

Having font size specified depending on platform and wx version is acceptable imo (just do it from single place rather than specifying it in the code where it's used).

The docs indicate that it makes a direct call on MSW, and emulates it on the other platforms.

This might indeed be the clue. There're also guys mentioning size might differ from font to font, so yet another thing to consider.

blitzmann commented 10 years ago

This is interesting. I added the following block to mainFrame init:

self.font = self.GetFont()
print self.font.GetPixelSize()

On 3.0 it returns (0, 12), and on 2.8 it returns (0, -11)

Testing on the font that is set for pygauge (self.font = wx.FontFromPixelSize((0,14),wx.SWISS, wx.NORMAL, wx.NORMAL, False)), it returns (0, 14), on both versions.

Not sure if this is relevant, just something I noticed.

blitzmann commented 10 years ago

Was able to build 3.0 on my Ubuntu VM. No change in font size. Answer on StackOverflow thinks it was a change on font size calculations from 2.8 -> 2.9, and recommends changing the size based on wxversion.

I did notice, however, that on my Linux VM ChromeTabs are not rendered correctly (however you can still click where the render should be and it works). This issue was noted on Win7 and fixed with this commit: https://github.com/blitzmann/Pyfa/commit/8a77ea7d19554733ba8e43ce9bcad92c5e225648 I also get a few errors dealing with assertions ant the like that I never got on Win7. Need to revisit this.

EDIT: Fixed font issues on Windows: https://github.com/blitzmann/Pyfa/commit/a57b85cb1c3ed30f7da7035f5366025d0101f6a9

Character selection is a bit bigger than 2.8, and stats pane is still a tad bit off (I am assuming because StatsView explicitly sets font point to 8), still looking into that.

blitzmann commented 9 years ago

A new branch on the pyfa repo has been created to house commits for supporting wx3.0

@Sectoid has made a few commits that help with linux bugs, many thanks. I will also edit OP with a todo list of any current issues with the branch and which OSs they affect

blitzmann commented 9 years ago

New bug with the wx3 branch found, OP updated

blitzmann commented 9 years ago

closing this as we have a tag for it