-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Create user defined ToolBar and Menu #64357
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
base: master
Are you sure you want to change the base?
Conversation
🪟 Windows Qt6 buildsDownload Windows Qt6 builds of this PR for testing. 🍎 MacOS Qt6 buildsDownload MacOS Qt6 builds of this PR for testing. |
|
I don't particularly love the two toolbar approach used here. @nirvn have you any thoughts? |
The plus and trash icons could also be replaced by actions in the context menu. It would also help with usability if focus was automatically switched to the newly created toolbar/menu entry. Is the second search box intentionally disabled? I can imagine it being useful when looking for items to add. |
|
Looking forward to this feature, it's something I've often heard requests for! I think that from an end-user perspective the UX would be a lot more approachable if the object names ( Also, while having D&D is really nice that's sadly a UX that's "invisible" and thus something users might overlook (I just recently had to explain the drag and drop form designer to a user, which even has "drag and drop" in the name...). A common solution is having button(s) between the two lists, like in |
Right, I'm gonna migrate the other buttons in the first one
Why not having both ? I like buttons because it explicitly indicate to the user how he can add/remove a user menu/action. And the button is greyed out if it's not possible to add/remove which is also a valuable information for the user.
👍 will do
It's an issue, I will fix it |
I thought about removing this column and display only label text (and display name when there is no label text), but I didn't want to change too much the actual display. @uclaros @nyalldawson any opinion on that?
Right. Will do it. |
Customization is now read from an XML file so we can later keep track of action order in menus and tool bars. This XML file is read on a tree model where every node is an Item. Item is then inherited by any customizable widget item. read() methods reads the XML file into the model. load() update the model with the different graphical element and apply() apply the model to the QGIS main window and the 2 browser widgets.
Instead of tracking down the modification, we just clone the model and restore on reset. On apply, the model is set in the application
Any owned function exists in sFunctions list so we have to remove it from the sFunctions list. If not, when deleting/recreating QgisApp (in tests for instance), cleanRegisteredFunctions() is called and let with dangling expression functions pointer.
@02JanDal After a second thoughts I don't think button would play nicely here. User would have to:
It seems a little bit convoluted to me. We can maybe print a message in the status bar when user choose to open the action panel to indicate that user can drag'n drop the actions in menu/toolbar. |
Hm, that's indeed true, having multiple "targets" does make that pattern maybe even more confusing... Maybe just a simple label with some basic instructions could work? |
To avoid the double toolbar that Nyall mentioned above. I'm not against the buttons, it's just that their location is weird. Maybe if the three new buttons were moved to the master toolbar it would be better.
Since there are both entries without a name and entries without a label, we probably should keep both! Maybe the label could be placed first as it makes more sense to most users. |
8add6c8 to
45e611b
Compare
Done
for now, I just added tooltips on action panel visibility button and on action tree view. I'm not sure about adding an extra label somewhere, I'm afraid it look a bit odd/clumsy.
I failed to find entries without name (and that could be overcome easily by just settings a name) while there are some entries without label. IMHO it would be weird to have a first column empty. Any other UI comment have been taken care and I updated the screencast |
|
@uclaros Thank you for pointing this out. Action with no name cannot be referenced in user defined menu or toolbar. I'm planning to add a CI test that check that any application action has an objectName to solve the issue. What do you think? |

This implements #QEP343 and embeds preliminary work #64325
It allows user to create user defined menu and toolbar.
Funded by Stadt Frankfurt am Main