renaissance1: #i107215# Some minor fixes and improvements.
This commit is contained in:
@@ -393,6 +393,12 @@ void PaneDockingWindow::MouseButtonDown (const MouseEvent& rEvent)
|
|||||||
{
|
{
|
||||||
if (rEvent.GetButtons() == MOUSE_LEFT && mpContentWindow)
|
if (rEvent.GetButtons() == MOUSE_LEFT && mpContentWindow)
|
||||||
{
|
{
|
||||||
|
// For some strange reason we have to set the WB_DIALOGCONTROL at
|
||||||
|
// the content window in order to have it pass focus to its content
|
||||||
|
// window. Without setting this flag here that works only on views
|
||||||
|
// that have not been taken from the cash and relocated to this pane
|
||||||
|
// docking window.
|
||||||
|
mpContentWindow->SetStyle(mpContentWindow->GetStyle() | WB_DIALOGCONTROL);
|
||||||
mpContentWindow->GrabFocus();
|
mpContentWindow->GrabFocus();
|
||||||
}
|
}
|
||||||
SfxDockingWindow::MouseButtonDown(rEvent);
|
SfxDockingWindow::MouseButtonDown(rEvent);
|
||||||
|
@@ -113,9 +113,6 @@ public:
|
|||||||
virtual void SetZoom (long int nZoom);
|
virtual void SetZoom (long int nZoom);
|
||||||
virtual void SetZoomRect (const Rectangle& rZoomRect);
|
virtual void SetZoomRect (const Rectangle& rZoomRect);
|
||||||
|
|
||||||
/// forward VCLs PrePaint window event to DrawingLayer
|
|
||||||
virtual void PrePaint();
|
|
||||||
|
|
||||||
/** This is a callback method used by the active window to delegate its
|
/** This is a callback method used by the active window to delegate its
|
||||||
Paint() call to. This view shell itself delegates it to the view.
|
Paint() call to. This view shell itself delegates it to the view.
|
||||||
*/
|
*/
|
||||||
|
@@ -54,6 +54,7 @@
|
|||||||
#include "view/SlsPageObjectLayouter.hxx"
|
#include "view/SlsPageObjectLayouter.hxx"
|
||||||
#include "view/SlsPageObjectPainter.hxx"
|
#include "view/SlsPageObjectPainter.hxx"
|
||||||
#include "view/SlsTheme.hxx"
|
#include "view/SlsTheme.hxx"
|
||||||
|
#include "view/SlsToolTip.hxx"
|
||||||
#include "cache/SlsPageCache.hxx"
|
#include "cache/SlsPageCache.hxx"
|
||||||
#include "cache/SlsPageCacheManager.hxx"
|
#include "cache/SlsPageCacheManager.hxx"
|
||||||
|
|
||||||
@@ -143,8 +144,6 @@ SlideSorterController::SlideSorterController (SlideSorter& rSlideSorter)
|
|||||||
|
|
||||||
// Connect the view with the window that has been created by our base
|
// Connect the view with the window that has been created by our base
|
||||||
// class.
|
// class.
|
||||||
// mrView.AddWindowToPaintView(pWindow.get());
|
|
||||||
// mrView.SetActualWin(pWindow.get());
|
|
||||||
pWindow->SetBackground(Wallpaper());
|
pWindow->SetBackground(Wallpaper());
|
||||||
pWindow->SetCenterAllowed(false);
|
pWindow->SetCenterAllowed(false);
|
||||||
pWindow->SetMapMode(MapMode(MAP_PIXEL));
|
pWindow->SetMapMode(MapMode(MAP_PIXEL));
|
||||||
@@ -328,15 +327,6 @@ ScrollBarManager& SlideSorterController::GetScrollBarManager (void)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
void SlideSorterController::PrePaint()
|
|
||||||
{
|
|
||||||
// forward VCLs PrePaint window event to DrawingLayer
|
|
||||||
//AF mrView.PrePaint();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void SlideSorterController::Paint (
|
void SlideSorterController::Paint (
|
||||||
const Rectangle& rBBox,
|
const Rectangle& rBBox,
|
||||||
::Window* pWindow)
|
::Window* pWindow)
|
||||||
@@ -451,22 +441,20 @@ bool SlideSorterController::Command (
|
|||||||
}
|
}
|
||||||
|
|
||||||
pWindow->ReleaseMouse();
|
pWindow->ReleaseMouse();
|
||||||
|
|
||||||
|
Point aMenuLocation (0,0);
|
||||||
if (rEvent.IsMouseEvent())
|
if (rEvent.IsMouseEvent())
|
||||||
{
|
{
|
||||||
mbIsContextMenuOpen = true;
|
// We have to explicitly specify the location of the menu
|
||||||
if (pViewShell != NULL)
|
// when the slide sorter is placed in an undocked child
|
||||||
{
|
// menu. But when it is docked it does not hurt, so we
|
||||||
SfxDispatcher* pDispatcher = pViewShell->GetDispatcher();
|
// specify the location always.
|
||||||
if (pDispatcher != NULL)
|
aMenuLocation = rEvent.GetMousePosPixel();
|
||||||
pDispatcher->ExecutePopup(SdResId(nPopupId));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// The event is not a mouse event. Use the center of the
|
// The event is not a mouse event. Use the center of the
|
||||||
// focused page as top left position of the context menu.
|
// focused page as top left position of the context menu.
|
||||||
if (pPage != NULL)
|
|
||||||
{
|
|
||||||
model::SharedPageDescriptor pDescriptor (
|
model::SharedPageDescriptor pDescriptor (
|
||||||
GetFocusManager().GetFocusedPageDescriptor());
|
GetFocusManager().GetFocusedPageDescriptor());
|
||||||
if (pDescriptor.get() != NULL)
|
if (pDescriptor.get() != NULL)
|
||||||
@@ -476,15 +464,19 @@ bool SlideSorterController::Command (
|
|||||||
pDescriptor,
|
pDescriptor,
|
||||||
PageObjectLayouter::PageObject,
|
PageObjectLayouter::PageObject,
|
||||||
PageObjectLayouter::ModelCoordinateSystem));
|
PageObjectLayouter::ModelCoordinateSystem));
|
||||||
Point aCenter (aBBox.Center());
|
aMenuLocation = aBBox.Center();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
mbIsContextMenuOpen = true;
|
mbIsContextMenuOpen = true;
|
||||||
if (pViewShell != NULL)
|
if (pViewShell != NULL)
|
||||||
pViewShell->GetViewFrame()->GetDispatcher()->ExecutePopup(
|
{
|
||||||
|
SfxDispatcher* pDispatcher = pViewShell->GetDispatcher();
|
||||||
|
if (pDispatcher != NULL)
|
||||||
|
pDispatcher->ExecutePopup(
|
||||||
SdResId(nPopupId),
|
SdResId(nPopupId),
|
||||||
pWindow,
|
pWindow,
|
||||||
&aCenter);
|
&aMenuLocation);
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
mbIsContextMenuOpen = false;
|
mbIsContextMenuOpen = false;
|
||||||
if (pPage == NULL)
|
if (pPage == NULL)
|
||||||
@@ -643,13 +635,21 @@ IMPL_LINK(SlideSorterController, WindowEventHandler, VclWindowEvent*, pEvent)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case VCLEVENT_WINDOW_GETFOCUS:
|
case VCLEVENT_WINDOW_GETFOCUS:
|
||||||
if (pActiveWindow && pWindow == pActiveWindow.get())
|
if (pActiveWindow)
|
||||||
|
if (pWindow == pActiveWindow.get())
|
||||||
GetFocusManager().ShowFocus(false);
|
GetFocusManager().ShowFocus(false);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case VCLEVENT_WINDOW_LOSEFOCUS:
|
case VCLEVENT_WINDOW_LOSEFOCUS:
|
||||||
if (pActiveWindow && pWindow == pActiveWindow.get())
|
if (pActiveWindow && pWindow == pActiveWindow.get())
|
||||||
|
{
|
||||||
GetFocusManager().HideFocus();
|
GetFocusManager().HideFocus();
|
||||||
|
mrView.GetToolTip().Hide();
|
||||||
|
|
||||||
|
// Select the current slide so that it is properly
|
||||||
|
// visualized when the focus is moved to the edit view.
|
||||||
|
GetPageSelector().SelectPage(GetCurrentSlideManager()->GetCurrentSlide());
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case VCLEVENT_APPLICATION_DATACHANGED:
|
case VCLEVENT_APPLICATION_DATACHANGED:
|
||||||
|
@@ -201,28 +201,34 @@ void PageSelector::SelectPage (const SharedPageDescriptor& rpDescriptor)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
void PageSelector::DeselectPage (int nPageIndex)
|
void PageSelector::DeselectPage (
|
||||||
|
int nPageIndex,
|
||||||
|
const bool bUpdateCurrentPage)
|
||||||
{
|
{
|
||||||
model::SharedPageDescriptor pDescriptor (mrModel.GetPageDescriptor(nPageIndex));
|
model::SharedPageDescriptor pDescriptor (mrModel.GetPageDescriptor(nPageIndex));
|
||||||
if (pDescriptor.get() != NULL)
|
if (pDescriptor.get() != NULL)
|
||||||
DeselectPage(pDescriptor);
|
DeselectPage(pDescriptor, bUpdateCurrentPage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void PageSelector::DeselectPage (const SdPage* pPage)
|
void PageSelector::DeselectPage (
|
||||||
|
const SdPage* pPage,
|
||||||
|
const bool bUpdateCurrentPage)
|
||||||
{
|
{
|
||||||
const sal_Int32 nPageIndex (mrModel.GetIndex(pPage));
|
const sal_Int32 nPageIndex (mrModel.GetIndex(pPage));
|
||||||
SharedPageDescriptor pDescriptor (mrModel.GetPageDescriptor(nPageIndex));
|
SharedPageDescriptor pDescriptor (mrModel.GetPageDescriptor(nPageIndex));
|
||||||
if (pDescriptor.get()!=NULL && pDescriptor->GetPage()==pPage)
|
if (pDescriptor.get()!=NULL && pDescriptor->GetPage()==pPage)
|
||||||
DeselectPage(pDescriptor);
|
DeselectPage(pDescriptor, bUpdateCurrentPage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void PageSelector::DeselectPage (const SharedPageDescriptor& rpDescriptor)
|
void PageSelector::DeselectPage (
|
||||||
|
const SharedPageDescriptor& rpDescriptor,
|
||||||
|
const bool bUpdateCurrentPage)
|
||||||
{
|
{
|
||||||
if (rpDescriptor.get()!=NULL
|
if (rpDescriptor.get()!=NULL
|
||||||
&& mrSlideSorter.GetView().SetState(rpDescriptor, PageDescriptor::ST_Selected, false))
|
&& mrSlideSorter.GetView().SetState(rpDescriptor, PageDescriptor::ST_Selected, false))
|
||||||
@@ -236,6 +242,7 @@ void PageSelector::DeselectPage (const SharedPageDescriptor& rpDescriptor)
|
|||||||
mbSelectionChangeBroadcastPending = true;
|
mbSelectionChangeBroadcastPending = true;
|
||||||
else
|
else
|
||||||
mrController.GetSelectionManager()->SelectionHasChanged();
|
mrController.GetSelectionManager()->SelectionHasChanged();
|
||||||
|
if (bUpdateCurrentPage)
|
||||||
UpdateCurrentPage();
|
UpdateCurrentPage();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -491,10 +491,8 @@ BOOL SelectionFunction::KeyInput (const KeyEvent& rEvent)
|
|||||||
model::SharedPageDescriptor pDescriptor (rFocusManager.GetFocusedPageDescriptor());
|
model::SharedPageDescriptor pDescriptor (rFocusManager.GetFocusedPageDescriptor());
|
||||||
if (pDescriptor && rCode.IsMod1())
|
if (pDescriptor && rCode.IsMod1())
|
||||||
{
|
{
|
||||||
// Doing a multi selection by default. Can we ask the event
|
|
||||||
// for the state of the shift key?
|
|
||||||
if (pDescriptor->HasState(model::PageDescriptor::ST_Selected))
|
if (pDescriptor->HasState(model::PageDescriptor::ST_Selected))
|
||||||
mrController.GetPageSelector().DeselectPage(pDescriptor);
|
mrController.GetPageSelector().DeselectPage(pDescriptor, false);
|
||||||
else
|
else
|
||||||
mrController.GetPageSelector().SelectPage(pDescriptor);
|
mrController.GetPageSelector().SelectPage(pDescriptor);
|
||||||
}
|
}
|
||||||
@@ -1340,10 +1338,15 @@ bool NormalModeHandler::ProcessButtonDownEvent (
|
|||||||
case BUTTON_DOWN | LEFT_BUTTON | SINGLE_CLICK | OVER_UNSELECTED_PAGE | OVER_BUTTON:
|
case BUTTON_DOWN | LEFT_BUTTON | SINGLE_CLICK | OVER_UNSELECTED_PAGE | OVER_BUTTON:
|
||||||
case BUTTON_DOWN | LEFT_BUTTON | SINGLE_CLICK | OVER_SELECTED_PAGE | OVER_BUTTON:
|
case BUTTON_DOWN | LEFT_BUTTON | SINGLE_CLICK | OVER_SELECTED_PAGE | OVER_BUTTON:
|
||||||
if (mrSlideSorter.GetView().GetButtonBar().IsMouseOverButton())
|
if (mrSlideSorter.GetView().GetButtonBar().IsMouseOverButton())
|
||||||
|
{
|
||||||
|
// Switch to button mode only when the buttons are visible
|
||||||
|
// (or being faded in.)
|
||||||
|
if (mrSlideSorter.GetView().GetButtonBar().IsVisible(rDescriptor.mpHitDescriptor))
|
||||||
{
|
{
|
||||||
mrSelectionFunction.SwitchToButtonMode();
|
mrSelectionFunction.SwitchToButtonMode();
|
||||||
ReprocessEvent(rDescriptor);
|
ReprocessEvent(rDescriptor);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// Right button for context menu.
|
// Right button for context menu.
|
||||||
|
@@ -304,69 +304,6 @@ void SelectionManager::RemoveSelectionChangeListener(const Link&rListener)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
bool SelectionManager::DoesSelectionExceedVisibleArea (const Rectangle& rSelectionBox) const
|
|
||||||
{
|
|
||||||
SharedSdWindow pWindow (mrSlideSorter.GetContentWindow());
|
|
||||||
if (pWindow == NULL)
|
|
||||||
return true;
|
|
||||||
|
|
||||||
Rectangle aVisibleArea (pWindow->PixelToLogic(
|
|
||||||
Rectangle(
|
|
||||||
Point(0,0),
|
|
||||||
pWindow->GetOutputSizePixel())));
|
|
||||||
if (mrSlideSorter.GetView().GetOrientation() != Layouter::HORIZONTAL)
|
|
||||||
return rSelectionBox.GetHeight() > aVisibleArea.GetHeight();
|
|
||||||
else
|
|
||||||
return rSelectionBox.GetWidth() > aVisibleArea.GetWidth();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Rectangle SelectionManager::ResolveLargeSelection (
|
|
||||||
const SharedPageDescriptor& rpFirst,
|
|
||||||
const SharedPageDescriptor& rpLast,
|
|
||||||
const SelectionHint eSelectionHint)
|
|
||||||
{
|
|
||||||
OSL_ASSERT(rpFirst.get()!=NULL);
|
|
||||||
OSL_ASSERT(rpLast.get()!=NULL);
|
|
||||||
|
|
||||||
// The mose recently selected page is assumed to lie in the range
|
|
||||||
// between first and last selected page. Therefore the bounding box is
|
|
||||||
// not modified.
|
|
||||||
model::SharedPageDescriptor pRecent (
|
|
||||||
mrController.GetPageSelector().GetMostRecentlySelectedPage());
|
|
||||||
|
|
||||||
// Get the bounding box of the page object on which to concentrate.
|
|
||||||
model::SharedPageDescriptor pRepresentative;
|
|
||||||
switch (eSelectionHint)
|
|
||||||
{
|
|
||||||
case SH_FIRST:
|
|
||||||
pRepresentative = rpFirst;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case SH_LAST:
|
|
||||||
pRepresentative = rpLast;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case SH_RECENT:
|
|
||||||
default:
|
|
||||||
if (pRecent.get() == NULL)
|
|
||||||
pRepresentative = rpFirst;
|
|
||||||
else
|
|
||||||
pRepresentative = pRecent;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
OSL_ASSERT(pRepresentative.get() != NULL);
|
|
||||||
|
|
||||||
return mrSlideSorter.GetView().GetLayouter().GetPageObjectBox(
|
|
||||||
pRepresentative->GetPageIndex(),
|
|
||||||
true);
|
|
||||||
}
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
sal_Int32 SelectionManager::GetInsertionPosition (void) const
|
sal_Int32 SelectionManager::GetInsertionPosition (void) const
|
||||||
|
@@ -134,9 +134,6 @@ public:
|
|||||||
::boost::shared_ptr<SelectionManager> GetSelectionManager (void) const;
|
::boost::shared_ptr<SelectionManager> GetSelectionManager (void) const;
|
||||||
::boost::shared_ptr<InsertionIndicatorHandler> GetInsertionIndicatorHandler (void) const;
|
::boost::shared_ptr<InsertionIndicatorHandler> GetInsertionIndicatorHandler (void) const;
|
||||||
|
|
||||||
// forward VCLs PrePaint window event to DrawingLayer
|
|
||||||
void PrePaint();
|
|
||||||
|
|
||||||
/** This method forwards the call to the SlideSorterView and executes
|
/** This method forwards the call to the SlideSorterView and executes
|
||||||
pending operations like moving selected pages into the visible area.
|
pending operations like moving selected pages into the visible area.
|
||||||
*/
|
*/
|
||||||
|
@@ -102,10 +102,19 @@ public:
|
|||||||
bool IsPageSelected (int nPageIndex);
|
bool IsPageSelected (int nPageIndex);
|
||||||
|
|
||||||
/** Deselect the descriptor that is associated with the given page.
|
/** Deselect the descriptor that is associated with the given page.
|
||||||
|
@param bUpdateCurrentPage
|
||||||
|
When <TRUE/> then the current page is updated to the first slide
|
||||||
|
of the remaining selection.
|
||||||
*/
|
*/
|
||||||
void DeselectPage (int nPageIndex);
|
void DeselectPage (
|
||||||
void DeselectPage (const SdPage* pPage);
|
int nPageIndex,
|
||||||
void DeselectPage (const model::SharedPageDescriptor& rpDescriptor);
|
const bool bUpdateCurrentPage = true);
|
||||||
|
void DeselectPage (
|
||||||
|
const SdPage* pPage,
|
||||||
|
const bool bUpdateCurrentPage = true);
|
||||||
|
void DeselectPage (
|
||||||
|
const model::SharedPageDescriptor& rpDescriptor,
|
||||||
|
const bool bUpdateCurrentPage = true);
|
||||||
|
|
||||||
/** This convenience method returns the same number of pages that
|
/** This convenience method returns the same number of pages that
|
||||||
SlideSorterModel.GetPageCount() returns. It is included here so
|
SlideSorterModel.GetPageCount() returns. It is included here so
|
||||||
|
@@ -132,6 +132,11 @@ public:
|
|||||||
const model::SharedPageDescriptor& rpDescriptor,
|
const model::SharedPageDescriptor& rpDescriptor,
|
||||||
const bool bAnimate);
|
const bool bAnimate);
|
||||||
|
|
||||||
|
/** Return whether the button bar is visible for the givn descriptor (or
|
||||||
|
being faded in.)
|
||||||
|
*/
|
||||||
|
bool IsVisible (const model::SharedPageDescriptor& rpDescriptor);
|
||||||
|
|
||||||
class BackgroundTheme;
|
class BackgroundTheme;
|
||||||
|
|
||||||
/** While at least one Lock object exists the button bar will not be
|
/** While at least one Lock object exists the button bar will not be
|
||||||
|
@@ -119,17 +119,20 @@ private:
|
|||||||
void PaintBorder (
|
void PaintBorder (
|
||||||
OutputDevice& rDevice,
|
OutputDevice& rDevice,
|
||||||
const Theme::GradientColorType eColorType,
|
const Theme::GradientColorType eColorType,
|
||||||
const Rectangle& rBox) const;
|
const Rectangle& rBox,
|
||||||
|
const int nBorderWidth) const;
|
||||||
Bitmap& GetBackgroundForState (
|
Bitmap& GetBackgroundForState (
|
||||||
const model::SharedPageDescriptor& rpDescriptor,
|
const model::SharedPageDescriptor& rpDescriptor,
|
||||||
const OutputDevice& rTemplateDevice);
|
const OutputDevice& rTemplateDevice);
|
||||||
Bitmap& GetBackground(
|
Bitmap& GetBackground(
|
||||||
Bitmap& rBackground,
|
Bitmap& rBackground,
|
||||||
Theme::GradientColorType eType,
|
Theme::GradientColorType eType,
|
||||||
const OutputDevice& rTemplateDevice);
|
const OutputDevice& rTemplateDevice,
|
||||||
|
const int nBorderWidth);
|
||||||
Bitmap CreateBackgroundBitmap(
|
Bitmap CreateBackgroundBitmap(
|
||||||
const OutputDevice& rReferenceDevice,
|
const OutputDevice& rReferenceDevice,
|
||||||
const Theme::GradientColorType eType) const;
|
const Theme::GradientColorType eType,
|
||||||
|
const int nBorderWidth) const;
|
||||||
Bitmap CreateMarkedPreview(
|
Bitmap CreateMarkedPreview(
|
||||||
const Size& rSize,
|
const Size& rSize,
|
||||||
const Bitmap& rPreview,
|
const Bitmap& rPreview,
|
||||||
|
@@ -412,7 +412,6 @@ void SlideSorter::ReleaseListeners (void)
|
|||||||
SharedSdWindow pWindow (GetContentWindow());
|
SharedSdWindow pWindow (GetContentWindow());
|
||||||
if (pWindow)
|
if (pWindow)
|
||||||
{
|
{
|
||||||
|
|
||||||
pWindow->RemoveEventListener(
|
pWindow->RemoveEventListener(
|
||||||
LINK(mpSlideSorterController.get(),
|
LINK(mpSlideSorterController.get(),
|
||||||
controller::SlideSorterController,
|
controller::SlideSorterController,
|
||||||
|
@@ -532,16 +532,6 @@ void SlideSorterViewShell::ExecStatusBar (SfxRequest& rRequest)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
void SlideSorterViewShell::PrePaint()
|
|
||||||
{
|
|
||||||
OSL_ASSERT(mpSlideSorter.get()!=NULL);
|
|
||||||
if (mpSlideSorter.get() != NULL)
|
|
||||||
mpSlideSorter->GetController().PrePaint();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void SlideSorterViewShell::Paint (
|
void SlideSorterViewShell::Paint (
|
||||||
const Rectangle& rBBox,
|
const Rectangle& rBBox,
|
||||||
::sd::Window* pWindow)
|
::sd::Window* pWindow)
|
||||||
|
@@ -668,6 +668,15 @@ void ButtonBar::RequestFadeOut (
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
bool ButtonBar::IsVisible (const model::SharedPageDescriptor& rpDescriptor)
|
||||||
|
{
|
||||||
|
const double nMaxAlpha (1);
|
||||||
|
return rpDescriptor && rpDescriptor->GetVisualState().GetButtonBarAlpha() < nMaxAlpha;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void ButtonBar::StartFadeAnimation (
|
void ButtonBar::StartFadeAnimation (
|
||||||
const model::SharedPageDescriptor& rpDescriptor,
|
const model::SharedPageDescriptor& rpDescriptor,
|
||||||
const double nTargetAlpha,
|
const double nTargetAlpha,
|
||||||
@@ -1466,6 +1475,4 @@ void DuplicateButton::ProcessClick (const model::SharedPageDescriptor& rpDescrip
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} } } // end of namespace ::sd::slidesorter::view
|
} } } // end of namespace ::sd::slidesorter::view
|
||||||
|
@@ -356,46 +356,62 @@ Bitmap& PageObjectPainter::GetBackgroundForState (
|
|||||||
const model::SharedPageDescriptor& rpDescriptor,
|
const model::SharedPageDescriptor& rpDescriptor,
|
||||||
const OutputDevice& rReferenceDevice)
|
const OutputDevice& rReferenceDevice)
|
||||||
{
|
{
|
||||||
const bool bIsSelected (rpDescriptor->HasState(model::PageDescriptor::ST_Selected));
|
enum State { None = 0x00, Selected = 0x01, MouseOver = 0x02, Focused = 0x04 };
|
||||||
const bool bIsMouseOver (rpDescriptor->HasState(model::PageDescriptor::ST_MouseOver));
|
const int nFocusedBorderWidth (2);
|
||||||
const bool bIsFocused (rpDescriptor->HasState(model::PageDescriptor::ST_Focused));
|
const int nNormalBorderWidth (1);
|
||||||
|
|
||||||
if (bIsMouseOver)
|
const State eState (State(
|
||||||
|
(rpDescriptor->HasState(model::PageDescriptor::ST_Selected) ? Selected : None)
|
||||||
|
| (rpDescriptor->HasState(model::PageDescriptor::ST_MouseOver) ? MouseOver : None)
|
||||||
|
| (rpDescriptor->HasState(model::PageDescriptor::ST_Focused) ? Focused : None)));
|
||||||
|
|
||||||
|
switch (eState)
|
||||||
{
|
{
|
||||||
if (bIsSelected && bIsFocused)
|
case MouseOver | Selected | Focused:
|
||||||
return GetBackground(
|
return GetBackground(
|
||||||
maMouseOverSelectedAndFocusedBackground,
|
maMouseOverSelectedAndFocusedBackground,
|
||||||
Theme::Gradient_MouseOverSelectedAndFocusedPage,
|
Theme::Gradient_MouseOverSelectedAndFocusedPage,
|
||||||
rReferenceDevice);
|
rReferenceDevice,
|
||||||
else
|
nFocusedBorderWidth);
|
||||||
|
|
||||||
|
case MouseOver | Selected:
|
||||||
|
case MouseOver | Focused:
|
||||||
|
case MouseOver:
|
||||||
return GetBackground(
|
return GetBackground(
|
||||||
maMouseOverBackground,
|
maMouseOverBackground,
|
||||||
Theme::Gradient_MouseOverPage,
|
Theme::Gradient_MouseOverPage,
|
||||||
rReferenceDevice);
|
rReferenceDevice,
|
||||||
}
|
(eState & Focused) ? nFocusedBorderWidth : nNormalBorderWidth);
|
||||||
else if (bIsSelected)
|
|
||||||
{
|
case Selected | Focused:
|
||||||
if (bIsFocused)
|
|
||||||
return GetBackground(
|
return GetBackground(
|
||||||
maFocusedSelectionBackground,
|
maFocusedSelectionBackground,
|
||||||
Theme::Gradient_SelectedAndFocusedPage,
|
Theme::Gradient_SelectedAndFocusedPage,
|
||||||
rReferenceDevice);
|
rReferenceDevice,
|
||||||
else
|
nFocusedBorderWidth);
|
||||||
|
|
||||||
|
case Selected:
|
||||||
return GetBackground(
|
return GetBackground(
|
||||||
maSelectionBackground,
|
maSelectionBackground,
|
||||||
Theme::Gradient_SelectedPage,
|
Theme::Gradient_SelectedPage,
|
||||||
rReferenceDevice);
|
rReferenceDevice,
|
||||||
}
|
nNormalBorderWidth);
|
||||||
else if (bIsFocused)
|
|
||||||
|
case Focused:
|
||||||
return GetBackground(
|
return GetBackground(
|
||||||
maFocusedBackground,
|
maFocusedBackground,
|
||||||
Theme::Gradient_FocusedPage,
|
Theme::Gradient_FocusedPage,
|
||||||
rReferenceDevice);
|
rReferenceDevice,
|
||||||
else
|
nFocusedBorderWidth);
|
||||||
|
|
||||||
|
case None:
|
||||||
|
default:
|
||||||
return GetBackground(
|
return GetBackground(
|
||||||
maNormalBackground,
|
maNormalBackground,
|
||||||
Theme::Gradient_NormalPage,
|
Theme::Gradient_NormalPage,
|
||||||
rReferenceDevice);
|
rReferenceDevice,
|
||||||
|
nNormalBorderWidth);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -404,10 +420,11 @@ Bitmap& PageObjectPainter::GetBackgroundForState (
|
|||||||
Bitmap& PageObjectPainter::GetBackground(
|
Bitmap& PageObjectPainter::GetBackground(
|
||||||
Bitmap& rBackground,
|
Bitmap& rBackground,
|
||||||
Theme::GradientColorType eType,
|
Theme::GradientColorType eType,
|
||||||
const OutputDevice& rReferenceDevice)
|
const OutputDevice& rReferenceDevice,
|
||||||
|
const int nBorderWidth)
|
||||||
{
|
{
|
||||||
if (rBackground.IsEmpty())
|
if (rBackground.IsEmpty())
|
||||||
rBackground = CreateBackgroundBitmap(rReferenceDevice, eType);
|
rBackground = CreateBackgroundBitmap(rReferenceDevice, eType, nBorderWidth);
|
||||||
return rBackground;
|
return rBackground;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -416,7 +433,8 @@ Bitmap& PageObjectPainter::GetBackground(
|
|||||||
|
|
||||||
Bitmap PageObjectPainter::CreateBackgroundBitmap(
|
Bitmap PageObjectPainter::CreateBackgroundBitmap(
|
||||||
const OutputDevice& rReferenceDevice,
|
const OutputDevice& rReferenceDevice,
|
||||||
const Theme::GradientColorType eColorType) const
|
const Theme::GradientColorType eColorType,
|
||||||
|
const int nBorderWidth) const
|
||||||
{
|
{
|
||||||
const Size aSize (mpPageObjectLayouter->GetPageObjectSize());
|
const Size aSize (mpPageObjectLayouter->GetPageObjectSize());
|
||||||
VirtualDevice aBitmapDevice (rReferenceDevice);
|
VirtualDevice aBitmapDevice (rReferenceDevice);
|
||||||
@@ -451,7 +469,7 @@ Bitmap PageObjectPainter::CreateBackgroundBitmap(
|
|||||||
aBitmapDevice.DrawLine(Point(0,nY), Point(aSize.Width(),nY));
|
aBitmapDevice.DrawLine(Point(0,nY), Point(aSize.Width(),nY));
|
||||||
}
|
}
|
||||||
|
|
||||||
PaintBorder(aBitmapDevice, eColorType, Rectangle(Point(0,0), aSize));
|
PaintBorder(aBitmapDevice, eColorType, Rectangle(Point(0,0), aSize), nBorderWidth);
|
||||||
|
|
||||||
// Get bounding box of the preview around which a shadow is painted.
|
// Get bounding box of the preview around which a shadow is painted.
|
||||||
// Compensate for the border around the preview.
|
// Compensate for the border around the preview.
|
||||||
@@ -471,14 +489,29 @@ Bitmap PageObjectPainter::CreateBackgroundBitmap(
|
|||||||
void PageObjectPainter::PaintBorder (
|
void PageObjectPainter::PaintBorder (
|
||||||
OutputDevice& rDevice,
|
OutputDevice& rDevice,
|
||||||
const Theme::GradientColorType eColorType,
|
const Theme::GradientColorType eColorType,
|
||||||
const Rectangle& rBox) const
|
const Rectangle& rBox,
|
||||||
|
const int nBorderWidth) const
|
||||||
{
|
{
|
||||||
const Size aSize (mpPageObjectLayouter->GetPageObjectSize());
|
|
||||||
rDevice.SetFillColor();
|
rDevice.SetFillColor();
|
||||||
|
for (int nIndex=0; nIndex<nBorderWidth; ++nIndex)
|
||||||
|
{
|
||||||
|
const int nDelta (-nIndex);
|
||||||
rDevice.SetLineColor(mpTheme->GetGradientColor(eColorType, Theme::Border2));
|
rDevice.SetLineColor(mpTheme->GetGradientColor(eColorType, Theme::Border2));
|
||||||
rDevice.DrawRect(rBox);
|
rDevice.DrawLine(
|
||||||
|
Point(rBox.Left()-nDelta, rBox.Top()-nDelta),
|
||||||
|
Point(rBox.Left()-nDelta, rBox.Bottom()+nDelta));
|
||||||
|
rDevice.DrawLine(
|
||||||
|
Point(rBox.Left()-nDelta, rBox.Bottom()+nDelta),
|
||||||
|
Point(rBox.Right()+nDelta, rBox.Bottom()+nDelta));
|
||||||
|
rDevice.DrawLine(
|
||||||
|
Point(rBox.Right()+nDelta, rBox.Bottom()+nDelta),
|
||||||
|
Point(rBox.Right()+nDelta, rBox.Top()-nDelta));
|
||||||
|
|
||||||
rDevice.SetLineColor(mpTheme->GetGradientColor(eColorType, Theme::Border1));
|
rDevice.SetLineColor(mpTheme->GetGradientColor(eColorType, Theme::Border1));
|
||||||
rDevice.DrawLine(rBox.TopLeft(), rBox.TopRight());
|
rDevice.DrawLine(
|
||||||
|
Point(rBox.Left()-nDelta, rBox.Top()-nDelta),
|
||||||
|
Point(rBox.Right()+nDelta, rBox.Top()-nDelta));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -169,8 +169,8 @@ void Theme::Update (const ::boost::shared_ptr<controller::Properties>& rpPropert
|
|||||||
|
|
||||||
SetGradient(Gradient_SelectedPage, aSelectionColor, 50, 50, +100,+100, +50,+25);
|
SetGradient(Gradient_SelectedPage, aSelectionColor, 50, 50, +100,+100, +50,+25);
|
||||||
SetGradient(Gradient_MouseOverPage, aSelectionColor, 75, 75, +100,+100, +50,+25);
|
SetGradient(Gradient_MouseOverPage, aSelectionColor, 75, 75, +100,+100, +50,+25);
|
||||||
SetGradient(Gradient_SelectedAndFocusedPage, aSelectionColor, 50, 50, +100,0, -50,-75);
|
SetGradient(Gradient_SelectedAndFocusedPage, aSelectionColor, 50, 50, +100,+100, -50,-75);
|
||||||
SetGradient(Gradient_MouseOverSelectedAndFocusedPage, aSelectionColor, 75, 75, +100,0, -50,-75);
|
SetGradient(Gradient_MouseOverSelectedAndFocusedPage, aSelectionColor, 75, 75, +100,+100, -50,-75);
|
||||||
SetGradient(Gradient_FocusedPage, aSelectionColor, -1,-1, 0,0, -50,-75);
|
SetGradient(Gradient_FocusedPage, aSelectionColor, -1,-1, 0,0, -50,-75);
|
||||||
|
|
||||||
#else
|
#else
|
||||||
@@ -417,6 +417,8 @@ void Theme::SetGradient (
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
sal_Int32 Theme::GetGradientSaturationOverride (const GradientColorType eType)
|
sal_Int32 Theme::GetGradientSaturationOverride (const GradientColorType eType)
|
||||||
{
|
{
|
||||||
GradientDescriptor& rGradient (GetGradient(eType));
|
GradientDescriptor& rGradient (GetGradient(eType));
|
||||||
@@ -424,6 +426,8 @@ sal_Int32 Theme::GetGradientSaturationOverride (const GradientColorType eType)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
sal_Int32 Theme::GetGradientBrightnessOverride (const GradientColorType eType)
|
sal_Int32 Theme::GetGradientBrightnessOverride (const GradientColorType eType)
|
||||||
{
|
{
|
||||||
GradientDescriptor& rGradient (GetGradient(eType));
|
GradientDescriptor& rGradient (GetGradient(eType));
|
||||||
@@ -431,6 +435,8 @@ sal_Int32 Theme::GetGradientBrightnessOverride (const GradientColorType eType)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void Theme::SetGradientSaturationOverride (const GradientColorType eType, const sal_Int32 nValue)
|
void Theme::SetGradientSaturationOverride (const GradientColorType eType, const sal_Int32 nValue)
|
||||||
{
|
{
|
||||||
GradientDescriptor& rGradient (GetGradient(eType));
|
GradientDescriptor& rGradient (GetGradient(eType));
|
||||||
@@ -446,6 +452,8 @@ void Theme::SetGradientSaturationOverride (const GradientColorType eType, const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void Theme::SetGradientBrightnessOverride (const GradientColorType eType, const sal_Int32 nValue)
|
void Theme::SetGradientBrightnessOverride (const GradientColorType eType, const sal_Int32 nValue)
|
||||||
{
|
{
|
||||||
GradientDescriptor& rGradient (GetGradient(eType));
|
GradientDescriptor& rGradient (GetGradient(eType));
|
||||||
@@ -536,8 +544,6 @@ void Theme::InitializeIcon (const IconType eType, USHORT nResourceId)
|
|||||||
if (eType>=0 && size_t(eType)<maIcons.size())
|
if (eType>=0 && size_t(eType)<maIcons.size())
|
||||||
{
|
{
|
||||||
const BitmapEx aIcon (Image(SdResId(nResourceId)).GetBitmapEx());
|
const BitmapEx aIcon (Image(SdResId(nResourceId)).GetBitmapEx());
|
||||||
OSL_TRACE("loaded icon %d in size %dx%d", nResourceId, aIcon.GetSizePixel().Width(),
|
|
||||||
aIcon.GetSizePixel().Height());
|
|
||||||
maIcons[eType] = aIcon;
|
maIcons[eType] = aIcon;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Reference in New Issue
Block a user