diff options
author | Maxim Monastirsky <momonasmon@gmail.com> | 2017-05-10 02:03:37 +0300 |
---|---|---|
committer | Maxim Monastirsky <momonasmon@gmail.com> | 2017-05-14 11:08:35 +0200 |
commit | b91fb08fd63207e663dca83abe1305d8025b4b48 (patch) | |
tree | 984c37ea3e13283462f6e9cf2674d492f449a5df /framework/Library_fwk.mk | |
parent | c606bacc58c517c234a03d1c9b25547cc5766f6d (diff) |
tdf#106999 Feedback for style commands
The .uno:StyleApply command takes some arguments, which make
it possible to apply any style of any type. The problem is
that it doesn't provide toggle state to be used when placing
such commands on a toolbar or a menubar. The reason is that
sfx2, by design, can provide status updates only for the
.uno:StyleApply command as a whole, ignoring any arguments
that might be specified in the UI element description. This
behavior is even documented in the XDispatch idl.
wrt solution, changing the generic UI code to handle the
specifics of an individual command can never be a good idea.
The usual approach in such cases is to create separate
commands which will handle the status updates correctly. This
is however not possible in our case because styles can be
created by users, and we can't predict their names and create
separate commands for all of them (given that now it's easy to
add style commands to toolbars and menus - see tdf#106681).
One possible solution is to create a toolbar button controller
on top of .uno:StyleApply, which will be able to translate its
status update to a state compatible with the toolbar. The downside
is that it won't work when placing such command inside a menu, and
in general the menu code in framework doesn't provide any way to
control individual menu items, only a whole sub-menus via a
popup menu controller.
To fix the menu use-case too, this commit introduces a "proxy"
dispatch implementation, which can be used by MenuBarManager
in a transparent way, as if it was the "real" application-level
dispatcher. This means that the changes needed in MenuBarManager
are minimal and do not over-complicate the code, which is a good
thing (Alternatively, such dispatcher could be registered via
the dispatch interception mechanism, but it will add no gain,
given the current requirements, and just add more complexity).
And to make it easier to reuse the code, the new dispatcher
is also used for the toolbar solution.
Change-Id: Ia73b0fa70fd4d1d59360b255aa8fd19570b971ee
Reviewed-on: https://gerrit.libreoffice.org/37590
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com>
Diffstat (limited to 'framework/Library_fwk.mk')
-rw-r--r-- | framework/Library_fwk.mk | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/framework/Library_fwk.mk b/framework/Library_fwk.mk index e20b8b22cc17..9057aaa6048a 100644 --- a/framework/Library_fwk.mk +++ b/framework/Library_fwk.mk @@ -153,6 +153,7 @@ $(eval $(call gb_Library_add_exception_objects,fwk,\ framework/source/uielement/statusbarmerger \ framework/source/uielement/statusbarwrapper \ framework/source/uielement/statusindicatorinterfacewrapper \ + framework/source/uielement/styletoolbarcontroller \ framework/source/uielement/subtoolbarcontroller \ framework/source/uielement/thesaurusmenucontroller \ framework/source/uielement/togglebuttontoolbarcontroller \ |