diff options
author | Samuel Mehrbrodt <s.mehrbrodt@gmail.com> | 2014-09-30 20:37:12 +0200 |
---|---|---|
committer | Samuel Mehrbrodt <s.mehrbrodt@gmail.com> | 2014-09-30 20:41:21 +0200 |
commit | d59e33500a250824e713afacef2ea295576caba6 (patch) | |
tree | 12f95f7e51253dd33767c89907109f0c6d6d0568 /svx | |
parent | 4badca074088b1f1a70b340d53fc464ec11e3d29 (diff) |
fdo#62081 Improve split menu on style dropdown
* Remove "Apply style"
* Add "Update Style Based on Selection"
* A11y:
* Context menu key: Open submenu
* Return key: Apply style
Change-Id: Ib2960baa1412a05ea00b0e214d1af0a3d119e852
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/tbxctrls/tbcontrl.cxx | 32 | ||||
-rw-r--r-- | svx/source/tbxctrls/tbcontrl.src | 8 |
2 files changed, 18 insertions, 22 deletions
diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx index 8ca31d8ee503..fe8597d16c35 100644 --- a/svx/source/tbxctrls/tbcontrl.cxx +++ b/svx/source/tbxctrls/tbcontrl.cxx @@ -345,24 +345,24 @@ void SvxStyleBox_Impl::ReleaseFocus() IMPL_LINK( SvxStyleBox_Impl, MenuSelectHdl, Menu*, pMenu) { + ReleaseFocus(); + OUString sEntry = OUString( (GetEntry(GetSelectEntryPos())) ); + Sequence< PropertyValue > aArgs( 2 ); + aArgs[0].Name = "Param"; + aArgs[0].Value = makeAny( sEntry ); + aArgs[1].Name = "Family"; + aArgs[1].Value = makeAny( sal_Int16( eStyleFamily )); + sal_uInt16 nMenuId = pMenu->GetCurItemId(); switch(nMenuId) { - case RID_SVX_APPLY_STYLE: + case RID_SVX_UPDATE_STYLE: { - nCurSel = GetSelectEntryPos(); - SetText(GetEntry(nCurSel)); - Select(); + SfxToolBoxControl::Dispatch( m_xDispatchProvider, + OUString( ".uno:StyleUpdateByExample" ), aArgs ); break; } case RID_SVX_MODIFY_STYLE: { - OUString sEntry = OUString( (GetEntry(GetSelectEntryPos())) ); - ReleaseFocus(); - Sequence< PropertyValue > aArgs( 2 ); - aArgs[0].Name = "Param"; - aArgs[0].Value = makeAny( sEntry ); - aArgs[1].Name = "Family"; - aArgs[1].Value = makeAny( sal_Int16( eStyleFamily )); SfxToolBoxControl::Dispatch( m_xDispatchProvider, OUString( ".uno:EditStyle" ), aArgs ); break; @@ -484,22 +484,18 @@ bool SvxStyleBox_Impl::Notify( NotifyEvent& rNEvt ) switch ( nCode ) { - case KEY_RETURN: + case KEY_CONTEXTMENU: { if(IsInDropDown()) { sal_uInt16 nItem = GetSelectEntryPos() - 1; if(nItem < MAX_STYLES_ENTRIES) - m_pButtons[nItem]->KeyInput(*rNEvt.GetKeyEvent()); - nHandled = true; - } - else - { + m_pButtons[nItem]->ExecuteMenu(); nHandled = true; - Select(); } break; } + case KEY_RETURN: case KEY_TAB: { if ( KEY_TAB == nCode ) diff --git a/svx/source/tbxctrls/tbcontrl.src b/svx/source/tbxctrls/tbcontrl.src index 59728c6977e0..df42dca42c4f 100644 --- a/svx/source/tbxctrls/tbcontrl.src +++ b/svx/source/tbxctrls/tbcontrl.src @@ -79,7 +79,7 @@ String RID_SVXSTR_LINECOLOR ComboBox RID_SVXTBX_STYLE { HelpId = HID_STYLE_LISTBOX ; - Size = MAP_APPFONT ( 50 , 86 ) ; + Size = MAP_APPFONT ( 60 , 86 ) ; DropDown = TRUE ; Sort = TRUE ; AutoHScroll = TRUE ; @@ -94,13 +94,13 @@ Menu RID_SVX_STYLE_MENU { MenuItem { - Identifier = RID_SVX_APPLY_STYLE ; - Text [ en-US ] = "Apply style" ; + Identifier = RID_SVX_UPDATE_STYLE ; + Text [ en-US ] = "Update Style Based on Selection" ; }; MenuItem { Identifier = RID_SVX_MODIFY_STYLE ; - Text [ en-US ] = "Modify style" ; + Text [ en-US ] = "Edit Style" ; }; }; }; |