Kaydet (Commit) b59c5ace authored tarafından Samuel Mehrbrodt's avatar Samuel Mehrbrodt

Related fdo#81475 Improve toolbar tooltips in Writer standard toolbar

and show the shortcut in the tooltip also when there is a custom tooltip

Change-Id: Ia3f5d17df3769479f7aacf63a83507ccb8593103
Reviewed-on: https://gerrit.libreoffice.org/11303Reviewed-by: 's avatarSamuel Mehrbrodt <s.mehrbrodt@gmail.com>
Tested-by: 's avatarSamuel Mehrbrodt <s.mehrbrodt@gmail.com>
üst e5f52edd
...@@ -1276,23 +1276,18 @@ void ToolBarManager::FillToolbar( const Reference< XIndexAccess >& rItemContaine ...@@ -1276,23 +1276,18 @@ void ToolBarManager::FillToolbar( const Reference< XIndexAccess >& rItemContaine
} }
m_pToolBar->InsertItem( nId, aString, nItemBits ); m_pToolBar->InsertItem( nId, aString, nItemBits );
m_pToolBar->SetItemCommand( nId, aCommandURL ); m_pToolBar->SetItemCommand( nId, aCommandURL );
OUString sQuickHelp( aString );
// Use custom tooltip if available
if ( !aTooltip.isEmpty() ) if ( !aTooltip.isEmpty() )
sQuickHelp = aTooltip;
OUString sShortCut;
if( RetrieveShortcut( aCommandURL, sShortCut ) )
{ {
m_pToolBar->SetQuickHelpText( nId, aTooltip ); sQuickHelp += " (";
} sQuickHelp += sShortCut;
else sQuickHelp += ")";
{
OUString sQuickHelp( aString );
OUString sShortCut;
if( RetrieveShortcut( aCommandURL, sShortCut ) )
{
sQuickHelp += " (";
sQuickHelp += sShortCut;
sQuickHelp += ")";
}
m_pToolBar->SetQuickHelpText( nId, sQuickHelp );
} }
m_pToolBar->SetQuickHelpText( nId, sQuickHelp );
if ( !aLabel.isEmpty() ) if ( !aLabel.isEmpty() )
{ {
......
...@@ -1264,7 +1264,7 @@ ...@@ -1264,7 +1264,7 @@
</node> </node>
<node oor:name=".uno:UndoAction" oor:op="replace"> <node oor:name=".uno:UndoAction" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string"> <prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">Undo</value> <value xml:lang="en-US">Undo Last Action</value>
</prop> </prop>
</node> </node>
<node oor:name=".uno:ToggleControlFocus" oor:op="replace"> <node oor:name=".uno:ToggleControlFocus" oor:op="replace">
...@@ -2019,7 +2019,7 @@ ...@@ -2019,7 +2019,7 @@
</node> </node>
<node oor:name=".uno:PrintDefault" oor:op="replace"> <node oor:name=".uno:PrintDefault" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string"> <prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">Print File Directly</value> <value xml:lang="en-US">Print Document Directly</value>
</prop> </prop>
<prop oor:name="Properties" oor:type="xs:int"> <prop oor:name="Properties" oor:type="xs:int">
<value>1</value> <value>1</value>
...@@ -2246,7 +2246,7 @@ ...@@ -2246,7 +2246,7 @@
</node> </node>
<node oor:name=".uno:InsertDoc" oor:op="replace"> <node oor:name=".uno:InsertDoc" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string"> <prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">~File...</value> <value xml:lang="en-US">~Document...</value>
</prop> </prop>
<prop oor:name="Properties" oor:type="xs:int"> <prop oor:name="Properties" oor:type="xs:int">
<value>1</value> <value>1</value>
...@@ -3077,7 +3077,7 @@ ...@@ -3077,7 +3077,7 @@
</node> </node>
<node oor:name=".uno:SpellingDialog" oor:op="replace"> <node oor:name=".uno:SpellingDialog" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string"> <prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">~Spelling...</value> <value xml:lang="en-US">Check ~Spelling and Grammar...</value>
</prop> </prop>
</node> </node>
<node oor:name=".uno:RecheckDocument" oor:op="replace"> <node oor:name=".uno:RecheckDocument" oor:op="replace">
...@@ -3087,7 +3087,7 @@ ...@@ -3087,7 +3087,7 @@
</node> </node>
<node oor:name=".uno:SpellingAndGrammarDialog" oor:op="replace"> <node oor:name=".uno:SpellingAndGrammarDialog" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string"> <prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">~Spelling and Grammar...</value> <value xml:lang="en-US">Check ~Spelling and Grammar...</value>
</prop> </prop>
<prop oor:name="Properties" oor:type="xs:int"> <prop oor:name="Properties" oor:type="xs:int">
<value>1</value> <value>1</value>
...@@ -3103,7 +3103,7 @@ ...@@ -3103,7 +3103,7 @@
</node> </node>
<node oor:name=".uno:SpellDialog" oor:op="replace"> <node oor:name=".uno:SpellDialog" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string"> <prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">~Spelling...</value> <value xml:lang="en-US">Check ~Spelling and Grammar...</value>
</prop> </prop>
<prop oor:name="Properties" oor:type="xs:int"> <prop oor:name="Properties" oor:type="xs:int">
<value>1</value> <value>1</value>
...@@ -3366,7 +3366,7 @@ ...@@ -3366,7 +3366,7 @@
</node> </node>
<node oor:name=".uno:Redo" oor:op="replace"> <node oor:name=".uno:Redo" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string"> <prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">Redo</value> <value xml:lang="en-US">Redo Last Action</value>
</prop> </prop>
<prop oor:name="Properties" oor:type="xs:int"> <prop oor:name="Properties" oor:type="xs:int">
<value>1</value> <value>1</value>
...@@ -3382,7 +3382,7 @@ ...@@ -3382,7 +3382,7 @@
</node> </node>
<node oor:name=".uno:FormatPaintbrush" oor:op="replace"> <node oor:name=".uno:FormatPaintbrush" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string"> <prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">Format Paintbrush (double click for multi-selection)</value> <value xml:lang="en-US">Clone Formatting (double click for multi-selection)</value>
</prop> </prop>
<prop oor:name="Properties" oor:type="xs:int"> <prop oor:name="Properties" oor:type="xs:int">
<value>9</value> <value>9</value>
...@@ -3403,7 +3403,7 @@ ...@@ -3403,7 +3403,7 @@
</node> </node>
<node oor:name=".uno:Cut" oor:op="replace"> <node oor:name=".uno:Cut" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string"> <prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">Cu~t</value> <value xml:lang="en-US">Cu~t Selection</value>
</prop> </prop>
<prop oor:name="Properties" oor:type="xs:int"> <prop oor:name="Properties" oor:type="xs:int">
<value>1</value> <value>1</value>
...@@ -3411,7 +3411,7 @@ ...@@ -3411,7 +3411,7 @@
</node> </node>
<node oor:name=".uno:Copy" oor:op="replace"> <node oor:name=".uno:Copy" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string"> <prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">~Copy</value> <value xml:lang="en-US">~Copy Selection</value>
</prop> </prop>
<prop oor:name="Properties" oor:type="xs:int"> <prop oor:name="Properties" oor:type="xs:int">
<value>1</value> <value>1</value>
...@@ -3419,7 +3419,7 @@ ...@@ -3419,7 +3419,7 @@
</node> </node>
<node oor:name=".uno:Paste" oor:op="replace"> <node oor:name=".uno:Paste" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string"> <prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">~Paste</value> <value xml:lang="en-US">~Paste from Clipboard</value>
</prop> </prop>
<prop oor:name="Properties" oor:type="xs:int"> <prop oor:name="Properties" oor:type="xs:int">
<value>1</value> <value>1</value>
...@@ -5445,7 +5445,7 @@ ...@@ -5445,7 +5445,7 @@
</node> </node>
<node oor:name=".uno:SpellingMenu" oor:op="replace"> <node oor:name=".uno:SpellingMenu" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string"> <prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">~Spellcheck</value> <value xml:lang="en-US">Toggle Auto ~Spellcheck</value>
</prop> </prop>
</node> </node>
<node oor:name=".uno:LanguageMenu" oor:op="replace"> <node oor:name=".uno:LanguageMenu" oor:op="replace">
......
...@@ -88,7 +88,7 @@ ...@@ -88,7 +88,7 @@
</node> </node>
<node oor:name=".uno:InsertEndnote" oor:op="replace"> <node oor:name=".uno:InsertEndnote" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string"> <prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">Insert Endnote Directly</value> <value xml:lang="en-US">Insert Endnote</value>
</prop> </prop>
<prop oor:name="Properties" oor:type="xs:int"> <prop oor:name="Properties" oor:type="xs:int">
<value>1</value> <value>1</value>
...@@ -492,7 +492,7 @@ ...@@ -492,7 +492,7 @@
</node> </node>
<node oor:name=".uno:InsertFieldCtrl" oor:op="replace"> <node oor:name=".uno:InsertFieldCtrl" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string"> <prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">Insert Fields</value> <value xml:lang="en-US">Insert Field</value>
</prop> </prop>
<prop oor:name="Properties" oor:type="xs:int"> <prop oor:name="Properties" oor:type="xs:int">
<value>9</value> <value>9</value>
...@@ -561,7 +561,7 @@ ...@@ -561,7 +561,7 @@
</node> </node>
<node oor:name=".uno:InsertFootnote" oor:op="replace"> <node oor:name=".uno:InsertFootnote" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string"> <prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">Insert Footnote Directly</value> <value xml:lang="en-US">Insert Footnote</value>
</prop> </prop>
<prop oor:name="Properties" oor:type="xs:int"> <prop oor:name="Properties" oor:type="xs:int">
<value>1</value> <value>1</value>
......
...@@ -19,10 +19,10 @@ ...@@ -19,10 +19,10 @@
--> -->
<toolbar:toolbar xmlns:toolbar="http://openoffice.org/2001/toolbar" xmlns:xlink="http://www.w3.org/1999/xlink"> <toolbar:toolbar xmlns:toolbar="http://openoffice.org/2001/toolbar" xmlns:xlink="http://www.w3.org/1999/xlink">
<toolbar:toolbaritem xlink:href=".uno:OpenUrl" toolbar:visible="false"/> <toolbar:toolbaritem xlink:href=".uno:OpenUrl" toolbar:visible="false"/>
<toolbar:toolbaritem xlink:href=".uno:AddDirect" toolbar:helpid="5537"/> <toolbar:toolbaritem xlink:href=".uno:AddDirect" toolbar:helpid="5537" toolbar:tooltip="Create New Document"/>
<toolbar:toolbaritem xlink:href=".uno:NewDoc" toolbar:visible="false" toolbar:helpid="5500"/> <toolbar:toolbaritem xlink:href=".uno:NewDoc" toolbar:visible="false" toolbar:helpid="5500"/>
<toolbar:toolbaritem xlink:href=".uno:OpenFromWriter" toolbar:style="dropdown"/> <toolbar:toolbaritem xlink:href=".uno:OpenFromWriter" toolbar:style="dropdown" toolbar:tooltip="Open Document"/>
<toolbar:toolbaritem xlink:href=".uno:Save" toolbar:helpid="5505"/> <toolbar:toolbaritem xlink:href=".uno:Save" toolbar:helpid="5505" toolbar:tooltip="Save Document"/>
<toolbar:toolbaritem xlink:href=".uno:SaveAs" toolbar:visible="false" toolbar:helpid="5502"/> <toolbar:toolbaritem xlink:href=".uno:SaveAs" toolbar:visible="false" toolbar:helpid="5502"/>
<toolbar:toolbaritem xlink:href=".uno:SendMail" toolbar:visible="false" toolbar:helpid="5331"/> <toolbar:toolbaritem xlink:href=".uno:SendMail" toolbar:visible="false" toolbar:helpid="5331"/>
<toolbar:toolbaritem xlink:href=".uno:ExportDirectToPDF" toolbar:helpid="6674"/> <toolbar:toolbaritem xlink:href=".uno:ExportDirectToPDF" toolbar:helpid="6674"/>
...@@ -46,14 +46,14 @@ ...@@ -46,14 +46,14 @@
<toolbar:toolbaritem xlink:href=".uno:SearchDialog"/> <toolbar:toolbaritem xlink:href=".uno:SearchDialog"/>
<toolbar:toolbaritem xlink:href=".uno:ControlCodes" toolbar:helpid="20224"/> <toolbar:toolbaritem xlink:href=".uno:ControlCodes" toolbar:helpid="20224"/>
<toolbar:toolbarseparator/> <toolbar:toolbarseparator/>
<toolbar:toolbaritem xlink:href=".uno:InsertTable" toolbar:helpid="20330"/> <toolbar:toolbaritem xlink:href=".uno:InsertTable" toolbar:helpid="20330" toolbar:tooltip="Insert Table"/>
<toolbar:toolbaritem xlink:href=".uno:InsertGraphic"/> <toolbar:toolbaritem xlink:href=".uno:InsertGraphic" toolbar:tooltip="Insert Image"/>
<toolbar:toolbaritem xlink:href=".uno:InsertObjectChart"/> <toolbar:toolbaritem xlink:href=".uno:InsertObjectChart" toolbar:tooltip="Insert Chart"/>
<toolbar:toolbaritem xlink:href=".uno:InsertFootnote"/> <toolbar:toolbaritem xlink:href=".uno:InsertFootnote"/>
<toolbar:toolbaritem xlink:href=".uno:HyperlinkDialog" toolbar:helpid="5678"/> <toolbar:toolbaritem xlink:href=".uno:HyperlinkDialog" toolbar:helpid="5678" toolbar:tooltip="Insert Hyperlink"/>
<toolbar:toolbaritem xlink:href=".uno:InsertSymbol"/> <toolbar:toolbaritem xlink:href=".uno:InsertSymbol" toolbar:tooltip="Insert Special Character"/>
<toolbar:toolbaritem xlink:href=".uno:InsertFieldCtrl"/> <toolbar:toolbaritem xlink:href=".uno:InsertFieldCtrl"/>
<toolbar:toolbaritem xlink:href=".uno:InsertAnnotation"/> <toolbar:toolbaritem xlink:href=".uno:InsertAnnotation" toolbar:tooltip="Insert Comment"/>
<toolbar:toolbarseparator/> <toolbar:toolbarseparator/>
<toolbar:toolbaritem xlink:href=".uno:InsertDraw" toolbar:helpid="10244"/> <toolbar:toolbaritem xlink:href=".uno:InsertDraw" toolbar:helpid="10244"/>
<toolbar:toolbaritem xlink:href=".uno:ViewDataSourceBrowser" toolbar:visible="false" toolbar:helpid="6660"/> <toolbar:toolbaritem xlink:href=".uno:ViewDataSourceBrowser" toolbar:visible="false" toolbar:helpid="6660"/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment