sd/source/ui/slidesorter/inc/view/SlsTheme.hxx | 1 sd/source/ui/slidesorter/inc/view/SlsToolTip.hxx | 4 +- sd/source/ui/slidesorter/view/SlsToolTip.cxx | 34 +++++++++++++---------- 3 files changed, 22 insertions(+), 17 deletions(-)
New commits: commit 97107b997a456fc2e471ac64679e1c8a2a12ab09 Author: mhofmann <bor...@web.de> Date: Sun Mar 24 15:10:51 2013 +0100 The tooltips of the slide sorter in impress should behave like the toolbar. When hovering the mouse over a slide its name is displayed in a tooltip. If you jump with the mouse from slide to slide the new tooltip is displayed immediately. Also remove unused member variables and make tooltip delay configurable. Change-Id: Ia2347d81620f0ced437beaaeb49d8ad7f41e9333 Reviewed-on: https://gerrit.libreoffice.org/2969 Reviewed-by: Thorsten Behrens <tbehr...@suse.com> Tested-by: Thorsten Behrens <tbehr...@suse.com> diff --git a/sd/source/ui/slidesorter/inc/view/SlsTheme.hxx b/sd/source/ui/slidesorter/inc/view/SlsTheme.hxx index 99b089d..a4e03da 100644 --- a/sd/source/ui/slidesorter/inc/view/SlsTheme.hxx +++ b/sd/source/ui/slidesorter/inc/view/SlsTheme.hxx @@ -37,7 +37,6 @@ class Properties; namespace sd { namespace slidesorter { namespace view { -const int Theme_ToolTipDelay = 1000; const int Theme_FocusIndicatorWidth = 3; /** Collection of colors and styles that are used to paint the slide sorter diff --git a/sd/source/ui/slidesorter/inc/view/SlsToolTip.hxx b/sd/source/ui/slidesorter/inc/view/SlsToolTip.hxx index 01bc50e..bc26e73 100644 --- a/sd/source/ui/slidesorter/inc/view/SlsToolTip.hxx +++ b/sd/source/ui/slidesorter/inc/view/SlsToolTip.hxx @@ -55,10 +55,10 @@ public: private: SlideSorter& mrSlideSorter; model::SharedPageDescriptor mpDescriptor; - ::rtl::OUString msDefaultHelpText; ::rtl::OUString msCurrentHelpText; sal_uLong mnHelpWindowHandle; - Timer maTimer; + Timer maShowTimer; + Timer maHiddenTimer; /** Request to show the tool tip. @param bForce diff --git a/sd/source/ui/slidesorter/view/SlsToolTip.cxx b/sd/source/ui/slidesorter/view/SlsToolTip.cxx index f28aa53..c0babd7 100644 --- a/sd/source/ui/slidesorter/view/SlsToolTip.cxx +++ b/sd/source/ui/slidesorter/view/SlsToolTip.cxx @@ -33,13 +33,16 @@ namespace sd { namespace slidesorter { namespace view { ToolTip::ToolTip (SlideSorter& rSlideSorter) : mrSlideSorter(rSlideSorter), - msDefaultHelpText(), msCurrentHelpText(), mnHelpWindowHandle(0), - maTimer() + maShowTimer(), + maHiddenTimer() { - maTimer.SetTimeout(Theme_ToolTipDelay); - maTimer.SetTimeoutHdl(LINK(this, ToolTip, DelayTrigger)); + SharedSdWindow window = rSlideSorter.GetContentWindow(); + const HelpSettings& rHelpSettings = window->GetSettings().GetHelpSettings(); + maShowTimer.SetTimeout(rHelpSettings.GetTipDelay()); + maShowTimer.SetTimeoutHdl(LINK(this, ToolTip, DelayTrigger)); + maHiddenTimer.SetTimeout(rHelpSettings.GetTipDelay()); } @@ -47,19 +50,23 @@ ToolTip::ToolTip (SlideSorter& rSlideSorter) ToolTip::~ToolTip (void) { - maTimer.Stop(); + maShowTimer.Stop(); + maHiddenTimer.Stop(); Hide(); } - - void ToolTip::SetPage (const model::SharedPageDescriptor& rpDescriptor) { if (mpDescriptor != rpDescriptor) { - maTimer.Stop(); - Hide(); + maShowTimer.Stop(); + bool bWasVisible = Hide(); + + if (bWasVisible) + { + maHiddenTimer.Start(); + } mpDescriptor = rpDescriptor; @@ -79,13 +86,12 @@ void ToolTip::SetPage (const model::SharedPageDescriptor& rpDescriptor) sHelpText += OUString::number(mpDescriptor->GetPageIndex()+1); } - msDefaultHelpText = sHelpText; msCurrentHelpText = sHelpText; - Show(false); + // show new tooltip immediately, if last one was recently hidden + Show(maHiddenTimer.IsActive()); } else { - msDefaultHelpText = OUString(); msCurrentHelpText = OUString(); } } @@ -98,7 +104,7 @@ void ToolTip::Show (const bool bNoDelay) if (bNoDelay) DoShow(); else - maTimer.Start(); + maShowTimer.Start(); } @@ -106,7 +112,7 @@ void ToolTip::Show (const bool bNoDelay) void ToolTip::DoShow (void) { - if (maTimer.IsActive()) + if (maShowTimer.IsActive()) { // The delay timer is active. Wait for it to trigger the showing of // the tool tip. _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits