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

fdo82708 Add missing tooltips to Writer Statusbar

Change-Id: Ie44b8de69b98ebfa789cc8f9a1d8a60b698fc154
Reviewed-on: https://gerrit.libreoffice.org/12368Reviewed-by: 's avatarSamuel Mehrbrodt <s.mehrbrodt@gmail.com>
Tested-by: 's avatarSamuel Mehrbrodt <s.mehrbrodt@gmail.com>
üst 93b34d09
...@@ -50,6 +50,7 @@ ...@@ -50,6 +50,7 @@
#define STR_RESET_TO_DEFAULT_LANGUAGE (RID_STR_START+22) #define STR_RESET_TO_DEFAULT_LANGUAGE (RID_STR_START+22)
#define STR_CLEAR_RECENT_FILES (RID_STR_START+23) #define STR_CLEAR_RECENT_FILES (RID_STR_START+23)
#define STR_CLEAR_RECENT_FILES_HELP (RID_STR_START+24) #define STR_CLEAR_RECENT_FILES_HELP (RID_STR_START+24)
#define STR_LANGSTATUS_HINT (RID_STR_START+25)
#define POPUPMENU_TOOLBAR_QUICKCUSTOMIZATION (RID_MENU_START+0) #define POPUPMENU_TOOLBAR_QUICKCUSTOMIZATION (RID_MENU_START+0)
......
...@@ -190,4 +190,9 @@ String STR_SET_LANGUAGE_FOR_ALL_TEXT ...@@ -190,4 +190,9 @@ String STR_SET_LANGUAGE_FOR_ALL_TEXT
Text [ en-US ] = "Set Language for all Text" ; Text [ en-US ] = "Set Language for all Text" ;
}; };
String STR_LANGSTATUS_HINT
{
Text [ en-US ] = "Text Language. Right-click to set selection or paragraph language" ;
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -146,6 +146,7 @@ throw (css::uno::Exception, css::uno::RuntimeException, std::exception) ...@@ -146,6 +146,7 @@ throw (css::uno::Exception, css::uno::RuntimeException, std::exception)
if ( m_xStatusbarItem.is() ) if ( m_xStatusbarItem.is() )
{ {
m_xStatusbarItem->setText( FWK_RESSTR(STR_LANGSTATUS_MULTIPLE_LANGUAGES) ); m_xStatusbarItem->setText( FWK_RESSTR(STR_LANGSTATUS_MULTIPLE_LANGUAGES) );
m_xStatusbarItem->setQuickHelpText(FWK_RESSTR(STR_LANGSTATUS_HINT));
} }
} }
......
...@@ -1045,9 +1045,13 @@ ...@@ -1045,9 +1045,13 @@
#define RID_SVXSTR_RECOVERY_INPROGRESS (RID_SVX_START + 1288) #define RID_SVXSTR_RECOVERY_INPROGRESS (RID_SVX_START + 1288)
#define RID_SVXSTR_RECOVERYONLY_FINISH_DESCR (RID_SVX_START + 1289) #define RID_SVXSTR_RECOVERYONLY_FINISH_DESCR (RID_SVX_START + 1289)
#define RID_SVXSTR_RECOVERYONLY_FINISH (RID_SVX_START + 1290) #define RID_SVXSTR_RECOVERYONLY_FINISH (RID_SVX_START + 1290)
#define RID_SVXSTR_ZOOMTOOL_HINT (RID_SVX_START + 1291)
#define RID_SVXSTR_ZOOM (RID_SVX_START + 1292)
#define RID_SVXSTR_ZOOM_IN (RID_SVX_START + 1293)
#define RID_SVXSTR_ZOOM_OUT (RID_SVX_START + 1294)
// !!! IMPORTANT: consider and update RID_SVXSTR_NEXTFREE when introducing new RIDs for Strings !!! // !!! IMPORTANT: consider and update RID_SVXSTR_NEXTFREE when introducing new RIDs for Strings !!!
#define RID_SVXSTR_NEXTFREE (RID_SVX_START + 1291) #define RID_SVXSTR_NEXTFREE (RID_SVX_START + 1295)
// if we have _a_lot_ time, we should group the resource ids by type, instead // if we have _a_lot_ time, we should group the resource ids by type, instead
// of grouping them by semantics. The reason is that resource ids have to be // of grouping them by semantics. The reason is that resource ids have to be
......
...@@ -121,6 +121,26 @@ String RID_SVXSTR_FIT_SLIDE ...@@ -121,6 +121,26 @@ String RID_SVXSTR_FIT_SLIDE
Text [ en-US ] = "Fit slide to current window."; Text [ en-US ] = "Fit slide to current window.";
}; };
String RID_SVXSTR_ZOOMTOOL_HINT
{
Text [ en-US ] = "Zoom level. Click for dialog box and right-click for zoom list";
};
String RID_SVXSTR_ZOOM
{
Text [ en-US ] = "Adjust zoom level";
};
String RID_SVXSTR_ZOOM_IN
{
Text [ en-US ] = "Zoom in";
};
String RID_SVXSTR_ZOOM_OUT
{
Text [ en-US ] = "Zoom out";
};
// PopupMenu ------------------------------------------------------------- // PopupMenu -------------------------------------------------------------
Menu RID_SVXMNU_ZOOM Menu RID_SVXMNU_ZOOM
{ {
......
...@@ -103,6 +103,7 @@ SvxZoomStatusBarControl::SvxZoomStatusBarControl( sal_uInt16 _nSlotId, ...@@ -103,6 +103,7 @@ SvxZoomStatusBarControl::SvxZoomStatusBarControl( sal_uInt16 _nSlotId,
nZoom( 100 ), nZoom( 100 ),
nValueSet( SVX_ZOOM_ENABLE_ALL ) nValueSet( SVX_ZOOM_ENABLE_ALL )
{ {
GetStatusBar().SetQuickHelpText(GetId(), SVX_RESSTR(RID_SVXSTR_ZOOMTOOL_HINT));
} }
void SvxZoomStatusBarControl::StateChanged( sal_uInt16, SfxItemState eState, void SvxZoomStatusBarControl::StateChanged( sal_uInt16, SfxItemState eState,
......
...@@ -351,14 +351,13 @@ bool SvxZoomSliderControl::MouseMove( const MouseEvent & rEvt ) ...@@ -351,14 +351,13 @@ bool SvxZoomSliderControl::MouseMove( const MouseEvent & rEvt )
return true; return true;
const short nButtons = rEvt.GetButtons(); const short nButtons = rEvt.GetButtons();
// check mouse move with button pressed
if ( 1 == nButtons )
{
const Rectangle aControlRect = getControlRect(); const Rectangle aControlRect = getControlRect();
const Point aPoint = rEvt.GetPosPixel(); const Point aPoint = rEvt.GetPosPixel();
const sal_Int32 nXDiff = aPoint.X() - aControlRect.Left(); const sal_Int32 nXDiff = aPoint.X() - aControlRect.Left();
// check mouse move with button pressed
if ( 1 == nButtons )
{
if ( nXDiff >= nSliderXOffset && nXDiff <= aControlRect.GetWidth() - nSliderXOffset ) if ( nXDiff >= nSliderXOffset && nXDiff <= aControlRect.GetWidth() - nSliderXOffset )
{ {
mpImpl->mnCurrentZoom = Offset2Zoom( nXDiff ); mpImpl->mnCurrentZoom = Offset2Zoom( nXDiff );
...@@ -367,6 +366,23 @@ bool SvxZoomSliderControl::MouseMove( const MouseEvent & rEvt ) ...@@ -367,6 +366,23 @@ bool SvxZoomSliderControl::MouseMove( const MouseEvent & rEvt )
} }
} }
// Tooltips
long nIncDecWidth = mpImpl->maIncreaseButton.GetSizePixel().Width();
const long nButtonLeftOffset = (nSliderXOffset - nIncDecWidth)/2;
const long nButtonRightOffset = (nSliderXOffset + nIncDecWidth)/2;
// click to - button
if ( nXDiff >= nButtonLeftOffset && nXDiff <= nButtonRightOffset )
GetStatusBar().SetQuickHelpText(GetId(), SVX_RESSTR(RID_SVXSTR_ZOOM_OUT));
// click to + button
else if ( nXDiff >= aControlRect.GetWidth() - nSliderXOffset + nButtonLeftOffset &&
nXDiff <= aControlRect.GetWidth() - nSliderXOffset + nButtonRightOffset )
GetStatusBar().SetQuickHelpText(GetId(), SVX_RESSTR(RID_SVXSTR_ZOOM_IN));
else
GetStatusBar().SetQuickHelpText(GetId(), SVX_RESSTR(RID_SVXSTR_ZOOM));
return true; return true;
} }
......
...@@ -80,6 +80,7 @@ $(eval $(call gb_SrsTarget_add_files,sw/res,\ ...@@ -80,6 +80,7 @@ $(eval $(call gb_SrsTarget_add_files,sw/res,\
sw/source/uibase/utlui/attrdesc.src \ sw/source/uibase/utlui/attrdesc.src \
sw/source/uibase/utlui/navipi.src \ sw/source/uibase/utlui/navipi.src \
sw/source/uibase/utlui/initui.src \ sw/source/uibase/utlui/initui.src \
sw/source/uibase/utlui/statusbar.src \
sw/source/uibase/wrtsh/wrtsh.src \ sw/source/uibase/wrtsh/wrtsh.src \
sw/source/uibase/utlui/unotools.src \ sw/source/uibase/utlui/unotools.src \
sw/source/uibase/dbui/mailmergechildwindow.src \ sw/source/uibase/dbui/mailmergechildwindow.src \
......
...@@ -40,7 +40,6 @@ ...@@ -40,7 +40,6 @@
#define RC_FRMDLG (RC_BASE + 1000) #define RC_FRMDLG (RC_BASE + 1000)
#define RC_FLDDLG (RC_BASE + 1100) #define RC_FLDDLG (RC_BASE + 1100)
#define RC_UTLUI (RC_BASE + 1250) #define RC_UTLUI (RC_BASE + 1250)
#define RC_ATTR (RC_BASE + 1350)
#define RC_TABLE (RC_BASE + 1450) #define RC_TABLE (RC_BASE + 1450)
#define RC_CONFIG (RC_BASE + 1550) #define RC_CONFIG (RC_BASE + 1550)
#define RC_MISC (RC_BASE + 1650) #define RC_MISC (RC_BASE + 1650)
...@@ -71,6 +70,7 @@ ...@@ -71,6 +70,7 @@
#define RC_PAGEFRM (RC_BASE + 4250) #define RC_PAGEFRM (RC_BASE + 4250)
#define RC_IDXTXT (RC_BASE + 4350) #define RC_IDXTXT (RC_BASE + 4350)
#define RC_SIDEBAR (RC_BASE + 4450) #define RC_SIDEBAR (RC_BASE + 4450)
#define RC_ATTR (RC_BASE + 4550)
/*-------------------------------------------------------------------- /*--------------------------------------------------------------------
Description: areas unharness Description: areas unharness
...@@ -149,11 +149,7 @@ ...@@ -149,11 +149,7 @@
// Utilities UI // Utilities UI
#define RC_UTLUI_BEGIN RC_UTLUI #define RC_UTLUI_BEGIN RC_UTLUI
#define RC_UTLUI_END (RC_UTLUI + 99) #define RC_UTLUI_END (RC_UTLUI + 199)
// Utilities UI-Attributes
#define RC_ATTR_BEGIN RC_ATTR
#define RC_ATTR_END (RC_ATTR + 99)
// Tables // Tables
#define RC_TABLE_BEGIN RC_TABLE #define RC_TABLE_BEGIN RC_TABLE
...@@ -258,6 +254,11 @@ ...@@ -258,6 +254,11 @@
// sidebar (mostly the Page one) // sidebar (mostly the Page one)
#define RC_SIDEBAR_BEGIN RC_SIDEBAR #define RC_SIDEBAR_BEGIN RC_SIDEBAR
#define RC_SIDEBAR_END (RC_SIDEBAR + 99)
// Utilities UI-Attributes
#define RC_ATTR_BEGIN RC_ATTR
#define RC_ATTR_END (RC_ATTR + 99)
#endif #endif
......
...@@ -45,7 +45,15 @@ ...@@ -45,7 +45,15 @@
#define STR_CONTENT_TYPE_INDEX (RC_UTLUI_BEGIN + 17) #define STR_CONTENT_TYPE_INDEX (RC_UTLUI_BEGIN + 17)
#define STR_CONTENT_TYPE_POSTIT (RC_UTLUI_BEGIN + 18) #define STR_CONTENT_TYPE_POSTIT (RC_UTLUI_BEGIN + 18)
#define STR_CONTENT_TYPE_DRAWOBJECT (RC_UTLUI_BEGIN + 19) #define STR_CONTENT_TYPE_DRAWOBJECT (RC_UTLUI_BEGIN + 19)
#define STR_CONTENT_END (RC_UTLUI_BEGIN + 19) // Statusbar: Word count/Viewlayout/Page count
#define STR_WORDCOUNT_HINT (RC_UTLUI_BEGIN + 20)
#define STR_VIEWLAYOUT_ONE (RC_UTLUI_BEGIN + 21)
#define STR_VIEWLAYOUT_TWO (RC_UTLUI_BEGIN + 22)
#define STR_VIEWLAYOUT_BOOK (RC_UTLUI_BEGIN + 23)
#define STR_BOOKCTRL_HINT (RC_UTLUI_BEGIN + 24)
#define STR_BOOKCTRL_HINT_EXTENDED (RC_UTLUI_BEGIN + 25)
#define STR_TMPLCTRL_HINT (RC_UTLUI_BEGIN + 26)
#define STR_CONTENT_END (RC_UTLUI_BEGIN + 26)
#define STR_CONTENT_TYPE_SINGLE_FIRST (STR_CONTENT_END + 1) #define STR_CONTENT_TYPE_SINGLE_FIRST (STR_CONTENT_END + 1)
#define STR_CONTENT_TYPE_SINGLE_OUTLINE (STR_CONTENT_TYPE_SINGLE_FIRST + 0) #define STR_CONTENT_TYPE_SINGLE_OUTLINE (STR_CONTENT_TYPE_SINGLE_FIRST + 0)
......
...@@ -38,6 +38,7 @@ public: ...@@ -38,6 +38,7 @@ public:
virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState ) SAL_OVERRIDE; virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState ) SAL_OVERRIDE;
virtual void Paint( const UserDrawEvent& rEvt ) SAL_OVERRIDE; virtual void Paint( const UserDrawEvent& rEvt ) SAL_OVERRIDE;
virtual bool MouseButtonDown( const MouseEvent & ) SAL_OVERRIDE; virtual bool MouseButtonDown( const MouseEvent & ) SAL_OVERRIDE;
virtual bool MouseMove( const MouseEvent & ) SAL_OVERRIDE;
}; };
#endif #endif
......
...@@ -1278,9 +1278,16 @@ void SwView::UpdatePageNums(sal_uInt16 nPhyNum, sal_uInt16 nVirtNum, const OUStr ...@@ -1278,9 +1278,16 @@ void SwView::UpdatePageNums(sal_uInt16 nPhyNum, sal_uInt16 nVirtNum, const OUStr
{ {
OUString sTemp(GetPageStr( nPhyNum, nVirtNum, rPgStr )); OUString sTemp(GetPageStr( nPhyNum, nVirtNum, rPgStr ));
const SfxStringItem aTmp( FN_STAT_PAGE, sTemp ); const SfxStringItem aTmp( FN_STAT_PAGE, sTemp );
// Used to distinguish which tooltip to show
const SfxBoolItem bExtendedTooltip( FN_STAT_PAGE,
!rPgStr.isEmpty() && OUString::number(nPhyNum) != rPgStr
&& nPhyNum != nVirtNum );
SfxBindings &rBnd = GetViewFrame()->GetBindings(); SfxBindings &rBnd = GetViewFrame()->GetBindings();
rBnd.SetState( aTmp ); rBnd.SetState( aTmp );
rBnd.Update( FN_STAT_PAGE ); rBnd.Update( FN_STAT_PAGE );
rBnd.SetState( bExtendedTooltip );
rBnd.Update( FN_STAT_PAGE );
} }
void SwView::UpdateDocStats() void SwView::UpdateDocStats()
......
...@@ -18,6 +18,8 @@ ...@@ -18,6 +18,8 @@
*/ */
#include "hintids.hxx" #include "hintids.hxx"
#include <swtypes.hxx>
#include <utlui.hrc>
#include <svl/intitem.hxx> #include <svl/intitem.hxx>
#include <svl/stritem.hxx> #include <svl/stritem.hxx>
...@@ -79,6 +81,14 @@ void SwBookmarkControl::StateChanged( ...@@ -79,6 +81,14 @@ void SwBookmarkControl::StateChanged(
sPageNumber = ((SfxStringItem*)pState)->GetValue(); sPageNumber = ((SfxStringItem*)pState)->GetValue();
GetStatusBar().SetItemText( GetId(), sPageNumber ); GetStatusBar().SetItemText( GetId(), sPageNumber );
} }
else if ( pState->ISA( SfxBoolItem ) )
{
if (((SfxBoolItem*)pState)->GetValue()) // Indicates whether to show extended tooltip
GetStatusBar().SetQuickHelpText(GetId(), SW_RESSTR(STR_BOOKCTRL_HINT_EXTENDED));
else
GetStatusBar().SetQuickHelpText(GetId(), SW_RESSTR(STR_BOOKCTRL_HINT));
}
} }
void SwBookmarkControl::Paint( const UserDrawEvent& ) void SwBookmarkControl::Paint( const UserDrawEvent& )
......
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#include <utlui.hrc>
String STR_WORDCOUNT_HINT
{
Text [ en-US ] = "Word and character count. Click for more extensive stats";
};
String STR_VIEWLAYOUT_ONE
{
Text [ en-US ] = "Single page view";
};
String STR_VIEWLAYOUT_TWO
{
Text [ en-US ] = "Two page view";
};
String STR_VIEWLAYOUT_BOOK
{
Text [ en-US ] = "Book view";
};
String STR_BOOKCTRL_HINT
{
Text [ en-US ] = "Page number/Total pages. Click to show Navigator";
};
String STR_BOOKCTRL_HINT_EXTENDED
{
Text [ en-US ] = "Document page number/Total pages (Print page number). Click to show Navigator";
};
String STR_TMPLCTRL_HINT
{
Text [ en-US ] = "Page Style. Right-click to change style and click to modify style";
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -23,6 +23,9 @@ ...@@ -23,6 +23,9 @@
#include <sfx2/dispatch.hxx> #include <sfx2/dispatch.hxx>
#include <vcl/status.hxx> #include <vcl/status.hxx>
#include <swtypes.hxx>
#include <utlui.hrc>
#include "wrtsh.hxx" #include "wrtsh.hxx"
#include "view.hxx" #include "view.hxx"
#include "swmodule.hxx" #include "swmodule.hxx"
...@@ -56,13 +59,12 @@ void SwTemplatePopup_Impl::Select() ...@@ -56,13 +59,12 @@ void SwTemplatePopup_Impl::Select()
nCurId = GetCurItemId(); nCurId = GetCurItemId();
} }
// class SvxZoomStatusBarControl
SwTemplateControl::SwTemplateControl( sal_uInt16 _nSlotId, SwTemplateControl::SwTemplateControl( sal_uInt16 _nSlotId,
sal_uInt16 _nId, sal_uInt16 _nId,
StatusBar& rStb ) : StatusBar& rStb ) :
SfxStatusBarControl( _nSlotId, _nId, rStb ) SfxStatusBarControl( _nSlotId, _nId, rStb )
{ {
GetStatusBar().SetQuickHelpText(GetId(), SW_RESSTR(STR_TMPLCTRL_HINT));
} }
SwTemplateControl::~SwTemplateControl() SwTemplateControl::~SwTemplateControl()
......
...@@ -191,4 +191,32 @@ bool SwViewLayoutControl::MouseButtonDown( const MouseEvent & rEvt ) ...@@ -191,4 +191,32 @@ bool SwViewLayoutControl::MouseButtonDown( const MouseEvent & rEvt )
return true; return true;
} }
bool SwViewLayoutControl::MouseMove( const MouseEvent & rEvt )
{
const Rectangle aRect = getControlRect();
const Point aPoint = rEvt.GetPosPixel();
const long nXDiff = aPoint.X() - aRect.Left();
const long nImageWidthSingle = mpImpl->maImageSingleColumn.GetSizePixel().Width();
const long nImageWidthAuto = mpImpl->maImageAutomatic.GetSizePixel().Width();
const long nImageWidthBook = mpImpl->maImageBookMode.GetSizePixel().Width();
const long nImageWidthSum = nImageWidthSingle + nImageWidthAuto + nImageWidthBook;
const long nXOffset = (aRect.GetWidth() - nImageWidthSum)/2;
if ( nXDiff < nXOffset + nImageWidthSingle )
{
GetStatusBar().SetQuickHelpText(GetId(), SW_RESSTR(STR_VIEWLAYOUT_ONE));
}
else if ( nXDiff < nXOffset + nImageWidthSingle + nImageWidthAuto )
{
GetStatusBar().SetQuickHelpText(GetId(), SW_RESSTR(STR_VIEWLAYOUT_TWO));
}
else
{
GetStatusBar().SetQuickHelpText(GetId(), SW_RESSTR(STR_VIEWLAYOUT_BOOK));
}
return true;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. * file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/ */
#include <swtypes.hxx>
#include <utlui.hrc>
#include "wordcountctrl.hxx" #include "wordcountctrl.hxx"
#include <svl/stritem.hxx> #include <svl/stritem.hxx>
...@@ -29,6 +31,8 @@ void SwWordCountStatusBarControl::StateChanged( ...@@ -29,6 +31,8 @@ void SwWordCountStatusBarControl::StateChanged(
{ {
if (eState == SfxItemState::DEFAULT) // Can access pState if (eState == SfxItemState::DEFAULT) // Can access pState
GetStatusBar().SetItemText( GetId(), ((SfxStringItem*)pState)->GetValue() ); GetStatusBar().SetItemText( GetId(), ((SfxStringItem*)pState)->GetValue() );
GetStatusBar().SetQuickHelpText(GetId(), SW_RESSTR(STR_WORDCOUNT_HINT));
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
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