diff options
author | Maxim Monastirsky <momonasmon@gmail.com> | 2017-02-09 00:31:24 +0200 |
---|---|---|
committer | Maxim Monastirsky <momonasmon@gmail.com> | 2017-02-09 22:49:51 +0000 |
commit | 54d5b1828ec73d0475e0ddb6e31394a7e1904a1b (patch) | |
tree | 95ea5cb85d31f4cd9d79d0fedb600c5a556ba361 /sc/uiconfig | |
parent | 8dc38dd9b132805191e0d20d00fb7559121fda15 (diff) |
tdf#105672 framework managed menu button
This adds a menu button that can use a popup menu controller
to manage its menu. It supports 2 cases:
- Use any controller that is registered in Controller.xcu,
by specifing its .uno command.
- Manage an arbitrary popup menu with MenuBarManager
(assuming its items have proper .uno commands in their
MenuItemData::aCommandStr). It means that a menu that
was defined in a .ui file, can be used inside that .ui
file without any additional code.
This commit uses the new control to fix some currently
non-working buttons in Calc's Notebookbar (but there are
more that can be fixed the same way). It's not clear how
long we will continue to use buttons (instead of
toolboxes) for the Notebookbar, but hopefully this control
will be useful in other places too.
Change-Id: Ie00cde7cd7e39948948960ca2eff76e9db837109
Reviewed-on: https://gerrit.libreoffice.org/34103
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com>
Diffstat (limited to 'sc/uiconfig')
-rw-r--r-- | sc/uiconfig/scalc/ui/notebookbar.ui | 2 | ||||
-rw-r--r-- | sc/uiconfig/scalc/ui/notebookbar_groups.ui | 120 |
2 files changed, 20 insertions, 102 deletions
diff --git a/sc/uiconfig/scalc/ui/notebookbar.ui b/sc/uiconfig/scalc/ui/notebookbar.ui index 8772510c20aa..f922d4ba7a2a 100644 --- a/sc/uiconfig/scalc/ui/notebookbar.ui +++ b/sc/uiconfig/scalc/ui/notebookbar.ui @@ -1381,7 +1381,7 @@ <property name="can_focus">False</property> <property name="orientation">vertical</property> <child> - <object class="GtkButton" id="ConditionalFormatMenu"> + <object class="svtlo-ManagedMenuButton" id="ConditionalFormatMenu"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">True</property> diff --git a/sc/uiconfig/scalc/ui/notebookbar_groups.ui b/sc/uiconfig/scalc/ui/notebookbar_groups.ui index 5011d96a80c0..a23f08d47ad7 100644 --- a/sc/uiconfig/scalc/ui/notebookbar_groups.ui +++ b/sc/uiconfig/scalc/ui/notebookbar_groups.ui @@ -148,6 +148,7 @@ <object class="GtkMenuItem" id="stylemenudefault"> <property name="visible">True</property> <property name="can_focus">False</property> + <property name="action_name">.uno:StyleApply?Style:string=Default&FamilyName:string=CellStyles</property> <property name="label" translatable="yes">Default</property> <property name="use_underline">True</property> </object> @@ -162,6 +163,7 @@ <object class="GtkMenuItem" id="stylemenuacc1"> <property name="visible">True</property> <property name="can_focus">False</property> + <property name="action_name">.uno:StyleApply?Style:string=Accent%201&FamilyName:string=CellStyles</property> <property name="label" translatable="yes">Accent 1</property> <property name="use_underline">True</property> </object> @@ -170,6 +172,7 @@ <object class="GtkMenuItem" id="stylemenuacc2"> <property name="visible">True</property> <property name="can_focus">False</property> + <property name="action_name">.uno:StyleApply?Style:string=Accent%202&FamilyName:string=CellStyles</property> <property name="label" translatable="yes">Accent 2</property> <property name="use_underline">True</property> </object> @@ -178,6 +181,7 @@ <object class="GtkMenuItem" id="stylemenuacc3"> <property name="visible">True</property> <property name="can_focus">False</property> + <property name="action_name">.uno:StyleApply?Style:string=Accent%203&FamilyName:string=CellStyles</property> <property name="label" translatable="yes">Accent 3</property> <property name="use_underline">True</property> </object> @@ -192,6 +196,7 @@ <object class="GtkMenuItem" id="stylemenuhed1"> <property name="visible">True</property> <property name="can_focus">False</property> + <property name="action_name">.uno:StyleApply?Style:string=Heading%201&FamilyName:string=CellStyles</property> <property name="label" translatable="yes">Heading 1</property> <property name="use_underline">True</property> </object> @@ -200,6 +205,7 @@ <object class="GtkMenuItem" id="stylemenuhed2"> <property name="visible">True</property> <property name="can_focus">False</property> + <property name="action_name">.uno:StyleApply?Style:string=Heading%202&FamilyName:string=CellStyles</property> <property name="label" translatable="yes">Heading 2</property> <property name="use_underline">True</property> </object> @@ -214,6 +220,7 @@ <object class="GtkMenuItem" id="stylemenustatg"> <property name="visible">True</property> <property name="can_focus">False</property> + <property name="action_name">.uno:StyleApply?Style:string=Good&FamilyName:string=CellStyles</property> <property name="label" translatable="yes">Good</property> <property name="use_underline">True</property> </object> @@ -222,6 +229,7 @@ <object class="GtkMenuItem" id="stylemenustatn"> <property name="visible">True</property> <property name="can_focus">False</property> + <property name="action_name">.uno:StyleApply?Style:string=Neutral&FamilyName:string=CellStyles</property> <property name="label" translatable="yes">Neutral</property> <property name="use_underline">True</property> </object> @@ -230,6 +238,7 @@ <object class="GtkMenuItem" id="stylemenustatb"> <property name="visible">True</property> <property name="can_focus">False</property> + <property name="action_name">.uno:StyleApply?Style:string=Bad&FamilyName:string=CellStyles</property> <property name="label" translatable="yes">Bad</property> <property name="use_underline">True</property> </object> @@ -238,6 +247,7 @@ <object class="GtkMenuItem" id="stylemenustatw"> <property name="visible">True</property> <property name="can_focus">False</property> + <property name="action_name">.uno:StyleApply?Style:string=Warning&FamilyName:string=CellStyles</property> <property name="label" translatable="yes">Warning</property> <property name="use_underline">True</property> </object> @@ -246,6 +256,7 @@ <object class="GtkMenuItem" id="stylemenustate"> <property name="visible">True</property> <property name="can_focus">False</property> + <property name="action_name">.uno:StyleApply?Style:string=Error&FamilyName:string=CellStyles</property> <property name="label" translatable="yes">Error</property> <property name="use_underline">True</property> </object> @@ -260,6 +271,7 @@ <object class="GtkMenuItem" id="stylemenutxtn"> <property name="visible">True</property> <property name="can_focus">False</property> + <property name="action_name">.uno:StyleApply?Style:string=Note&FamilyName:string=CellStyles</property> <property name="label" translatable="yes">Note</property> <property name="use_underline">True</property> </object> @@ -268,16 +280,12 @@ <object class="GtkMenuItem" id="stylemenutxtf"> <property name="visible">True</property> <property name="can_focus">False</property> + <property name="action_name">.uno:StyleApply?Style:string=Footnote&FamilyName:string=CellStyles</property> <property name="label" translatable="yes">Footnote</property> <property name="use_underline">True</property> </object> </child> </object> - <object class="GtkImage" id="tablecolumnsi"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="pixbuf">cmd/lc_entirecolumn.png</property> - </object> <object class="GtkMenu" id="tablemenu"> <property name="visible">True</property> <property name="can_focus">False</property> @@ -330,94 +338,6 @@ </object> </child> </object> - <object class="GtkImage" id="tablerowsi"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="pixbuf">cmd/lc_entirerow.png</property> - </object> - <object class="GtkMenu" id="tcolumnmenu"> - <property name="visible">True</property> - <property name="can_focus">False</property> - </object> - <object class="GtkMenu" id="trowmenu"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <child> - <object class="GtkMenuItem" id="rowmenuaddup"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="action_name">.uno:InsertRowsBefore</property> - <property name="label" translatable="yes">Insert Rows Above</property> - <property name="use_underline">True</property> - </object> - </child> - <child> - <object class="GtkMenuItem" id="rowmenuadddown"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="action_name">.uno:InsertRowsAfter</property> - <property name="label" translatable="yes">Insert Rows Below</property> - <property name="use_underline">True</property> - </object> - </child> - <child> - <object class="GtkSeparatorMenuItem" id="rowmenusep1"> - <property name="visible">True</property> - <property name="can_focus">False</property> - </object> - </child> - <child> - <object class="GtkMenuItem" id="rowmenudel"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="action_name">.uno:DeleteRows</property> - <property name="label" translatable="yes">Delete Rows</property> - <property name="use_underline">True</property> - </object> - </child> - <child> - <object class="GtkMenuItem" id="rowmenuselect"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="action_name">.uno:EntireRow</property> - <property name="label" translatable="yes">Select Rows</property> - <property name="use_underline">True</property> - </object> - </child> - <child> - <object class="GtkSeparatorMenuItem" id="rowmenusep2"> - <property name="visible">True</property> - <property name="can_focus">False</property> - </object> - </child> - <child> - <object class="GtkMenuItem" id="rowmenuheight"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="action_name">.uno:SetRowHeight</property> - <property name="label" translatable="yes">Row Height...</property> - <property name="use_underline">True</property> - </object> - </child> - <child> - <object class="GtkMenuItem" id="rowmenuoptimalrow"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="action_name">.uno:SetOptimalRowHeight</property> - <property name="label" translatable="yes">Optimal Row Height</property> - <property name="use_underline">True</property> - </object> - </child> - <child> - <object class="GtkMenuItem" id="rowmenudistribute"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="action_name">.uno:DistributeRows</property> - <property name="label" translatable="yes">Distribute Rows Evenly</property> - <property name="use_underline">True</property> - </object> - </child> - </object> <object class="GtkImage" id="undoi"> <property name="visible">True</property> <property name="can_focus">False</property> @@ -805,7 +725,7 @@ <property name="can_focus">False</property> <property name="spacing">3</property> <child> - <object class="GtkButton" id="paragraphstyleb:stylemenu"> + <object class="svtlo-ManagedMenuButton" id="paragraphstyleb:stylemenu"> <property name="label" translatable="yes">Style</property> <property name="width_request">70</property> <property name="visible">True</property> @@ -1406,14 +1326,13 @@ <property name="can_focus">False</property> <property name="orientation">vertical</property> <child> - <object class="GtkButton" id="tablerowsb:trowmenu"> - <property name="label" translatable="yes">Row</property> + <object class="svtlo-ManagedMenuButton" id="tablerowsb"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">True</property> <property name="valign">center</property> <property name="vexpand">True</property> - <property name="image">tablerowsi</property> + <property name="action_name">.uno:RowOperations</property> <property name="relief">none</property> <property name="xalign">0</property> </object> @@ -1424,14 +1343,13 @@ </packing> </child> <child> - <object class="GtkButton" id="tablecolumnsb:tcolumnmenu"> - <property name="label" translatable="yes">Column</property> + <object class="svtlo-ManagedMenuButton" id="tablecolumnsb"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">True</property> <property name="valign">center</property> <property name="vexpand">True</property> - <property name="image">tablecolumnsi</property> + <property name="action_name">.uno:ColumnOperations</property> <property name="relief">none</property> <property name="xalign">0</property> </object> @@ -1535,7 +1453,7 @@ </packing> </child> <child> - <object class="GtkButton" id="conditionalb"> + <object class="svtlo-ManagedMenuButton" id="conditionalb"> <property name="label" translatable="yes">Conditional</property> <property name="height_request">24</property> <property name="visible">True</property> |