v3.4.3.0 selecting dark theme breaks window resizing
After you select the dark theme you no longer can resize your edmc window.
Love the program, keep up the good work!
Confirmed on Windows 10 with 3.4.4.0. Will investigate at some point.
For now you can always change temporarily back to the 'Default' theme to resize width (it doesn't seem to allow height), then back to 'Dark' theme.
I attempted to track down what's going on with this, but the code is very dense and I'm not yet familiar enough with tk (the UI library EDMC uses) to be sure of what's happening.
However, I think this might be due to how the dark theme replaces the normal window title bar so as to have it actually be dark. When I have time I'll investigate further to see if removing those bits magically brings the resize handles back.
No ETA on this, as there's the workaround I described above, so more important issues to address.
I confirm this issue as well (Win 10, with 3.4.6.0-pre-4d5fa59).
Before I forget:
- [ ] See if we can make the EDMarketConnector.exe window minimise if it was visible and the Windows rask bar icon for it is clicked. The opposite does still work (minimised, click task bar icon, window is restored).
- [ ] Review any other common 'default Windows window' behaviour to be sure it's matched.
Nasty workaround I found while tinkering with a plugin. I added a ttk.Sizegrip as the last row in my plugin's frame which added a grip which resized the plugin frame and hence the window. I assume it'd work if put in the top window as well.
It's only over 2.5 years later, but I think I might have cracked this now I finally took a look at the necessary code changes.
@iancclark - thanks for the hint about ttk.Sizegrid, even if it did also mean I had to shoe-horn a ttk.Style setup into the current code.
In testing the PR I am running into some issues, but it turns out at least one of them has nothing to do with the changes.
- If you're in the default theme and resize the window, and then restart EDMarketConnector, it will have forgotten your resizing. I could try to make it remember, but it might then cause bigger issues if you've enabled-disabled a plugin across that restart. Especially in any non-default theme where you need the size to be correct for the resize handle to be visible to then fix things.
- Whilst the resizing appears to always work on Windows, it's being finicky on my Linux setup (Debian bullseye/stable). Going either way between Default and Dark theme can result in the status line either not being there, or the window being sized too small to show it. Either way you're then stuck (aside from Window Manager methods, which were always there) for resizing it without a restart.
I'm actually curious now as to why users want to manually resize the window. Other than Very Long Status Messages (which is a whole different thing I might address at some point), the UI should always be exactly the height and width it needs to be for all the UI that's been stuffed into it, including plugins. Any comment @BobMoret ?
Also, one thing to note.
The current EDMC UI is all tk widgets, not ttk. It doesn't seem like tk has a Sizegrip available. Thus we're now mixing the two widget types, and I've had to implement a ttk.Style just to get the foreground and background colours correct on the resizing handle. I then realised I really ought to try and implement all of the tk styling on that, but (t)tk documentation is still awful and tracking down all the necessary bits is a pain.
Options:
- Leave the
ttk.Stylehandling as I have it now, as it works for just this Sizegrip in both Dark and Windows Transparent themes. - Continue slogging through the current
theme.pycode to find all the hacks it applies to tk styling in order to ensure those are correctly set up inttk_stylewhen the theme is changed (includes at initial load). - Look into actually converting all the main UI over to
ttk... which might have impact on plugins.
Huh, and now I read up on tk versus ttk some more... it seems like switching to ttk would largely, if not entirely, remove the need for myNotebook.py, because one of the widget types only in ttk is a Notebook (tabbed window).
Ref: https://stackoverflow.com/a/38669157 (and other comments in that thread).
So:
- the only way to add this resize appears to be
ttk.SizeGrip(). - With nothing else other than adding that the SizeGrip won't follow theme colouring.
- It being
ttkthe only way to colour it is to tweak the Style. - Tweaking that Style appears to have side effects.
Which means, really, this whole thing needs to wait for, and be dependent on, a complete review and possible rewrite of all the styling and theming from first principles.
Given that the impact of this has ballooned due to the style/theme issues, I've closed the related PR for now, and this will have to wait for a complete review, and probably rewrite, of how we do styling.