If it's a dock -> Dock Settings...
If it's a panel -> Panel Settings...
Details
Diff Detail
- Repository
- R878 Latte Dock
- Lint
Lint Skipped - Unit
Unit Tests Skipped
app/view/view.cpp | ||
---|---|---|
333 | I've found a bug here: when inEditMode, m_behaveAsPlasmaPanel is always "false". |
Personally I dont like the approach, this wont work in some cases e.g. when right clicking plasma taskmanager.
This actions are located at : https://phabricator.kde.org/source/latte-dock/browse/master/containmentactions/contextmenu/menu.cpp
I would try first in there to check if it is possible to track a parent e.g. of Latte::View
app/view/view.cpp | ||
---|---|---|
333 | behaveAsPlasmaPanel as a variable defines only the behavior of the view and not the type. Currently the Latte::View does not have a type in order to be used by other elements. How this could be done is the following:
I can do [1-3] if you want in order to build after. In edit mode the behaveIsPlasmaPanel is false because it editMode the view must not function as a plasma panel in order to support the animations correctly, set its sizes properly, set its masks correctly etc. |
ok, just checked the previous mentioned class has access to containment() that means that through its configuration the menu could be informed for the type, so directly access to Latte::View is not needed...
but when right clicking on plasma taskmanager, there is not any Latte's action. This patch only changes the text of the action when it's available.
Is it another bug?
This patch should not touch Latte::View at all. All the code must be in the containmentactions/contextmenu.cpp class
Whenever there is a valid viewType in the layout file.
There is a case that viewType doesn't exist, for this case, you have to reload the view to have it created. (or close the Setting window)
Do you have a better way to detect when viewType changes?
containmentactions/contextmenu/menu.cpp | ||
---|---|---|
92 ↗ | (On Diff #51481) |
|
Do you have a better way to detect when viewType changes?
I don't think it is needed, you can try to update the action text just a little before the menu is shown
Qmenu has an aboutToShow signal and containment has as a contextuakActionsAboutToShow signal
I would try these two first
You meant to run setConfigureActionText() whenever the menu/action is about to show?
It will have to read the config whenever you right click. If there isn't any issue with reading the config again and again, e.g. disk reading... then we could set the text inside the Menu::contextualActions()
containmentactions/contextmenu/menu.cpp | ||
---|---|---|
91 ↗ | (On Diff #51515) | is this still needed if we check the value each time we show up the context menu? |
containmentactions/contextmenu/menu.cpp | ||
---|---|---|
91 ↗ | (On Diff #51515) | Yes, it's needed. Because when you're opening the Setting window and you right click on the view, it will close the Setting window, not a nice behavior. So we should hide it when the Setting window is opening. |
containmentactions/contextmenu/menu.cpp | ||
---|---|---|
68 ↗ | (On Diff #51515) | when we add character & in the menus it means that a modifier+&Letter activates that option what is the shortcut that add widgets? |
78 ↗ | (On Diff #51515) | when we add character & in the menus it means that a modifier+&Letter activates that option what is the shortcut that shows dock settings? it has been chosen to be Meta+A so that change does not respond to something |
84 ↗ | (On Diff #51515) | when we add character & in the menus it means that a modifier+&Letter activates that option what is the shortcut that shows Latte layouts menu? none, this shouldnt be applied also |
91 ↗ | (On Diff #51515) | ok this a behavior change irrelevant with the patch but ok we can keep it |
containmentactions/contextmenu/menu.cpp | ||
---|---|---|
132 ↗ | (On Diff #51515) | same thing for these & characters, do not respond to any shortcut so they should be removed |
containmentactions/contextmenu/menu.cpp | ||
---|---|---|
92 ↗ | (On Diff #51515) | in this slot is also needed: m_configureAction->setEnabled(true); there are cases that the Dock Settings is shown when !configuring but it is not enabled |
containmentactions/contextmenu/menu.cpp | ||
---|---|---|
68 ↗ | (On Diff #51515) | For example, "&Add widgets..."
|
containmentactions/contextmenu/menu.cpp | ||
---|---|---|
92 ↗ | (On Diff #51515) | I don't understand. my code only change the visible property, why does it have to handle the "enable" one? You meant the setting is showing but configuring==false? Sound weird. How to make it happen? |
@trmdi please do me a favour:
- close this review and open a clean new one because for some reason when trying to test it in my system includes also one old commit that I added the ViewType option
- no problem with & characters you can add them
- no problem to hide the Dock/Panel View when (configuring)
- please dont use the config file to access the viewType, I found an alternative way that it is in the master, we sniff now the viewType through dbus contextMenuData. The menu sends the containment->id() and when contextMenuData are requested these data include also the view type.
- For the setVisible(true) and how this bug occurs we will discuss it again at the new review