Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display column min width #184

Open
blitzmann opened this issue Oct 10, 2014 · 3 comments
Open

Display column min width #184

blitzmann opened this issue Oct 10, 2014 · 3 comments
Labels
bug Confirmed to be a bug gui Issue is related specifically to the GUI code (wxPython)

Comments

@blitzmann
Copy link
Collaborator

This has always bugged me. The minimum width on a lot of the display columns are much larger than they need to be, which restricts how much information that is visible. Seems to affect all display columns except the fitting windows icons, state, and charge columns (so, maybe all columns that are resizable?).

@blitzmann
Copy link
Collaborator Author

Quick test on this. The min width is determined by this line in display.py: self.columnsMinWidth.append(self.GetColumnWidth(i))

For the Drone pane display in linux (with empty contents), the values are:

attr: 40
Misc: 40
Price: 40
Base Name: 57
State: 20
Max Range: 40

whereas for windows, these are the values:

attr: 53 +13
Misc: 53 +13
Price: 53 +13
Base Name: 80 +23
State: 20
Max Range: 53 +13

If all columns had the same additional width, we could just subtract it from the windows platform (eg: self.GetColumnWidth(i)-13), but we have some variance. State (empty header) doesn't change, icon headers ate +13, and text headers are +23. Not sure if this is true throughout the program, but it's somewhere to start.

I also do not know if these min values change depending on display contents (doubtful as a quick look shows self.columnsMinWidth is only modified on init). Need to look online and find similar complaints on the windows platform when it comes to column width bugs and note any workarounds

@DarkFenX DarkFenX added bug Confirmed to be a bug gui Issue is related specifically to the GUI code (wxPython) labels Oct 3, 2019
@DarkFenX
Copy link
Member

DarkFenX commented Oct 3, 2019

https://wxpython.org/Phoenix/docs/html/wx.ListCtrl.html#wx.ListCtrl.SetColumnWidth

width can be a width in pixels or LIST_AUTOSIZE (-1) or LIST_AUTOSIZE_USEHEADER (-2).

    LIST_AUTOSIZE will resize the column to the length of its longest item.

    LIST_AUTOSIZE_USEHEADER will resize the column to the length of the header (Win32) or 80 pixels (other platforms).

In small or normal icon view, col must be -1, and the column width is set for all columns.

@DarkFenX
Copy link
Member

DarkFenX commented Oct 3, 2019

In linux min column width doesn't work at all for some reason. self.columnsMinWidth is filled with proper width (same way as on Windows, that is). When use releases mouse during column resize, resizeChecker() is called, which calls checkColumnSize() via CallAfter. This function, if set column width is less than minimal, sets minimal width, which can be checked by calling self.GetColumnWidth(column) which returns minimal width. But for some reason on next refresh, self.GetColumnWidth(column) returns the width which was set by the user, not minimal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Confirmed to be a bug gui Issue is related specifically to the GUI code (wxPython)
Projects
None yet
Development

No branches or pull requests

2 participants