renaissance1: #i107215# Do not show buttons for Draw documents.

This commit is contained in:
Andre Fischer
2010-06-17 14:55:31 +02:00
parent e51ec1618d
commit d57de36d81
3 changed files with 39 additions and 21 deletions

View File

@@ -857,11 +857,19 @@ void SelectionFunction::SwitchToMultiSelectionMode (
void SelectionFunction::SwitchToButtonMode (void) bool SelectionFunction::SwitchToButtonMode (void)
{ {
if (mpModeHandler->GetMode() != ButtonMode) // Do not show the buttons for draw pages.
SwitchMode(::boost::shared_ptr<ModeHandler>( ::boost::shared_ptr<ViewShell> pMainViewShell (mrSlideSorter.GetViewShellBase()->GetMainViewShell());
new ButtonModeHandler(mrSlideSorter, *this))); if (pMainViewShell
&& pMainViewShell->GetShellType()!=ViewShell::ST_DRAW
&& mpModeHandler->GetMode() != ButtonMode)
{
SwitchMode(::boost::shared_ptr<ModeHandler>(new ButtonModeHandler(mrSlideSorter, *this)));
return true;
}
else
return false;
} }
@@ -1357,8 +1365,8 @@ bool NormalModeHandler::ProcessButtonDownEvent (
// (or being faded in.) // (or being faded in.)
if (mrSlideSorter.GetView().GetButtonBar().IsVisible(rDescriptor.mpHitDescriptor)) if (mrSlideSorter.GetView().GetButtonBar().IsVisible(rDescriptor.mpHitDescriptor))
{ {
mrSelectionFunction.SwitchToButtonMode(); if (mrSelectionFunction.SwitchToButtonMode())
ReprocessEvent(rDescriptor); ReprocessEvent(rDescriptor);
} }
else else
{ {

View File

@@ -117,7 +117,7 @@ public:
void SwitchToNormalMode (void); void SwitchToNormalMode (void);
void SwitchToDragAndDropMode(const Point aMousePosition); void SwitchToDragAndDropMode(const Point aMousePosition);
void SwitchToMultiSelectionMode (const Point aMousePosition, const sal_uInt32 nEventCode); void SwitchToMultiSelectionMode (const Point aMousePosition, const sal_uInt32 nEventCode);
void SwitchToButtonMode (void); bool SwitchToButtonMode (void);
void ResetShiftKeySelectionAnchor (void); void ResetShiftKeySelectionAnchor (void);

View File

@@ -955,15 +955,20 @@ void SlideSorterView::UpdatePageUnderMouse (
SharedSdWindow pWindow (mrSlideSorter.GetContentWindow()); SharedSdWindow pWindow (mrSlideSorter.GetContentWindow());
const Point aMouseModelPosition (pWindow->PixelToLogic(rMousePosition)); const Point aMouseModelPosition (pWindow->PixelToLogic(rMousePosition));
const bool bIsMouseOverButtonBar (GetButtonBar().IsMouseOverBar()); ::boost::shared_ptr<ViewShell> pMainViewShell (mrSlideSorter.GetViewShellBase()->GetMainViewShell());
GetButtonBar().ProcessMouseMotionEvent(rpDescriptor, aMouseModelPosition, bIsMouseButtonDown); if (pMainViewShell
// Set the help text of the slide when the mouse was moved from && pMainViewShell->GetShellType()!=ViewShell::ST_DRAW)
// the button bar back over the preview.
if (rpDescriptor
&& GetButtonBar().IsMouseOverBar() != bIsMouseOverButtonBar
&& bIsMouseOverButtonBar)
{ {
mpToolTip->ShowDefaultHelpText(); const bool bIsMouseOverButtonBar (GetButtonBar().IsMouseOverBar());
GetButtonBar().ProcessMouseMotionEvent(rpDescriptor, aMouseModelPosition, bIsMouseButtonDown);
// Set the help text of the slide when the mouse was moved from the
// button bar back over the preview.
if (rpDescriptor
&& GetButtonBar().IsMouseOverBar() != bIsMouseOverButtonBar
&& bIsMouseOverButtonBar)
{
mpToolTip->ShowDefaultHelpText();
}
} }
} }
@@ -1017,12 +1022,17 @@ bool SlideSorterView::SetState (
RequestRepaint(pDescriptor); RequestRepaint(pDescriptor);
} }
// Fade in or out the buttons. ::boost::shared_ptr<ViewShell> pMainViewShell(mrSlideSorter.GetViewShellBase()->GetMainViewShell());
if (eState == PageDescriptor::ST_MouseOver) if (pMainViewShell
if (bStateValue) && pMainViewShell->GetShellType()!=ViewShell::ST_DRAW)
GetButtonBar().RequestFadeIn(rpDescriptor, bAnimate); {
else // Fade in or out the buttons.
GetButtonBar().RequestFadeOut(rpDescriptor, bAnimate); if (eState == PageDescriptor::ST_MouseOver)
if (bStateValue)
GetButtonBar().RequestFadeIn(rpDescriptor, bAnimate);
else
GetButtonBar().RequestFadeOut(rpDescriptor, bAnimate);
}
return bModified; return bModified;
} }