summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <s.mehrbrodt@gmail.com>2014-11-11 21:47:01 +0100
committerSamuel Mehrbrodt <s.mehrbrodt@gmail.com>2014-11-11 20:53:53 +0000
commit355770eff40acc07e9cd46fa4dcfb39e6a86166e (patch)
treec9a8ae748bca761596712c4c482b90be337e366b /sw
parent93b34d091756de6fc3e5424aa45e00397146cc51 (diff)
fdo82708 Add missing tooltips to Writer Statusbar
Change-Id: Ie44b8de69b98ebfa789cc8f9a1d8a60b698fc154 Reviewed-on: https://gerrit.libreoffice.org/12368 Reviewed-by: Samuel Mehrbrodt <s.mehrbrodt@gmail.com> Tested-by: Samuel Mehrbrodt <s.mehrbrodt@gmail.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/AllLangResTarget_sw.mk1
-rw-r--r--sw/inc/rcid.hrc13
-rw-r--r--sw/source/uibase/inc/utlui.hrc24
-rw-r--r--sw/source/uibase/inc/viewlayoutctrl.hxx1
-rw-r--r--sw/source/uibase/uiview/view2.cxx7
-rw-r--r--sw/source/uibase/utlui/bookctrl.cxx10
-rw-r--r--sw/source/uibase/utlui/statusbar.src43
-rw-r--r--sw/source/uibase/utlui/tmplctrl.cxx6
-rw-r--r--sw/source/uibase/utlui/viewlayoutctrl.cxx28
-rw-r--r--sw/source/uibase/utlui/wordcountctrl.cxx4
10 files changed, 121 insertions, 16 deletions
diff --git a/sw/AllLangResTarget_sw.mk b/sw/AllLangResTarget_sw.mk
index c4c7780dd953..c95c16a2241f 100644
--- a/sw/AllLangResTarget_sw.mk
+++ b/sw/AllLangResTarget_sw.mk
@@ -80,6 +80,7 @@ $(eval $(call gb_SrsTarget_add_files,sw/res,\
sw/source/uibase/utlui/attrdesc.src \
sw/source/uibase/utlui/navipi.src \
sw/source/uibase/utlui/initui.src \
+ sw/source/uibase/utlui/statusbar.src \
sw/source/uibase/wrtsh/wrtsh.src \
sw/source/uibase/utlui/unotools.src \
sw/source/uibase/dbui/mailmergechildwindow.src \
diff --git a/sw/inc/rcid.hrc b/sw/inc/rcid.hrc
index 4e8428a0a52b..0af476262780 100644
--- a/sw/inc/rcid.hrc
+++ b/sw/inc/rcid.hrc
@@ -40,7 +40,6 @@
#define RC_FRMDLG (RC_BASE + 1000)
#define RC_FLDDLG (RC_BASE + 1100)
#define RC_UTLUI (RC_BASE + 1250)
-#define RC_ATTR (RC_BASE + 1350)
#define RC_TABLE (RC_BASE + 1450)
#define RC_CONFIG (RC_BASE + 1550)
#define RC_MISC (RC_BASE + 1650)
@@ -71,6 +70,7 @@
#define RC_PAGEFRM (RC_BASE + 4250)
#define RC_IDXTXT (RC_BASE + 4350)
#define RC_SIDEBAR (RC_BASE + 4450)
+#define RC_ATTR (RC_BASE + 4550)
/*--------------------------------------------------------------------
Description: areas unharness
@@ -149,11 +149,7 @@
// Utilities UI
#define RC_UTLUI_BEGIN RC_UTLUI
-#define RC_UTLUI_END (RC_UTLUI + 99)
-
-// Utilities UI-Attributes
-#define RC_ATTR_BEGIN RC_ATTR
-#define RC_ATTR_END (RC_ATTR + 99)
+#define RC_UTLUI_END (RC_UTLUI + 199)
// Tables
#define RC_TABLE_BEGIN RC_TABLE
@@ -258,6 +254,11 @@
// sidebar (mostly the Page one)
#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
diff --git a/sw/source/uibase/inc/utlui.hrc b/sw/source/uibase/inc/utlui.hrc
index 9007b886838a..4caa3b387604 100644
--- a/sw/source/uibase/inc/utlui.hrc
+++ b/sw/source/uibase/inc/utlui.hrc
@@ -45,7 +45,15 @@
#define STR_CONTENT_TYPE_INDEX (RC_UTLUI_BEGIN + 17)
#define STR_CONTENT_TYPE_POSTIT (RC_UTLUI_BEGIN + 18)
#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_OUTLINE (STR_CONTENT_TYPE_SINGLE_FIRST + 0)
@@ -142,13 +150,13 @@
#define IMG_NAVI_ENTRYBMP (RC_UTLUI_BEGIN + 4)
#define ILIST_DB_DLG (RC_UTLUI_BEGIN + 6)
-#define IMG_VIEWLAYOUT_AUTOMATIC (RC_UTLUI_BEGIN + 12)
-#define IMG_VIEWLAYOUT_AUTOMATIC_ACTIVE (RC_UTLUI_BEGIN + 13)
-#define IMG_VIEWLAYOUT_BOOKMODE (RC_UTLUI_BEGIN + 14)
-#define IMG_VIEWLAYOUT_BOOKMODE_ACTIVE (RC_UTLUI_BEGIN + 15)
-#define IMG_VIEWLAYOUT_SINGLECOLUMN (RC_UTLUI_BEGIN + 16)
-#define IMG_VIEWLAYOUT_SINGLECOLUMN_ACTIVE (RC_UTLUI_BEGIN + 17)
-#define IMG_PAGE_BREAK (RC_UTLUI_BEGIN + 18)
+#define IMG_VIEWLAYOUT_AUTOMATIC (RC_UTLUI_BEGIN + 12)
+#define IMG_VIEWLAYOUT_AUTOMATIC_ACTIVE (RC_UTLUI_BEGIN + 13)
+#define IMG_VIEWLAYOUT_BOOKMODE (RC_UTLUI_BEGIN + 14)
+#define IMG_VIEWLAYOUT_BOOKMODE_ACTIVE (RC_UTLUI_BEGIN + 15)
+#define IMG_VIEWLAYOUT_SINGLECOLUMN (RC_UTLUI_BEGIN + 16)
+#define IMG_VIEWLAYOUT_SINGLECOLUMN_ACTIVE (RC_UTLUI_BEGIN + 17)
+#define IMG_PAGE_BREAK (RC_UTLUI_BEGIN + 18)
//local ids of the Database ImageLists
#define IMG_COLLAPSE 18002 /*RID_SVXIMG_COLLAPSEDNODE*/
diff --git a/sw/source/uibase/inc/viewlayoutctrl.hxx b/sw/source/uibase/inc/viewlayoutctrl.hxx
index 0816b001eb77..fb47e04263be 100644
--- a/sw/source/uibase/inc/viewlayoutctrl.hxx
+++ b/sw/source/uibase/inc/viewlayoutctrl.hxx
@@ -38,6 +38,7 @@ public:
virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState ) SAL_OVERRIDE;
virtual void Paint( const UserDrawEvent& rEvt ) SAL_OVERRIDE;
virtual bool MouseButtonDown( const MouseEvent & ) SAL_OVERRIDE;
+ virtual bool MouseMove( const MouseEvent & ) SAL_OVERRIDE;
};
#endif
diff --git a/sw/source/uibase/uiview/view2.cxx b/sw/source/uibase/uiview/view2.cxx
index 159941ff4e4e..1625a884a7fc 100644
--- a/sw/source/uibase/uiview/view2.cxx
+++ b/sw/source/uibase/uiview/view2.cxx
@@ -1278,9 +1278,16 @@ void SwView::UpdatePageNums(sal_uInt16 nPhyNum, sal_uInt16 nVirtNum, const OUStr
{
OUString sTemp(GetPageStr( nPhyNum, nVirtNum, rPgStr ));
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();
rBnd.SetState( aTmp );
rBnd.Update( FN_STAT_PAGE );
+ rBnd.SetState( bExtendedTooltip );
+ rBnd.Update( FN_STAT_PAGE );
}
void SwView::UpdateDocStats()
diff --git a/sw/source/uibase/utlui/bookctrl.cxx b/sw/source/uibase/utlui/bookctrl.cxx
index e4e5c90c0342..70a913fdb7a5 100644
--- a/sw/source/uibase/utlui/bookctrl.cxx
+++ b/sw/source/uibase/utlui/bookctrl.cxx
@@ -18,6 +18,8 @@
*/
#include "hintids.hxx"
+#include <swtypes.hxx>
+#include <utlui.hrc>
#include <svl/intitem.hxx>
#include <svl/stritem.hxx>
@@ -79,6 +81,14 @@ void SwBookmarkControl::StateChanged(
sPageNumber = ((SfxStringItem*)pState)->GetValue();
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& )
diff --git a/sw/source/uibase/utlui/statusbar.src b/sw/source/uibase/utlui/statusbar.src
new file mode 100644
index 000000000000..dcb5bbab26e4
--- /dev/null
+++ b/sw/source/uibase/utlui/statusbar.src
@@ -0,0 +1,43 @@
+/* -*- 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: */
diff --git a/sw/source/uibase/utlui/tmplctrl.cxx b/sw/source/uibase/utlui/tmplctrl.cxx
index a22c112f24c8..1046b05294c6 100644
--- a/sw/source/uibase/utlui/tmplctrl.cxx
+++ b/sw/source/uibase/utlui/tmplctrl.cxx
@@ -23,6 +23,9 @@
#include <sfx2/dispatch.hxx>
#include <vcl/status.hxx>
+#include <swtypes.hxx>
+#include <utlui.hrc>
+
#include "wrtsh.hxx"
#include "view.hxx"
#include "swmodule.hxx"
@@ -56,13 +59,12 @@ void SwTemplatePopup_Impl::Select()
nCurId = GetCurItemId();
}
-// class SvxZoomStatusBarControl
-
SwTemplateControl::SwTemplateControl( sal_uInt16 _nSlotId,
sal_uInt16 _nId,
StatusBar& rStb ) :
SfxStatusBarControl( _nSlotId, _nId, rStb )
{
+ GetStatusBar().SetQuickHelpText(GetId(), SW_RESSTR(STR_TMPLCTRL_HINT));
}
SwTemplateControl::~SwTemplateControl()
diff --git a/sw/source/uibase/utlui/viewlayoutctrl.cxx b/sw/source/uibase/utlui/viewlayoutctrl.cxx
index bc58ff865d91..b3204ee4bbc8 100644
--- a/sw/source/uibase/utlui/viewlayoutctrl.cxx
+++ b/sw/source/uibase/utlui/viewlayoutctrl.cxx
@@ -191,4 +191,32 @@ bool SwViewLayoutControl::MouseButtonDown( const MouseEvent & rEvt )
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: */
diff --git a/sw/source/uibase/utlui/wordcountctrl.cxx b/sw/source/uibase/utlui/wordcountctrl.cxx
index 3d3ac34f8e87..58fe4b40db37 100644
--- a/sw/source/uibase/utlui/wordcountctrl.cxx
+++ b/sw/source/uibase/utlui/wordcountctrl.cxx
@@ -7,6 +7,8 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
+#include <swtypes.hxx>
+#include <utlui.hrc>
#include "wordcountctrl.hxx"
#include <svl/stritem.hxx>
@@ -29,6 +31,8 @@ void SwWordCountStatusBarControl::StateChanged(
{
if (eState == SfxItemState::DEFAULT) // Can access pState
GetStatusBar().SetItemText( GetId(), ((SfxStringItem*)pState)->GetValue() );
+
+ GetStatusBar().SetQuickHelpText(GetId(), SW_RESSTR(STR_WORDCOUNT_HINT));
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */