-
-
Notifications
You must be signed in to change notification settings - Fork 307
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
wxGUI: Fix behaviour of top Single-Window GUI toolbars #2568
wxGUI: Fix behaviour of top Single-Window GUI toolbars #2568
Conversation
gui/wxpython/gui_core/toolbars.py
Outdated
try: | ||
from agw import aui | ||
except ImportError: | ||
import wx.lib.agw.aui as aui | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check current import style and update if needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I checked in wxPython Demo version 4.1.1. and it should be used like that
gui/wxpython/gui_core/toolbars.py
Outdated
"""Provides handling for aui.AuiToolBar widget""" | ||
|
||
def _defineTool(self, name=None, icon=None, handler=None, item=wx.ITEM_NORMAL): | ||
"""Define tool""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Explain why it needs to be different
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem is that AUI does not have InsertTool.. If I get it right, it is quite a new method in wx which is probably the reason. Look at https://www.geeksforgeeks.org/wxpython-inserttool-function-in-wx-toolbar/.
* fix import * CreateTool doesn't need to be duplicated * reduce the number of relay methods, rest is handled by getattr
Successfully tested on the MS Windows. wxPython 4.1.1 msw (phoenix) wxWidgets 3.1.5 and version 4.2.0 msw (phoenix) wxWidgets 3.2.1 |
Tested on Mac with: Most things works smoothly and as expected. Actually a very pleasant experience, good work!! But switching to and fro 3D mode causes a glitch: Secondly, initially the main buttons are not visible: ...resizing the panel frame causes a redraw, which fixes that: Finally, the Layer tool bar, starts displaced, and you also see a Map Display tab (it is also to be found where it should be in the middle pane): after a window resize (just enough to initialise a redraw) they come to the right place but the tool bar seems too high: |
Thanks! Any idea if these issues were there before this was merged? |
@petrasovaa Anna, thank you for your testing and looking into this PR more deeply. I did not manage to react earlier, I am sorry. |
Use agw.aui toolbar as the main toolbar to avoid strange behavior. This requires restructuring Toolbar classes. Co-authored-by: Anna Petrasova <kratochanna@gmail.com>
Use agw.aui toolbar as the main toolbar to avoid strange behavior. This requires restructuring Toolbar classes. Co-authored-by: Anna Petrasova <kratochanna@gmail.com>
Use agw.aui toolbar as the main toolbar to avoid strange behavior. This requires restructuring Toolbar classes. Co-authored-by: Anna Petrasova <kratochanna@gmail.com>
Use agw.aui toolbar as the main toolbar to avoid strange behavior. This requires restructuring Toolbar classes. Co-authored-by: Anna Petrasova <kratochanna@gmail.com>
Fixes the non-standard behavior of top Single-Window GUI toolbars.
Bug:
bigger icons when undocking and docking the toolbar (takes into consideration that one does not drop a toolbar during that process)
after redocking all toolbars were resized
no toolbar name displayed after undocking
After fix:
Now it inherits from AuiToolbar. This approach corresponds to the usage of aui agw library which is used for drawing the main window frame.
After conversion to AuiToolbar:
sizes of toolbars are still the same
toolbar name is displayed after undock
Potentially this PR could also fix some other related bugs (probably different depending on OS) caused by inheriting from the inappropriate wx.Toolbar class.