Kaydet (Commit) 504d3ed8 authored tarafından Jan Holesovsky's avatar Jan Holesovsky

Impress: Kill the so much hated ButtonBar in slide sorter.

Change-Id: I9eb570e04fc43f2be2ceecd14cb3a41535e49b9b
üst 58c32f1f
......@@ -373,7 +373,6 @@ $(eval $(call gb_Library_add_exception_objects,sd,\
sd/source/ui/slidesorter/shell/SlideSorterService \
sd/source/ui/slidesorter/shell/SlideSorterViewShell \
sd/source/ui/slidesorter/view/SlideSorterView \
sd/source/ui/slidesorter/view/SlsButtonBar \
sd/source/ui/slidesorter/view/SlsFontProvider \
sd/source/ui/slidesorter/view/SlsFramePainter \
sd/source/ui/slidesorter/view/SlsInsertAnimator \
......
......@@ -471,7 +471,7 @@ bool SlideSorterController::Command (
SdResId(nPopupId),
pWindow,
&aMenuLocation);
mrSlideSorter.GetView().UpdatePageUnderMouse(false);
mrSlideSorter.GetView().UpdatePageUnderMouse();
::rtl::Reference<SelectionFunction> pFunction(GetCurrentSelectionFunction());
if (pFunction.is())
pFunction->ResetMouseAnchor();
......@@ -519,7 +519,7 @@ bool SlideSorterController::Command (
ScrollBarManager::Unit_Slide,
-pData->GetNotchDelta());
}
mrSlideSorter.GetView().UpdatePageUnderMouse(rEvent.GetMousePosPixel(), false);
mrSlideSorter.GetView().UpdatePageUnderMouse(rEvent.GetMousePosPixel());
bEventHasBeenHandled = true;
}
......
......@@ -57,23 +57,6 @@ double AnimationFunction::Blend (
void AnimationFunction::ApplyButtonAlphaChange(
const model::SharedPageDescriptor& rpDescriptor,
view::SlideSorterView& rView,
const double nButtonAlpha,
const double nButtonBarAlpha)
{
if (rpDescriptor)
{
rpDescriptor->GetVisualState().SetButtonAlpha(nButtonAlpha);
rpDescriptor->GetVisualState().SetButtonBarAlpha(nButtonBarAlpha);
rView.RequestRepaint(rpDescriptor);
}
}
//===== AnimationBezierFunction ===============================================
AnimationBezierFunction::AnimationBezierFunction (
......
......@@ -59,15 +59,6 @@ public:
/** Blend two points together according to the given weight.
*/
static double Blend (const double nStartValue, const double nEndValue, const double nWeight);
/** Apply a gradual change the alpha value from the old value to a
new value (set prior to this call.)
*/
static void ApplyButtonAlphaChange(
const model::SharedPageDescriptor& rpDescriptor,
view::SlideSorterView& rView,
const double nButtonAlpha,
const double nButtonBarAlpha);
};
......
......@@ -108,7 +108,6 @@ public:
void SwitchToNormalMode (void);
void SwitchToDragAndDropMode(const Point aMousePosition);
void SwitchToMultiSelectionMode (const Point aMousePosition, const sal_uInt32 nEventCode);
bool SwitchToButtonMode (void);
void ResetShiftKeySelectionAnchor (void);
/** Special case handling for when the context menu is hidden. This
......
......@@ -63,13 +63,6 @@ public:
Point GetLocationOffset (void) const;
bool SetLocationOffset (const Point& rPoint);
double GetButtonAlpha (void) const;
void SetButtonAlpha (const double nAlpha);
double GetButtonBarAlpha (void) const;
void SetButtonBarAlpha (const double nAlpha);
sal_Int32 GetButtonAlphaAnimationId (void) const;
void SetButtonAlphaAnimationId (const sal_Int32 nAnimationId);
sal_Int32 mnPageId; // For debugging
private:
......@@ -81,10 +74,6 @@ private:
Point maLocationOffset;
sal_Int32 mnLocationAnimationId;
double mnButtonAlpha;
double mnButtonBarAlpha;
sal_Int32 mnButtonAlphaAnimationId;
};
} } } // end of namespace ::sd::slidesorter::model
......
......@@ -63,7 +63,6 @@ class SlideSorterModel;
namespace sd { namespace slidesorter { namespace view {
class ButtonBar;
class LayeredDevice;
class Layouter;
class PageObjectPainter;
......@@ -213,25 +212,14 @@ public:
/** The page under the mouse is not highlighted in some contexts. Call
this method on context changes.
*/
void UpdatePageUnderMouse (bool bAnimate);
void UpdatePageUnderMouse (
const Point& rMousePosition,
const bool bIsMouseButtonDown,
const bool bAnimate = true);
void UpdatePageUnderMouse (
const model::SharedPageDescriptor& rpDescriptor,
const Point& rMousePosition,
const bool bIsMouseButtonDown,
const bool bAnimate = true);
void SetPageUnderMouse (
const model::SharedPageDescriptor& rpDescriptor,
const bool bAnimate = true);
void UpdatePageUnderMouse ();
void UpdatePageUnderMouse (const Point& rMousePosition);
void SetPageUnderMouse (const model::SharedPageDescriptor& rpDescriptor);
bool SetState (
const model::SharedPageDescriptor& rpDescriptor,
const model::PageDescriptor::State eState,
const bool bStateValue,
const bool bAnimate = true);
const bool bStateValue);
void UpdateOrientation (void);
......@@ -252,7 +240,6 @@ public:
SharedSdWindow mpWindow;
};
ButtonBar& GetButtonBar (void) const;
ToolTip& GetToolTip (void) const;
protected:
......@@ -278,7 +265,6 @@ private:
::boost::shared_ptr<SelectionPainter> mpSelectionPainter;
Region maRedrawRegion;
SharedILayerPainter mpBackgroundPainter;
::boost::scoped_ptr<ButtonBar> mpButtonBar;
::boost::scoped_ptr<ToolTip> mpToolTip;
bool mbIsRearrangePending;
::std::vector<Link> maVisibilityChangeListeners;
......
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* OpenOffice.org is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
************************************************************************/
#ifndef SD_SLIDESORTER_VIEW_BUTTON_BAR_HXX
#define SD_SLIDESORTER_VIEW_BUTTON_BAR_HXX
#include "model/SlsSharedPageDescriptor.hxx"
#include <tools/gen.hxx>
#include <rtl/ustring.hxx>
#include <vcl/bitmapex.hxx>
#include <vcl/bmpacc.hxx>
#include <boost/scoped_ptr.hpp>
namespace sd { namespace slidesorter {
class SlideSorter;
} }
namespace sd { namespace slidesorter { namespace view {
class Theme;
class Button;
typedef ::boost::shared_ptr<Button> SharedButton;
/** This is a container of buttons and a coordinating controller.
The last means that it receives mouse events and forwards them to
the right button.
*/
class ButtonBar
{
public:
ButtonBar (SlideSorter& rSlideSorter);
~ButtonBar (void);
void ProcessButtonDownEvent (
const model::SharedPageDescriptor& rpDescriptor,
const Point aMouseModelLocation);
void ProcessButtonUpEvent (
const model::SharedPageDescriptor& rpDescriptor,
const Point aMouseModelLocation);
void ProcessMouseMotionEvent (
const model::SharedPageDescriptor& rpDescriptor,
const Point aMouseModelLocation,
const bool bIsMouseButtonDown);
void ResetPage (void);
bool IsMouseOverBar (void) const;
/** Paint the specified page object. When this is not the same as the
one under the mouse (mpDescriptor) then the buttons are all
painted in their normal state.
*/
void Paint (
OutputDevice& rDevice,
const model::SharedPageDescriptor& rpPageDescriptor);
bool IsMouseOverButton (void) const;
/** Return the help text for the button under the mouse.
@return
When the mouse is not over a button then an empty string
is returned.
*/
::rtl::OUString GetButtonHelpText (void) const;
/** Request the button bar to be shown.
@param bAnimate
This flag controls whether to just show the button bar (<FALSE/>)
or to fade it in smoothly (<TRUE/>.)
*/
void RequestFadeIn (
const model::SharedPageDescriptor& rpDescriptor,
const bool bAnimate);
/** Request the button bar to be hidden.
@param bAnimate
This flag controls whether to just hide the button bar (<FALSE/>)
or to fade it out smoothly (<TRUE/>.)
*/
void RequestFadeOut (
const model::SharedPageDescriptor& rpDescriptor,
const bool bAnimate);
/** Return whether the button bar is visible for the givn descriptor (or
being faded in.)
*/
bool IsVisible (const model::SharedPageDescriptor& rpDescriptor);
void HandleDataChangeEvent (void);
class BackgroundTheme;
/** While at least one Lock object exists the button bar will not be
displayed. Used, e.g. during a mouse multiselection to avoid
confusing and unhelpfull visual signals.
*/
class Lock
{
public:
Lock (SlideSorter& rSlideSorter);
~Lock (void);
private:
ButtonBar& mrButtonBar;
};
private:
SlideSorter& mrSlideSorter;
Size maPageObjectSize;
Rectangle maButtonBoundingBox;
Point maBackgroundLocation;
model::SharedPageDescriptor mpDescriptor;
bool mbIsExcluded;
boost::shared_ptr<Button> mpButtonUnderMouse;
// The button on which the mouse button was pressed.
boost::shared_ptr<Button> mpDownButton;
::std::vector<SharedButton> maRegularButtons;
::std::vector<SharedButton> maExcludedButtons;
BitmapEx maNormalBackground;
bool mbIsMouseOverBar;
::boost::scoped_ptr<BackgroundTheme> mpBackgroundTheme;
int mnLockCount;
/** Remember the specified page. If it differs from mpDescriptor then
the buttons are placed anew.
@return
The returned flag indicates whether the mpDescriptor member
is set to a new value.
*/
bool SetPage (const model::SharedPageDescriptor& rpDescriptor);
SharedButton GetButtonAt (const Point aModelLocation);
bool SetButtonUnderMouse (const SharedButton& rButton = SharedButton());
void PaintButtonBackground (
OutputDevice& rDevice,
const model::SharedPageDescriptor& rpPageDescriptor,
const Point aOffset);
void LayoutButtons (const Size aPageModelSize);
bool LayoutButtons (void);
BitmapEx CreateBackground (
const OutputDevice& rTemplateDevice,
const bool bIsButtonDown) const;
bool IsMouseOverBar (const Point aModelLocation) const;
void StartFadeAnimation (
const model::SharedPageDescriptor& rpDescriptor,
const double nTargetAlpha,
const bool bFadeIn);
void AcquireLock (void);
void ReleaseLock (void);
};
class Button
{
public:
Button (
SlideSorter& rSlideSorter,
const BitmapEx& rLargeIcon,
const BitmapEx& rLargeHoverIcon,
const BitmapEx& rMediumIcon,
const BitmapEx& rMediumHoverIcon,
const BitmapEx& rSmallIcon,
const BitmapEx& rSmallHoverIcon,
const ::rtl::OUString& rsHelpText);
virtual ~Button (void);
enum State { State_Normal, State_Hover, State_Down };
enum IconSize { IconSize_Large, IconSize_Medium, IconSize_Small };
/** Set a new state.
@return
When the new state is different from the old state
then <TRUE/> is returned.
*/
bool SetState (const State eState);
virtual void Place (const Rectangle aButtonBarBox);
virtual void Paint (
OutputDevice& rDevice,
const Point aOffset,
const double nAlpha,
const ::boost::shared_ptr<Theme>& rpTheme) const;
virtual void ProcessClick (const model::SharedPageDescriptor& rpDescriptor) = 0;
/** Return the bounding box of the layouted button.
*/
Rectangle GetBoundingBox (void) const;
/** Return the minimum size required to completely paint the
button.
*/
virtual Size GetSize (void) const;
virtual Size GetSize (const IconSize eIconSize) const;
::rtl::OUString GetHelpText (void) const;
void SetActiveState (const bool bIsActive);
bool IsActive (void) const;
void SetIconSize (const IconSize eIconSize);
/** By default a button is always enabled. Override to change this.
*/
virtual bool IsEnabled (void) const;
protected:
SlideSorter& mrSlideSorter;
State meState;
Rectangle maBoundingBox;
const ::rtl::OUString msHelpText;
// Buttons that lie (partly) outside the button bar are deactivated.
bool mbIsActive;
IconSize meIconSize;
const BitmapEx maLargeIcon;
const BitmapEx maLargeHoverIcon;
const BitmapEx maMediumIcon;
const BitmapEx maMediumHoverIcon;
const BitmapEx maSmallIcon;
const BitmapEx maSmallHoverIcon;
};
class UnhideButton : public Button
{
public:
UnhideButton (SlideSorter& rSlideSorter);
protected:
virtual void ProcessClick (const model::SharedPageDescriptor& rpDescriptor);
};
class StartShowButton : public Button
{
public:
StartShowButton (SlideSorter& rSlideSorter);
virtual bool IsEnabled (void) const;
protected:
virtual void ProcessClick (const model::SharedPageDescriptor& rpDescriptor);
};
class HideButton : public Button
{
public:
HideButton (SlideSorter& rSlideSorter);
protected:
virtual void ProcessClick (const model::SharedPageDescriptor& rpDescriptor);
};
class DuplicateButton : public Button
{
public:
DuplicateButton (SlideSorter& rSlideSorter);
virtual bool IsEnabled (void) const;
protected:
virtual void ProcessClick (const model::SharedPageDescriptor& rpDescriptor);
};
} } } // end of namespace ::sd::slidesorter::view
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -41,7 +41,6 @@ class PageCache;
namespace sd { namespace slidesorter { namespace view {
class ButtonBar;
class Layouter;
class PageObjectLayouter;
class FramePainter;
......@@ -96,7 +95,6 @@ private:
Bitmap maMouseOverBackground;
Bitmap maMouseOverFocusedBackground;
Bitmap maMouseOverSelectedAndFocusedBackground;
ButtonBar& mrButtonBar;
Size maSize;
void PaintBackground (
......
......@@ -21,71 +21,6 @@
#include "glob.hrc"
#define IMAGE_COMMAND1_LARGE 1
#define IMAGE_COMMAND1_LARGE_HOVER 2
#define IMAGE_COMMAND1_MEDIUM 3
#define IMAGE_COMMAND1_MEDIUM_HOVER 4
#define IMAGE_COMMAND1_SMALL 5
#define IMAGE_COMMAND1_SMALL_HOVER 6
#define IMAGE_COMMAND1_LARGE_HC 7
#define IMAGE_COMMAND1_LARGE_HOVER_HC 8
#define IMAGE_COMMAND1_MEDIUM_HC 9
#define IMAGE_COMMAND1_MEDIUM_HOVER_HC 10
#define IMAGE_COMMAND1_SMALL_HC 11
#define IMAGE_COMMAND1_SMALL_HOVER_HC 12
#define IMAGE_COMMAND2_LARGE 20
#define IMAGE_COMMAND2_LARGE_HOVER 21
#define IMAGE_COMMAND2_MEDIUM 22
#define IMAGE_COMMAND2_MEDIUM_HOVER 23
#define IMAGE_COMMAND2_SMALL 24
#define IMAGE_COMMAND2_SMALL_HOVER 25
#define IMAGE_COMMAND2_LARGE_HC 26
#define IMAGE_COMMAND2_LARGE_HOVER_HC 27
#define IMAGE_COMMAND2_MEDIUM_HC 28
#define IMAGE_COMMAND2_MEDIUM_HOVER_HC 29
#define IMAGE_COMMAND2_SMALL_HC 30
#define IMAGE_COMMAND2_SMALL_HOVER_HC 31
#define IMAGE_COMMAND2B_LARGE 40
#define IMAGE_COMMAND2B_LARGE_HOVER 41
#define IMAGE_COMMAND2B_MEDIUM 42
#define IMAGE_COMMAND2B_MEDIUM_HOVER 43
#define IMAGE_COMMAND2B_SMALL 44
#define IMAGE_COMMAND2B_SMALL_HOVER 45
#define IMAGE_COMMAND2B_LARGE_HC 46
#define IMAGE_COMMAND2B_LARGE_HOVER_HC 47
#define IMAGE_COMMAND2B_MEDIUM_HC 48
#define IMAGE_COMMAND2B_MEDIUM_HOVER_HC 49
#define IMAGE_COMMAND2B_SMALL_HC 50
#define IMAGE_COMMAND2B_SMALL_HOVER_HC 51
#define IMAGE_COMMAND3_LARGE 60
#define IMAGE_COMMAND3_LARGE_HOVER 61
#define IMAGE_COMMAND3_MEDIUM 62
#define IMAGE_COMMAND3_MEDIUM_HOVER 63
#define IMAGE_COMMAND3_SMALL 64
#define IMAGE_COMMAND3_SMALL_HOVER 65
#define IMAGE_COMMAND3_LARGE_HC 66
#define IMAGE_COMMAND3_LARGE_HOVER_HC 67
#define IMAGE_COMMAND3_MEDIUM_HC 68
#define IMAGE_COMMAND3_MEDIUM_HOVER_HC 69
#define IMAGE_COMMAND3_SMALL_HC 70
#define IMAGE_COMMAND3_SMALL_HOVER_HC 71
#define IMAGE_BUTTONBAR_LARGE 80
#define IMAGE_BUTTONBAR_LARGE_HC 81
#define IMAGE_BUTTONBAR_MEDIUM 82
#define IMAGE_BUTTONBAR_MEDIUM_HC 83
#define IMAGE_BUTTONBAR_SMALL 84
#define IMAGE_BUTTONBAR_SMALL_HC 85
#define IMAGE_SHADOW 90
#define IMAGE_INSERT_SHADOW 91
#define IMAGE_HIDE_SLIDE_OVERLAY 92
......
......@@ -46,16 +46,6 @@ class Properties;
namespace sd { namespace slidesorter { namespace view {
const int Theme_ButtonCornerRadius = 3;
const int Theme_ButtonMaxAlpha = 0;
const int Theme_ButtonBarMaxAlpha = 0;
const int Theme_ButtonPaintType = 1;
const int Theme_ButtonBorder = 4;
const int Theme_ButtonGap = 0;
const int Theme_ButtonFadeInDelay = 800;
const int Theme_ButtonFadeInDuration = 100;
const int Theme_ButtonFadeOutDelay = 0;
const int Theme_ButtonFadeOutDuration = 100;
const int Theme_ToolTipDelay = 1000;
const int Theme_FocusIndicatorWidth = 3;
......@@ -104,7 +94,6 @@ public:
Gradient_MouseOverPage,
Gradient_MouseOverSelectedAndFocusedPage,
Gradient_FocusedPage,
Gradient_ButtonBackground,
_GradientColorType_Size_
};
enum GradientColorClass {
......@@ -133,39 +122,11 @@ public:
Icon_RawInsertShadow,
Icon_HideSlideOverlay,
Icon_FocusBorder,
Icon_ButtonBarLarge,
Icon_ButtonBarMedium,
Icon_ButtonBarSmall,
Icon_Command1Large,
Icon_Command1LargeHover,
Icon_Command1Medium,
Icon_Command1MediumHover,
Icon_Command1Small,
Icon_Command1SmallHover,
Icon_Command2Large,
Icon_Command2LargeHover,
Icon_Command2Medium,
Icon_Command2MediumHover,
Icon_Command2Small,
Icon_Command2SmallHover,
Icon_Command2BLarge,
Icon_Command2BLargeHover,
Icon_Command2BMedium,
Icon_Command2BMediumHover,
Icon_Command2BSmall,
Icon_Command2BSmallHover,
Icon_Command3Large,
Icon_Command3LargeHover,
Icon_Command3Medium,
Icon_Command3MediumHover,
Icon_Command3Small,
Icon_Command3SmallHover,
_IconType_Size_
};
const BitmapEx& GetIcon (const IconType eType);
private:
bool mbIsHighContrastMode;
class GradientDescriptor
{
public:
......
......@@ -38,10 +38,7 @@ VisualState::VisualState (const sal_Int32 nPageId)
meOldVisualState(VS_None),
mnStateAnimationId(controller::Animator::NotAnAnimationId),
maLocationOffset(0,0),
mnLocationAnimationId(controller::Animator::NotAnAnimationId),
mnButtonAlpha(1.0),
mnButtonBarAlpha(1.0),
mnButtonAlphaAnimationId(controller::Animator::NotAnAnimationId)
mnLocationAnimationId(controller::Animator::NotAnAnimationId)
{
}
......@@ -104,42 +101,6 @@ bool VisualState::SetLocationOffset (const Point& rOffset)
}
double VisualState::GetButtonAlpha (void) const
{
return mnButtonAlpha;
}
void VisualState::SetButtonAlpha (const double nAlpha)
{
mnButtonAlpha = nAlpha;
}
double VisualState::GetButtonBarAlpha (void) const
{
return mnButtonBarAlpha;
}
void VisualState::SetButtonBarAlpha (const double nAlpha)
{
mnButtonBarAlpha = nAlpha;
}
sal_Int32 VisualState::GetButtonAlphaAnimationId (void) const
{
return mnButtonAlphaAnimationId;
}
void VisualState::SetButtonAlphaAnimationId (const sal_Int32 nAnimationId)
{
mnButtonAlphaAnimationId = nAnimationId;
}
} } } // end of namespace ::sd::slidesorter::model
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -39,7 +39,6 @@
#include "view/SlsPageObjectLayouter.hxx"
#include "view/SlsPageObjectPainter.hxx"
#include "view/SlsILayerPainter.hxx"
#include "view/SlsButtonBar.hxx"
#include "view/SlsToolTip.hxx"
#include "controller/SlideSorterController.hxx"
#include "controller/SlsProperties.hxx"
......@@ -167,7 +166,6 @@ SlideSorterView::SlideSorterView (SlideSorter& rSlideSorter)
mpSelectionPainter(),
mpBackgroundPainter(
new BackgroundPainter(mrSlideSorter.GetTheme()->GetColor(Theme::Color_Background))),
mpButtonBar(new ButtonBar(mrSlideSorter)),
mpToolTip(new ToolTip(mrSlideSorter)),
mbIsRearrangePending(true),
maVisibilityChangeListeners()
......@@ -223,7 +221,7 @@ void SlideSorterView::Dispose (void)
mpLayeredDevice->Dispose();
mpPreviewCache.reset();
SetPageUnderMouse(SharedPageDescriptor(),false);
SetPageUnderMouse(SharedPageDescriptor());
// Hide the page to avoid problems in the view when deleting
// visualized objects
......@@ -342,9 +340,6 @@ void SlideSorterView::HandleDataChangeEvent (void)
if (pPainter)
pPainter->SetColor(mrSlideSorter.GetTheme()->GetColor(Theme::Color_Background));
if (mpButtonBar)
mpButtonBar->HandleDataChangeEvent();
RequestRepaint();
}
......@@ -395,7 +390,7 @@ void SlideSorterView::Rearrange (void)
{
mbIsRearrangePending = false;
Layout();
UpdatePageUnderMouse(false);
UpdatePageUnderMouse();
// RequestRepaint();
}
}
......@@ -577,7 +572,7 @@ void SlideSorterView::DeterminePageObjectVisibilities (void)
// Restore the mouse over state.
UpdatePageUnderMouse(true);
UpdatePageUnderMouse();
}
}
......@@ -870,15 +865,6 @@ void SlideSorterView::RemoveVisibilityChangeListener(const Link&rListener)
ButtonBar& SlideSorterView::GetButtonBar (void) const
{
OSL_ASSERT(mpButtonBar);
return *mpButtonBar;
}
ToolTip& SlideSorterView::GetToolTip (void) const
{
OSL_ASSERT(mpToolTip);
......@@ -900,7 +886,7 @@ void SlideSorterView::Notify (SfxBroadcaster& rBroadcaster, const SfxHint& rHint
void SlideSorterView::UpdatePageUnderMouse (bool bAnimate)
void SlideSorterView::UpdatePageUnderMouse ()
{
::boost::shared_ptr<ScrollBar> pVScrollBar (mrSlideSorter.GetVerticalScrollBar());
::boost::shared_ptr<ScrollBar> pHScrollBar (mrSlideSorter.GetHorizontalScrollBar());
......@@ -909,7 +895,7 @@ void SlideSorterView::UpdatePageUnderMouse (bool bAnimate)
{
// One of the scroll bars is tracking mouse movement. Do not
// highlight the slide under the mouse in this case.
SetPageUnderMouse(SharedPageDescriptor(),false);
SetPageUnderMouse(SharedPageDescriptor());
return;
}
......@@ -920,81 +906,38 @@ void SlideSorterView::UpdatePageUnderMouse (bool bAnimate)
const Rectangle aWindowBox (pWindow->GetPosPixel(), pWindow->GetSizePixel());
if (aWindowBox.IsInside(aPointerState.maPos))
{
UpdatePageUnderMouse (
aPointerState.maPos,
(aPointerState.mnState & MOUSE_LEFT)!=0,
bAnimate);
UpdatePageUnderMouse(aPointerState.maPos);
return;
}
}
SetPageUnderMouse(SharedPageDescriptor(),false);
SetPageUnderMouse(SharedPageDescriptor());
}
void SlideSorterView::UpdatePageUnderMouse (
const Point& rMousePosition,
const bool bIsMouseButtonDown,
const bool bAnimate)
const Point& rMousePosition)
{
UpdatePageUnderMouse(
mrSlideSorter.GetController().GetPageAt(rMousePosition),
rMousePosition,
bIsMouseButtonDown,
bAnimate);
}
void SlideSorterView::UpdatePageUnderMouse (
const model::SharedPageDescriptor& rpDescriptor,
const Point& rMousePosition,
const bool bIsMouseButtonDown,
const bool bAnimate)
{
// Update the page under the mouse.
SetPageUnderMouse(rpDescriptor, bAnimate);
// Tell the button bar about the new mouse position.
SharedSdWindow pWindow (mrSlideSorter.GetContentWindow());
const Point aMouseModelPosition (pWindow->PixelToLogic(rMousePosition));
::boost::shared_ptr<ViewShell> pMainViewShell (mrSlideSorter.GetViewShellBase()->GetMainViewShell());
if (pMainViewShell
&& pMainViewShell->GetShellType()!=ViewShell::ST_DRAW)
{
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();
}
}
SetPageUnderMouse(mrSlideSorter.GetController().GetPageAt(rMousePosition));
}
void SlideSorterView::SetPageUnderMouse (
const model::SharedPageDescriptor& rpDescriptor,
const bool bAnimate)
const model::SharedPageDescriptor& rpDescriptor)
{
if (mpPageUnderMouse != rpDescriptor)
{
if (mpPageUnderMouse)
SetState(mpPageUnderMouse, PageDescriptor::ST_MouseOver, false, bAnimate);
SetState(mpPageUnderMouse, PageDescriptor::ST_MouseOver, false);
mpPageUnderMouse = rpDescriptor;
if (mpPageUnderMouse)
SetState(mpPageUnderMouse, PageDescriptor::ST_MouseOver, true, bAnimate);
SetState(mpPageUnderMouse, PageDescriptor::ST_MouseOver, true);
// Change the quick help text to display the name of the page under
// the mouse.
......@@ -1008,8 +951,7 @@ void SlideSorterView::SetPageUnderMouse (
bool SlideSorterView::SetState (
const model::SharedPageDescriptor& rpDescriptor,
const PageDescriptor::State eState,
const bool bStateValue,
const bool bAnimate)
const bool bStateValue)
{
model::SharedPageDescriptor pDescriptor (rpDescriptor);
if ( ! pDescriptor)
......@@ -1029,20 +971,6 @@ bool SlideSorterView::SetState (
RequestRepaint(pDescriptor);
}
::boost::shared_ptr<ViewShell> pMainViewShell(mrSlideSorter.GetViewShellBase()->GetMainViewShell());
if (pMainViewShell
&& pMainViewShell->GetShellType()!=ViewShell::ST_DRAW)
{
// Fade in or out the buttons.
if (eState == PageDescriptor::ST_MouseOver)
{
if (bStateValue)
GetButtonBar().RequestFadeIn(rpDescriptor, bAnimate);
else
GetButtonBar().RequestFadeOut(rpDescriptor, bAnimate);
}
}
return bModified;
}
......
......@@ -34,7 +34,6 @@
#include "view/SlsPageObjectLayouter.hxx"
#include "view/SlsLayouter.hxx"
#include "view/SlsTheme.hxx"
#include "view/SlsButtonBar.hxx"
#include "SlsFramePainter.hxx"
#include "cache/SlsPageCache.hxx"
#include "controller/SlsProperties.hxx"
......@@ -67,7 +66,6 @@ PageObjectPainter::PageObjectPainter (
maFocusedSelectionBackground(),
maMouseOverBackground(),
maMouseOverFocusedBackground(),
mrButtonBar(rSlideSorter.GetView().GetButtonBar()),
maSize()
{
// Replace the color (not the alpha values) in the focus border with a
......@@ -111,7 +109,6 @@ void PageObjectPainter::PaintPageObject (
PaintPreview(rDevice, rpDescriptor);
PaintPageNumber(rDevice, rpDescriptor);
PaintTransitionEffect(rDevice, rpDescriptor);
mrButtonBar.Paint(rDevice, rpDescriptor);
rDevice.SetAntialiasing(nSavedAntialiasingMode);
}
......
......@@ -29,238 +29,6 @@
Resource RID_SLIDESORTER_ICONS
{
Image IMAGE_COMMAND1_LARGE
{
ImageBitmap = Bitmap { File = "slide_sorter_command1_large.png" ; };
};
Image IMAGE_COMMAND1_LARGE_HOVER
{
ImageBitmap = Bitmap { File = "slide_sorter_command1_large_hover.png" ; };
};
Image IMAGE_COMMAND1_MEDIUM
{
ImageBitmap = Bitmap { File = "slide_sorter_command1_medium.png" ; };
};
Image IMAGE_COMMAND1_MEDIUM_HOVER
{
ImageBitmap = Bitmap { File = "slide_sorter_command1_medium_hover.png" ; };
};
Image IMAGE_COMMAND1_SMALL
{
ImageBitmap = Bitmap { File = "slide_sorter_command1_small.png" ; };
};
Image IMAGE_COMMAND1_SMALL_HOVER
{
ImageBitmap = Bitmap { File = "slide_sorter_command1_small_hover.png" ; };
};
Image IMAGE_COMMAND1_LARGE_HC
{
ImageBitmap = Bitmap { File = "slide_sorter_command1_large_hc.png" ; };
};
Image IMAGE_COMMAND1_LARGE_HOVER_HC
{
ImageBitmap = Bitmap { File = "slide_sorter_command1_large_hover_hc.png" ; };
};
Image IMAGE_COMMAND1_MEDIUM_HC
{
ImageBitmap = Bitmap { File = "slide_sorter_command1_medium_hc.png" ; };
};
Image IMAGE_COMMAND1_MEDIUM_HOVER_HC
{
ImageBitmap = Bitmap { File = "slide_sorter_command1_medium_hover_hc.png" ; };
};
Image IMAGE_COMMAND1_SMALL_HC
{
ImageBitmap = Bitmap { File = "slide_sorter_command1_small_hc.png" ; };
};
Image IMAGE_COMMAND1_SMALL_HOVER_HC
{
ImageBitmap = Bitmap { File = "slide_sorter_command1_small_hover_hc.png" ; };
};
Image IMAGE_COMMAND2_LARGE
{
ImageBitmap = Bitmap { File = "slide_sorter_command2_large.png" ; };
};
Image IMAGE_COMMAND2_LARGE_HOVER
{
ImageBitmap = Bitmap { File = "slide_sorter_command2_large_hover.png" ; };
};
Image IMAGE_COMMAND2_MEDIUM
{
ImageBitmap = Bitmap { File = "slide_sorter_command2_medium.png" ; };
};
Image IMAGE_COMMAND2_MEDIUM_HOVER
{
ImageBitmap = Bitmap { File = "slide_sorter_command2_medium_hover.png" ; };
};
Image IMAGE_COMMAND2_SMALL
{
ImageBitmap = Bitmap { File = "slide_sorter_command2_small.png" ; };
};
Image IMAGE_COMMAND2_SMALL_HOVER
{
ImageBitmap = Bitmap { File = "slide_sorter_command2_small_hover.png" ; };
};
Image IMAGE_COMMAND2_LARGE_HC
{
ImageBitmap = Bitmap { File = "slide_sorter_command2_large_hc.png" ; };
};
Image IMAGE_COMMAND2_LARGE_HOVER_HC
{
ImageBitmap = Bitmap { File = "slide_sorter_command2_large_hover_hc.png" ; };
};
Image IMAGE_COMMAND2_MEDIUM_HC
{
ImageBitmap = Bitmap { File = "slide_sorter_command2_medium_hc.png" ; };
};
Image IMAGE_COMMAND2_MEDIUM_HOVER_HC
{
ImageBitmap = Bitmap { File = "slide_sorter_command2_medium_hover_hc.png" ; };
};
Image IMAGE_COMMAND2_SMALL_HC
{
ImageBitmap = Bitmap { File = "slide_sorter_command2_small_hc.png" ; };
};
Image IMAGE_COMMAND2_SMALL_HOVER_HC
{
ImageBitmap = Bitmap { File = "slide_sorter_command2_small_hover_hc.png" ; };
};
Image IMAGE_COMMAND2B_LARGE
{
ImageBitmap = Bitmap { File = "slide_sorter_command2b_large.png" ; };
};
Image IMAGE_COMMAND2B_LARGE_HOVER
{
ImageBitmap = Bitmap { File = "slide_sorter_command2b_large_hover.png" ; };
};
Image IMAGE_COMMAND2B_MEDIUM
{
ImageBitmap = Bitmap { File = "slide_sorter_command2b_medium.png" ; };
};
Image IMAGE_COMMAND2B_MEDIUM_HOVER
{
ImageBitmap = Bitmap { File = "slide_sorter_command2b_medium_hover.png" ; };
};
Image IMAGE_COMMAND2B_SMALL
{
ImageBitmap = Bitmap { File = "slide_sorter_command2b_small.png" ; };
};
Image IMAGE_COMMAND2B_SMALL_HOVER
{
ImageBitmap = Bitmap { File = "slide_sorter_command2b_small_hover.png" ; };
};
Image IMAGE_COMMAND2B_LARGE_HC
{
ImageBitmap = Bitmap { File = "slide_sorter_command2b_large_hc.png" ; };
};
Image IMAGE_COMMAND2B_LARGE_HOVER_HC
{
ImageBitmap = Bitmap { File = "slide_sorter_command2b_large_hover_hc.png" ; };
};
Image IMAGE_COMMAND2B_MEDIUM_HC
{
ImageBitmap = Bitmap { File = "slide_sorter_command2b_medium_hc.png" ; };
};
Image IMAGE_COMMAND2B_MEDIUM_HOVER_HC
{
ImageBitmap = Bitmap { File = "slide_sorter_command2b_medium_hover_hc.png" ; };
};
Image IMAGE_COMMAND2B_SMALL_HC
{
ImageBitmap = Bitmap { File = "slide_sorter_command2b_small_hc.png" ; };
};
Image IMAGE_COMMAND2B_SMALL_HOVER_HC
{
ImageBitmap = Bitmap { File = "slide_sorter_command2b_small_hover_hc.png" ; };
};
Image IMAGE_COMMAND3_LARGE
{
ImageBitmap = Bitmap { File = "slide_sorter_command3_large.png" ; };
};
Image IMAGE_COMMAND3_LARGE_HOVER
{
ImageBitmap = Bitmap { File = "slide_sorter_command3_large_hover.png" ; };
};
Image IMAGE_COMMAND3_MEDIUM
{
ImageBitmap = Bitmap { File = "slide_sorter_command3_medium.png" ; };
};
Image IMAGE_COMMAND3_MEDIUM_HOVER
{
ImageBitmap = Bitmap { File = "slide_sorter_command3_medium_hover.png" ; };
};
Image IMAGE_COMMAND3_SMALL
{
ImageBitmap = Bitmap { File = "slide_sorter_command3_small.png" ; };
};
Image IMAGE_COMMAND3_SMALL_HOVER
{
ImageBitmap = Bitmap { File = "slide_sorter_command3_small_hover.png" ; };
};
Image IMAGE_COMMAND3_LARGE_HC
{
ImageBitmap = Bitmap { File = "slide_sorter_command3_large_hc.png" ; };
};
Image IMAGE_COMMAND3_LARGE_HOVER_HC
{
ImageBitmap = Bitmap { File = "slide_sorter_command3_large_hover_hc.png" ; };
};
Image IMAGE_COMMAND3_MEDIUM_HC
{
ImageBitmap = Bitmap { File = "slide_sorter_command3_medium_hc.png" ; };
};
Image IMAGE_COMMAND3_MEDIUM_HOVER_HC
{
ImageBitmap = Bitmap { File = "slide_sorter_command3_medium_hover_hc.png" ; };
};
Image IMAGE_COMMAND3_SMALL_HC
{
ImageBitmap = Bitmap { File = "slide_sorter_command3_small_hc.png" ; };
};
Image IMAGE_COMMAND3_SMALL_HOVER_HC
{
ImageBitmap = Bitmap { File = "slide_sorter_command3_small_hover_hc.png" ; };
};
Image IMAGE_BUTTONBAR_LARGE
{
ImageBitmap = Bitmap { File = "slide_sorter_command_background_large.png" ; };
};
Image IMAGE_BUTTONBAR_MEDIUM
{
ImageBitmap = Bitmap { File = "slide_sorter_command_background_medium.png" ; };
};
Image IMAGE_BUTTONBAR_SMALL
{
ImageBitmap = Bitmap { File = "slide_sorter_command_background_small.png" ; };
};
Image IMAGE_BUTTONBAR_LARGE_HC
{
ImageBitmap = Bitmap { File = "slide_sorter_command_background_large_hc.png" ; };
};
Image IMAGE_BUTTONBAR_MEDIUM_HC
{
ImageBitmap = Bitmap { File = "slide_sorter_command_background_medium_hc.png" ; };
};
Image IMAGE_BUTTONBAR_SMALL_HC
{
ImageBitmap = Bitmap { File = "slide_sorter_command_background_small_hc.png" ; };
};
Image IMAGE_SHADOW
{
ImageBitmap = Bitmap { File = "slide_sorter_shadow.png" ; };
......
......@@ -73,8 +73,7 @@ ColorData HGBAdapt (
Theme::Theme (const ::boost::shared_ptr<controller::Properties>& rpProperties)
: mbIsHighContrastMode(false),
maBackgroundColor(rpProperties->GetBackgroundColor().GetColor()),
: maBackgroundColor(rpProperties->GetBackgroundColor().GetColor()),
maPageBackgroundColor(COL_WHITE),
maGradients(),
maIcons(),
......@@ -101,9 +100,6 @@ Theme::Theme (const ::boost::shared_ptr<controller::Properties>& rpProperties)
void Theme::Update (const ::boost::shared_ptr<controller::Properties>& rpProperties)
{
const bool bSavedHighContrastMode (mbIsHighContrastMode);
mbIsHighContrastMode = rpProperties->IsHighContrastModeActive();
// Set up colors.
maBackgroundColor = rpProperties->GetBackgroundColor().GetColor();
maPageBackgroundColor = svtools::ColorConfig().GetColorValue(svtools::DOCCOLOR).nColor;
......@@ -127,7 +123,6 @@ void Theme::Update (const ::boost::shared_ptr<controller::Properties>& rpPropert
SetGradient(Gradient_MouseOverSelectedAndFocusedPage, aSelectionColor, 75, 75, +100,+100, -50,-75);
SetGradient(Gradient_FocusedPage, aSelectionColor, -1,-1, 0,0, -50,-75);
SetGradient(Gradient_ButtonBackground, Black, -1,-1, 0,0, 0,0);
SetGradient(Gradient_NormalPage, maBackgroundColor, -1,-1, 0,0, 0,0);
// The focused gradient needs special handling because its fill color is
......@@ -136,87 +131,14 @@ void Theme::Update (const ::boost::shared_ptr<controller::Properties>& rpPropert
GetGradient(Gradient_FocusedPage).maFillColor2 = GetGradient(Gradient_NormalPage).maFillColor2;
// Set up icons.
if (bSavedHighContrastMode != mbIsHighContrastMode || maIcons.empty())
if (maIcons.empty())
{
LocalResource aResource (RID_SLIDESORTER_ICONS);
maIcons.resize(_IconType_Size_);
if (mbIsHighContrastMode)
{
InitializeIcon(Icon_RawShadow, IMAGE_SHADOW);
InitializeIcon(Icon_RawInsertShadow, IMAGE_INSERT_SHADOW);
InitializeIcon(Icon_HideSlideOverlay, IMAGE_HIDE_SLIDE_OVERLAY);
InitializeIcon(Icon_ButtonBarLarge, IMAGE_BUTTONBAR_LARGE_HC);
InitializeIcon(Icon_ButtonBarMedium, IMAGE_BUTTONBAR_MEDIUM_HC);
InitializeIcon(Icon_ButtonBarSmall, IMAGE_BUTTONBAR_SMALL_HC);
InitializeIcon(Icon_Command1Large, IMAGE_COMMAND1_LARGE_HC);
InitializeIcon(Icon_Command1LargeHover, IMAGE_COMMAND1_LARGE_HOVER_HC);
InitializeIcon(Icon_Command1Medium, IMAGE_COMMAND1_MEDIUM_HC);
InitializeIcon(Icon_Command1MediumHover, IMAGE_COMMAND1_MEDIUM_HOVER_HC);
InitializeIcon(Icon_Command1Small, IMAGE_COMMAND1_SMALL_HC);
InitializeIcon(Icon_Command1SmallHover, IMAGE_COMMAND1_SMALL_HOVER_HC);
InitializeIcon(Icon_Command2Large, IMAGE_COMMAND2_LARGE_HC);
InitializeIcon(Icon_Command2LargeHover, IMAGE_COMMAND2_LARGE_HOVER_HC);
InitializeIcon(Icon_Command2Medium, IMAGE_COMMAND2_MEDIUM_HC);
InitializeIcon(Icon_Command2MediumHover, IMAGE_COMMAND2_MEDIUM_HOVER_HC);
InitializeIcon(Icon_Command2Small, IMAGE_COMMAND2_SMALL_HC);
InitializeIcon(Icon_Command2SmallHover, IMAGE_COMMAND2_SMALL_HOVER_HC);
InitializeIcon(Icon_Command2BLarge, IMAGE_COMMAND2B_LARGE_HC);
InitializeIcon(Icon_Command2BLargeHover, IMAGE_COMMAND2B_LARGE_HOVER_HC);
InitializeIcon(Icon_Command2BMedium, IMAGE_COMMAND2B_MEDIUM_HC);
InitializeIcon(Icon_Command2BMediumHover, IMAGE_COMMAND2B_MEDIUM_HOVER_HC);
InitializeIcon(Icon_Command2BSmall, IMAGE_COMMAND2B_SMALL_HC);
InitializeIcon(Icon_Command2BSmallHover, IMAGE_COMMAND2B_SMALL_HOVER_HC);
InitializeIcon(Icon_Command3Large, IMAGE_COMMAND3_LARGE_HC);
InitializeIcon(Icon_Command3LargeHover, IMAGE_COMMAND3_LARGE_HOVER_HC);
InitializeIcon(Icon_Command3Medium, IMAGE_COMMAND3_SMALL_HC);
InitializeIcon(Icon_Command3MediumHover, IMAGE_COMMAND3_SMALL_HOVER_HC);
InitializeIcon(Icon_Command3Small, IMAGE_COMMAND3_SMALL_HC);
InitializeIcon(Icon_Command3SmallHover, IMAGE_COMMAND3_SMALL_HOVER_HC);
}
else
{
InitializeIcon(Icon_RawShadow, IMAGE_SHADOW);
InitializeIcon(Icon_RawInsertShadow, IMAGE_INSERT_SHADOW);
InitializeIcon(Icon_HideSlideOverlay, IMAGE_HIDE_SLIDE_OVERLAY);
InitializeIcon(Icon_ButtonBarLarge, IMAGE_BUTTONBAR_LARGE);
InitializeIcon(Icon_ButtonBarMedium, IMAGE_BUTTONBAR_MEDIUM);
InitializeIcon(Icon_ButtonBarSmall, IMAGE_BUTTONBAR_SMALL);
InitializeIcon(Icon_Command1Large, IMAGE_COMMAND1_LARGE);
InitializeIcon(Icon_Command1LargeHover, IMAGE_COMMAND1_LARGE_HOVER);
InitializeIcon(Icon_Command1Medium, IMAGE_COMMAND1_MEDIUM);
InitializeIcon(Icon_Command1MediumHover, IMAGE_COMMAND1_MEDIUM_HOVER);
InitializeIcon(Icon_Command1Small, IMAGE_COMMAND1_SMALL);
InitializeIcon(Icon_Command1SmallHover, IMAGE_COMMAND1_SMALL_HOVER);
InitializeIcon(Icon_Command2Large, IMAGE_COMMAND2_LARGE);
InitializeIcon(Icon_Command2LargeHover, IMAGE_COMMAND2_LARGE_HOVER);
InitializeIcon(Icon_Command2Medium, IMAGE_COMMAND2_MEDIUM);
InitializeIcon(Icon_Command2MediumHover, IMAGE_COMMAND2_MEDIUM_HOVER);
InitializeIcon(Icon_Command2Small, IMAGE_COMMAND2_SMALL);
InitializeIcon(Icon_Command2SmallHover, IMAGE_COMMAND2_SMALL_HOVER);
InitializeIcon(Icon_Command2BLarge, IMAGE_COMMAND2B_LARGE);
InitializeIcon(Icon_Command2BLargeHover, IMAGE_COMMAND2B_LARGE_HOVER);
InitializeIcon(Icon_Command2BMedium, IMAGE_COMMAND2B_MEDIUM);
InitializeIcon(Icon_Command2BMediumHover, IMAGE_COMMAND2B_MEDIUM_HOVER);
InitializeIcon(Icon_Command2BSmall, IMAGE_COMMAND2B_SMALL);
InitializeIcon(Icon_Command2BSmallHover, IMAGE_COMMAND2B_SMALL_HOVER);
InitializeIcon(Icon_Command3Large, IMAGE_COMMAND3_LARGE);
InitializeIcon(Icon_Command3LargeHover, IMAGE_COMMAND3_LARGE_HOVER);
InitializeIcon(Icon_Command3Medium, IMAGE_COMMAND3_MEDIUM);
InitializeIcon(Icon_Command3MediumHover, IMAGE_COMMAND3_MEDIUM_HOVER);
InitializeIcon(Icon_Command3Small, IMAGE_COMMAND3_SMALL);
InitializeIcon(Icon_Command3SmallHover, IMAGE_COMMAND3_SMALL_HOVER);
}
InitializeIcon(Icon_RawShadow, IMAGE_SHADOW);
InitializeIcon(Icon_RawInsertShadow, IMAGE_INSERT_SHADOW);
InitializeIcon(Icon_HideSlideOverlay, IMAGE_HIDE_SLIDE_OVERLAY);
InitializeIcon(Icon_FocusBorder, IMAGE_FOCUS_BORDER);
}
}
......
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