Kaydet (Commit) 3e8fe4d8 authored tarafından Samuel Mehrbrodt's avatar Samuel Mehrbrodt Kaydeden (comit) Björn Michaelsen

Remove the Navigator buttons below the scrollbar in Writer

Discussion was here: http://nabble.documentfoundation.org/Libreoffice-ux-advise-Remove-the-Navigator-button-below-the-scrollbar-in-Writer-td4083097.html

Change-Id: I04b33a8e992c87b8e7519dc62c208e6dc116f8e1
Reviewed-on: https://gerrit.libreoffice.org/6045Reviewed-by: 's avatarBjörn Michaelsen <bjoern.michaelsen@canonical.com>
Tested-by: 's avatarBjörn Michaelsen <bjoern.michaelsen@canonical.com>
üst 979f05ee
...@@ -57,7 +57,6 @@ class SdrView; ...@@ -57,7 +57,6 @@ class SdrView;
class Dialog; class Dialog;
class SdrObject; class SdrObject;
class SdrPageView; class SdrPageView;
class SwNaviImageButton;
class SwHlpImageButton; class SwHlpImageButton;
class SwView; class SwView;
class SwEditWin; class SwEditWin;
...@@ -214,7 +213,6 @@ class SW_DLLPUBLIC SwView: public SfxViewShell ...@@ -214,7 +213,6 @@ class SW_DLLPUBLIC SwView: public SfxViewShell
SwHlpImageButton *m_pPageUpBtn, SwHlpImageButton *m_pPageUpBtn,
*m_pPageDownBtn; *m_pPageDownBtn;
SwNaviImageButton *m_pNaviBtn;
SwGlossaryHdl *m_pGlosHdl; // handle text block SwGlossaryHdl *m_pGlosHdl; // handle text block
SwDrawBase *m_pDrawActual; SwDrawBase *m_pDrawActual;
......
...@@ -171,31 +171,6 @@ public: ...@@ -171,31 +171,6 @@ public:
void GrabFocus(){aToolBox.GrabFocus();} void GrabFocus(){aToolBox.GrabFocus();}
}; };
//----------------------------------------------------------------------------
//
//----------------------------------------------------------------------------
class SwNaviImageButton : public ImageButton
{
SwScrollNaviPopup* pPopup;
Image aImage;
OUString sQuickText;
SfxPopupWindow* pPopupWindow;
SfxPopupWindow* pFloatingWindow;
::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > m_xFrame;
protected:
DECL_LINK( PopupModeEndHdl, void * );
DECL_LINK( ClosePopupWindow, SfxPopupWindow * );
virtual void Click();
virtual void DataChanged( const DataChangedEvent& rDCEvt );
void SetPopupWindow( SfxPopupWindow* pWindow );
public:
SwNaviImageButton(Window* pParent, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame );
};
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
// ImageButtons have to set the HelpText themselves if needed // ImageButtons have to set the HelpText themselves if needed
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
......
...@@ -596,54 +596,6 @@ OUString SwScrollNaviPopup::GetQuickHelpText(sal_Bool bNext) ...@@ -596,54 +596,6 @@ OUString SwScrollNaviPopup::GetQuickHelpText(sal_Bool bNext)
return SW_RESSTR(nResId); return SW_RESSTR(nResId);
} }
void SwNaviImageButton::Click()
{
pPopup = new
SwScrollNaviPopup( FN_SCROLL_NAVIGATION,
m_xFrame, this );
Point aPos = OutputToScreenPixel(Point(0,0));
Rectangle aRect(aPos, GetSizePixel());
SetPopupWindow( pPopup );
pPopup->StartPopupMode(aRect, FLOATWIN_POPUPMODE_LEFT|FLOATWIN_POPUPMODE_ALLOWTEAROFF);
}
void SwNaviImageButton::SetPopupWindow( SfxPopupWindow* pWindow )
{
pPopupWindow = pWindow;
pPopupWindow->SetPopupModeEndHdl( LINK( this, SwNaviImageButton, PopupModeEndHdl ));
pPopupWindow->SetDeleteLink_Impl( LINK( this, SwNaviImageButton, ClosePopupWindow ));
}
IMPL_LINK_NOARG(SwNaviImageButton, PopupModeEndHdl)
{
if ( pPopupWindow->IsVisible() )
{
// Replace floating window with popup window and destroy
// floating window instance.
delete pFloatingWindow;
pFloatingWindow = pPopupWindow;
pPopupWindow = 0;
}
else
{
// Popup window has been closed by the user. No replacement, instance
// will destroy itself.
pPopupWindow = 0;
}
return 1;
}
IMPL_LINK( SwNaviImageButton, ClosePopupWindow, SfxPopupWindow *, pWindow )
{
if ( pWindow == pFloatingWindow )
pFloatingWindow = 0;
else
pPopupWindow = 0;
return 1;
}
void SwHlpImageButton::RequestHelp( const HelpEvent& rHEvt ) void SwHlpImageButton::RequestHelp( const HelpEvent& rHEvt )
{ {
...@@ -652,32 +604,6 @@ void SwHlpImageButton::RequestHelp( const HelpEvent& rHEvt ) ...@@ -652,32 +604,6 @@ void SwHlpImageButton::RequestHelp( const HelpEvent& rHEvt )
ImageButton::RequestHelp(rHEvt); ImageButton::RequestHelp(rHEvt);
} }
SwNaviImageButton::SwNaviImageButton(
Window* pParent,
const Reference< XFrame >& rFrame ) :
ImageButton(pParent, SW_RES(BTN_NAVI)),
pPopup(0),
aImage(SW_RES(IMG_BTN)),
sQuickText(SW_RESSTR(ST_QUICK)),
pPopupWindow(0),
pFloatingWindow(0),
m_xFrame( rFrame )
{
FreeResource();
SetStyle(GetStyle()|WB_NOPOINTERFOCUS);
SetQuickHelpText(sQuickText);
SetModeImage( aImage );
}
void SwNaviImageButton::DataChanged( const DataChangedEvent& rDCEvt )
{
if ( (rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
(rDCEvt.GetFlags() & SETTINGS_STYLE) )
SetModeImage( aImage );
Window::DataChanged( rDCEvt );
}
class SwZoomBox_Impl : public ComboBox class SwZoomBox_Impl : public ComboBox
{ {
sal_uInt16 nSlotId; sal_uInt16 nSlotId;
......
...@@ -368,23 +368,6 @@ String STR_IMGBTN_TBLFML_ERR_DOWN ...@@ -368,23 +368,6 @@ String STR_IMGBTN_TBLFML_ERR_DOWN
{ {
Text [ en-US ] = "Next faulty table formula"; Text [ en-US ] = "Next faulty table formula";
}; };
ImageButton BTN_NAVI
{
HelpID = HID_NAVIGATION_IMGBTN ;
SVLOOK = TRUE ;
HIDE = TRUE ;
RectStyle = TRUE ;
SmallStyle = TRUE ;
Image IMG_BTN
{
ImageBitmap = Bitmap { File = "navigation.png" ; };
MaskColor = IMAGE_MASK_COLOR ;
};
String ST_QUICK
{
Text [ en-US ] = "Navigation" ;
};
};
ComboBox RID_PVIEW_ZOOM_LB ComboBox RID_PVIEW_ZOOM_LB
{ {
HelpId = HID_PVIEW_ZOOM_LB; HelpId = HID_PVIEW_ZOOM_LB;
......
...@@ -1148,8 +1148,6 @@ SwPagePreview::SwPagePreview(SfxViewFrame *pViewFrame, SfxViewShell* pOldSh): ...@@ -1148,8 +1148,6 @@ SwPagePreview::SwPagePreview(SfxViewFrame *pViewFrame, SfxViewShell* pOldSh):
sPageStr(SW_RES(STR_PAGE)), sPageStr(SW_RES(STR_PAGE)),
pHScrollbar(0), pHScrollbar(0),
pVScrollbar(0), pVScrollbar(0),
pPageUpBtn(0),
pPageDownBtn(0),
pScrollFill(new ScrollBarBox( &pViewFrame->GetWindow(), pScrollFill(new ScrollBarBox( &pViewFrame->GetWindow(),
pViewFrame->GetFrame().GetParentFrame() ? 0 : WB_SIZEABLE )), pViewFrame->GetFrame().GetParentFrame() ? 0 : WB_SIZEABLE )),
mnPageCount( 0 ), mnPageCount( 0 ),
...@@ -1225,9 +1223,6 @@ SwPagePreview::~SwPagePreview() ...@@ -1225,9 +1223,6 @@ SwPagePreview::~SwPagePreview()
delete pScrollFill; delete pScrollFill;
delete pHScrollbar; delete pHScrollbar;
delete pVScrollbar; delete pVScrollbar;
delete pPageUpBtn;
delete pPageDownBtn;
} }
SwDocShell* SwPagePreview::GetDocShell() SwDocShell* SwPagePreview::GetDocShell()
...@@ -1242,27 +1237,12 @@ int SwPagePreview::_CreateScrollbar( sal_Bool bHori ) ...@@ -1242,27 +1237,12 @@ int SwPagePreview::_CreateScrollbar( sal_Bool bHori )
OSL_ENSURE( !*ppScrollbar, "check beforehand!" ); OSL_ENSURE( !*ppScrollbar, "check beforehand!" );
if( !bHori )
{
pPageUpBtn = new ImageButton(pMDI, SW_RES( BTN_PAGEUP ) );
pPageUpBtn->SetHelpId(GetStaticInterface()->GetSlot(FN_PAGEUP)->GetCommand());
pPageDownBtn = new ImageButton(pMDI, SW_RES( BTN_PAGEDOWN ) );
pPageDownBtn->SetHelpId(GetStaticInterface()->GetSlot(FN_PAGEDOWN)->GetCommand());
Link aLk( LINK( this, SwPagePreview, BtnPage ) );
pPageUpBtn->SetClickHdl( aLk );
pPageDownBtn->SetClickHdl( aLk );
pPageUpBtn->Show();
pPageDownBtn->Show();
}
*ppScrollbar = new SwScrollbar( pMDI, bHori ); *ppScrollbar = new SwScrollbar( pMDI, bHori );
ScrollDocSzChg(); ScrollDocSzChg();
(*ppScrollbar)->EnableDrag( sal_True ); (*ppScrollbar)->EnableDrag( sal_True );
(*ppScrollbar)->SetEndScrollHdl( LINK( this, SwPagePreview, EndScrollHdl )); (*ppScrollbar)->SetEndScrollHdl( LINK( this, SwPagePreview, EndScrollHdl ));
(*ppScrollbar)->SetScrollHdl( LINK( this, SwPagePreview, ScrollHdl )); (*ppScrollbar)->SetScrollHdl( LINK( this, SwPagePreview, ScrollHdl ));
InvalidateBorder(); InvalidateBorder();
...@@ -1270,17 +1250,6 @@ int SwPagePreview::_CreateScrollbar( sal_Bool bHori ) ...@@ -1270,17 +1250,6 @@ int SwPagePreview::_CreateScrollbar( sal_Bool bHori )
return 1; return 1;
} }
// Button-Handler
IMPL_LINK_INLINE_START( SwPagePreview, BtnPage, Button *, pButton )
{
// use new helper method to perform page up
// respectively page down.
_ExecPgUpAndPgDown( pButton == pPageUpBtn );
return 0;
}
IMPL_LINK_INLINE_END( SwPagePreview, BtnPage, Button *, pButton )
int SwPagePreview::ChgPage( int eMvMode, int bUpdateScrollbar ) int SwPagePreview::ChgPage( int eMvMode, int bUpdateScrollbar )
{ {
Rectangle aPixVisArea( aViewWin.LogicToPixel( aVisArea ) ); Rectangle aPixVisArea( aViewWin.LogicToPixel( aVisArea ) );
...@@ -1331,9 +1300,7 @@ void SwPagePreview::InnerResizePixel( const Point &rOfst, const Size &rSize ) ...@@ -1331,9 +1300,7 @@ void SwPagePreview::InnerResizePixel( const Point &rOfst, const Size &rSize )
aRect += aBorder; aRect += aBorder;
ViewResizePixel( aViewWin, aRect.TopLeft(), aRect.GetSize(), ViewResizePixel( aViewWin, aRect.TopLeft(), aRect.GetSize(),
aViewWin.GetOutputSizePixel(), aViewWin.GetOutputSizePixel(),
sal_True, *pVScrollbar, *pHScrollbar, *pScrollFill );
*pVScrollbar, *pHScrollbar, pPageUpBtn, pPageDownBtn, 0,
*pScrollFill );
// Never set EditWin ! // Never set EditWin !
// Never set VisArea ! // Never set VisArea !
...@@ -1361,8 +1328,7 @@ void SwPagePreview::OuterResizePixel( const Point &rOfst, const Size &rSize ) ...@@ -1361,8 +1328,7 @@ void SwPagePreview::OuterResizePixel( const Point &rOfst, const Size &rSize )
SvBorder aBorderNew; SvBorder aBorderNew;
CalcAndSetBorderPixel( aBorderNew, sal_False ); CalcAndSetBorderPixel( aBorderNew, sal_False );
ViewResizePixel( aViewWin, rOfst, rSize, aViewWin.GetOutputSizePixel(), ViewResizePixel( aViewWin, rOfst, rSize, aViewWin.GetOutputSizePixel(),
sal_False, *pVScrollbar, *pVScrollbar, *pHScrollbar, *pScrollFill );
*pHScrollbar, pPageUpBtn, pPageDownBtn, 0, *pScrollFill );
} }
void SwPagePreview::SetVisArea( const Rectangle &rRect, sal_Bool bUpdateScrollbar ) void SwPagePreview::SetVisArea( const Rectangle &rRect, sal_Bool bUpdateScrollbar )
...@@ -1621,8 +1587,6 @@ void SwPagePreview::ScrollViewSzChg() ...@@ -1621,8 +1587,6 @@ void SwPagePreview::ScrollViewSzChg()
bShowVScrollbar = false; bShowVScrollbar = false;
ShowVScrollbar(bShowVScrollbar); ShowVScrollbar(bShowVScrollbar);
pPageUpBtn->Show(bShowVScrollbar);
pPageDownBtn->Show(bShowVScrollbar);
} }
if(pHScrollbar) if(pHScrollbar)
{ {
......
...@@ -709,9 +709,6 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh ) ...@@ -709,9 +709,6 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh )
GetViewFrame()->GetBindings(), GetViewFrame()->GetBindings(),
WB_VSCROLL | WB_EXTRAFIELD | WB_BORDER )), WB_VSCROLL | WB_EXTRAFIELD | WB_BORDER )),
m_pTogglePageBtn(0), m_pTogglePageBtn(0),
m_pPageUpBtn(0),
m_pPageDownBtn(0),
m_pNaviBtn(0),
m_pGlosHdl(0), m_pGlosHdl(0),
m_pDrawActual(0), m_pDrawActual(0),
m_pLastTableFormat(0), m_pLastTableFormat(0),
...@@ -1069,9 +1066,6 @@ SwView::~SwView() ...@@ -1069,9 +1066,6 @@ SwView::~SwView()
delete m_pHRuler; delete m_pHRuler;
delete m_pVRuler; delete m_pVRuler;
delete m_pTogglePageBtn; delete m_pTogglePageBtn;
delete m_pPageUpBtn;
delete m_pNaviBtn;
delete m_pPageDownBtn;
delete m_pGlosHdl; delete m_pGlosHdl;
delete m_pViewImpl; delete m_pViewImpl;
delete m_pEditWin; delete m_pEditWin;
......
...@@ -21,11 +21,6 @@ ...@@ -21,11 +21,6 @@
#include "rcid.hrc" #include "rcid.hrc"
// BTN
#define BTN_PAGEDOWN (RC_VIEW_BEGIN)
#define BTN_PAGEUP (RC_VIEW_BEGIN + 1)
// STR // STR
#define STR_NUM_LEVEL (RC_VIEW_BEGIN + 3) #define STR_NUM_LEVEL (RC_VIEW_BEGIN + 3)
...@@ -56,6 +51,7 @@ ...@@ -56,6 +51,7 @@
#define STR_TEXTOPTIONS (RC_VIEW_BEGIN + 33) #define STR_TEXTOPTIONS (RC_VIEW_BEGIN + 33)
#define STR_SAVEACOPY_SRC (RC_VIEW_BEGIN + 34) #define STR_SAVEACOPY_SRC (RC_VIEW_BEGIN + 34)
// MSG // MSG
#define MSG_ERR_INSERT_GLOS (RC_VIEW_BEGIN) #define MSG_ERR_INSERT_GLOS (RC_VIEW_BEGIN)
......
...@@ -25,22 +25,7 @@ ...@@ -25,22 +25,7 @@
#include "popup.hrc" #include "popup.hrc"
#include "helpid.h" #include "helpid.h"
#include "cmdid.h" #include "cmdid.h"
ImageButton BTN_PAGEUP
{
SVLOOK = TRUE ;
HIDE = TRUE ;
RectStyle = TRUE ;
SmallStyle = TRUE ;
SYMBOL = IMAGEBUTTON_PAGEUP ;
};
ImageButton BTN_PAGEDOWN
{
SVLOOK = TRUE ;
HIDE = TRUE ;
RectStyle = TRUE ;
SmallStyle = TRUE ;
SYMBOL = IMAGEBUTTON_PAGEDOWN ;
};
QueryBox DLG_SPECIAL_FORCED QueryBox DLG_SPECIAL_FORCED
{ {
BUTTONS = WB_YES_NO ; BUTTONS = WB_YES_NO ;
......
...@@ -41,16 +41,11 @@ void ViewResizePixel( const Window &rRef, ...@@ -41,16 +41,11 @@ void ViewResizePixel( const Window &rRef,
const Point &rOfst, const Point &rOfst,
const Size &rSize, const Size &rSize,
const Size &rEditSz, const Size &rEditSz,
const sal_Bool bInner,
SwScrollbar& rVScrollbar, SwScrollbar& rVScrollbar,
SwScrollbar& rHScrollbar, SwScrollbar& rHScrollbar,
ImageButton* pPageUpBtn,
ImageButton* pPageDownBtn,
ImageButton* pNaviBtn,
Window& rScrollBarBox, Window& rScrollBarBox,
SvxRuler* pVRuler = 0, SvxRuler* pVRuler = 0,
SvxRuler* pHRuler = 0, SvxRuler* pHRuler = 0,
sal_Bool bWebView = sal_False,
sal_Bool bVRulerRight = sal_False ); sal_Bool bVRulerRight = sal_False );
......
...@@ -300,9 +300,6 @@ int SwView::_CreateScrollbar( sal_Bool bHori ) ...@@ -300,9 +300,6 @@ int SwView::_CreateScrollbar( sal_Bool bHori )
OSL_ENSURE( !*ppScrollbar, "check beforehand!" ); OSL_ENSURE( !*ppScrollbar, "check beforehand!" );
if( !bHori )
CreatePageButtons( !m_bShowAtResize );
*ppScrollbar = new SwScrollbar( pMDI, bHori ); *ppScrollbar = new SwScrollbar( pMDI, bHori );
UpdateScrollbars(); UpdateScrollbars();
if(bHori) if(bHori)
...@@ -324,43 +321,6 @@ int SwView::_CreateScrollbar( sal_Bool bHori ) ...@@ -324,43 +321,6 @@ int SwView::_CreateScrollbar( sal_Bool bHori )
return 1; return 1;
} }
void SwView::CreatePageButtons(sal_Bool bShow)
{
Window *pMDI = &GetViewFrame()->GetWindow();
m_pPageUpBtn = new SwHlpImageButton(pMDI, SW_RES( BTN_PAGEUP ), sal_True );
m_pPageUpBtn->SetHelpId(HID_SCRL_PAGEUP);
m_pPageDownBtn = new SwHlpImageButton(pMDI, SW_RES( BTN_PAGEDOWN ), sal_False );
m_pPageDownBtn->SetHelpId(HID_SCRL_PAGEDOWN);
Reference< XFrame > xFrame = GetViewFrame()->GetFrame().GetFrameInterface();
m_pNaviBtn = new SwNaviImageButton(pMDI, xFrame );
m_pNaviBtn->SetHelpId(HID_SCRL_NAVI);
Link aLk( LINK( this, SwView, BtnPage ) );
m_pPageUpBtn->SetClickHdl( aLk );
m_pPageDownBtn->SetClickHdl( aLk );
if(m_nMoveType != NID_PGE)
{
Color aColor(VIEW_IMAGECOLOR);
SetImageButtonColor(aColor);
}
if(bShow)
{
m_pPageUpBtn->Show();
m_pPageDownBtn->Show();
m_pNaviBtn->Show();
}
};
// Button-Handler
IMPL_LINK( SwView, BtnPage, Button *, pButton )
{
// #i75416# move the execution of the search to an asynchronously called static link
bool* pbNext = new bool( (pButton == m_pPageDownBtn) );
Application::PostUserEvent( STATIC_LINK(this, SwView, MoveNavigationHdl), pbNext );
return 0;
}
IMPL_STATIC_LINK( SwView, MoveNavigationHdl, bool *, pbNext ) IMPL_STATIC_LINK( SwView, MoveNavigationHdl, bool *, pbNext )
{ {
if ( !pbNext ) if ( !pbNext )
...@@ -615,7 +575,6 @@ void SwView::SetMoveType(sal_uInt16 nSet) ...@@ -615,7 +575,6 @@ void SwView::SetMoveType(sal_uInt16 nSet)
SwView* pView = (SwView*)SfxViewShell::GetFirst(&aTypeId); SwView* pView = (SwView*)SfxViewShell::GetFirst(&aTypeId);
while( pView ) while( pView )
{ {
pView->SetImageButtonColor(aColor);
pView = (SwView*)SfxViewShell::GetNext(*pView, &aTypeId); pView = (SwView*)SfxViewShell::GetNext(*pView, &aTypeId);
} }
} }
...@@ -626,15 +585,6 @@ void SwView::SetActMark(sal_Int32 nSet) ...@@ -626,15 +585,6 @@ void SwView::SetActMark(sal_Int32 nSet)
m_nActMark = nSet; m_nActMark = nSet;
} }
void SwView::SetImageButtonColor(Color& rColor)
{
if(m_pPageUpBtn)
{
m_pPageUpBtn->SetControlForeground(rColor);
m_pPageDownBtn->SetControlForeground(rColor);
}
}
void SwView::ShowHScrollbar(sal_Bool bShow) void SwView::ShowHScrollbar(sal_Bool bShow)
{ {
OSL_ENSURE(m_pHScrollbar, "Scrollbar invalid"); OSL_ENSURE(m_pHScrollbar, "Scrollbar invalid");
...@@ -651,9 +601,6 @@ void SwView::ShowVScrollbar(sal_Bool bShow) ...@@ -651,9 +601,6 @@ void SwView::ShowVScrollbar(sal_Bool bShow)
{ {
OSL_ENSURE(m_pVScrollbar, "Scrollbar invalid"); OSL_ENSURE(m_pVScrollbar, "Scrollbar invalid");
m_pVScrollbar->ExtendedShow(bShow); m_pVScrollbar->ExtendedShow(bShow);
m_pPageUpBtn->Show(bShow);
m_pPageDownBtn->Show(bShow);
m_pNaviBtn->Show(bShow);
} }
sal_Bool SwView::IsVScrollbarVisible()const sal_Bool SwView::IsVScrollbarVisible()const
......
...@@ -829,16 +829,11 @@ void ViewResizePixel( const Window &rRef, ...@@ -829,16 +829,11 @@ void ViewResizePixel( const Window &rRef,
const Point &rOfst, const Point &rOfst,
const Size &rSize, const Size &rSize,
const Size &rEditSz, const Size &rEditSz,
const sal_Bool /*bInner*/,
SwScrollbar& rVScrollbar, SwScrollbar& rVScrollbar,
SwScrollbar& rHScrollbar, SwScrollbar& rHScrollbar,
ImageButton* pPageUpBtn,
ImageButton* pPageDownBtn,
ImageButton* pNaviBtn,
Window& rScrollBarBox, Window& rScrollBarBox,
SvxRuler* pVRuler, SvxRuler* pVRuler,
SvxRuler* pHRuler, SvxRuler* pHRuler,
sal_Bool bWebView,
sal_Bool bVRulerRight ) sal_Bool bVRulerRight )
{ {
// ViewResizePixel is also used by Preview!!! // ViewResizePixel is also used by Preview!!!
...@@ -916,33 +911,11 @@ void ViewResizePixel( const Window &rRef, ...@@ -916,33 +911,11 @@ void ViewResizePixel( const Window &rRef,
} }
} }
Size aImgSz( nVBSzWidth, nVBSzWidth );
// If the space for scrollbar and page buttons gets too small,
// the buttons will be hidden.
sal_uInt16 nCnt = pNaviBtn ? 3 : 2;
long nSubSize = (aImgSz.Width() * nCnt );
//
sal_Bool bHidePageButtons = aSize.Height() < ((bWebView ? 3 : 2) * nSubSize);
if(!bHidePageButtons)
aSize.Height() -= nSubSize;
else
aImgSz.Width() = 0; // No hide, because this will be misunderstood
// in the update scrollbar.
if ( nHBSzHeight ) if ( nHBSzHeight )
aSize.Height() -= nHBSzHeight; aSize.Height() -= nHBSzHeight;
rVScrollbar.SetPosSizePixel( aPos, aSize ); rVScrollbar.SetPosSizePixel( aPos, aSize );
aPos.Y() += aSize.Height(); aPos.Y() += aSize.Height();
pPageUpBtn->SetPosSizePixel( aPos, aImgSz );
if(pNaviBtn)
{
aPos.Y() += aImgSz.Height();
pNaviBtn->SetPosSizePixel(aPos, aImgSz);
}
aPos.Y() += aImgSz.Height();
pPageDownBtn->SetPosSizePixel( aPos, aImgSz );
aScrollFillPos.X() = aPos.X(); aScrollFillPos.X() = aPos.X();
} }
...@@ -997,11 +970,8 @@ void SwView::InnerResizePixel( const Point &rOfst, const Size &rSize ) ...@@ -997,11 +970,8 @@ void SwView::InnerResizePixel( const Point &rOfst, const Size &rSize )
} }
Size aEditSz( GetEditWin().GetOutputSizePixel() ); Size aEditSz( GetEditWin().GetOutputSizePixel() );
ViewResizePixel( GetEditWin(), rOfst, aSz, aEditSz, sal_True, *m_pVScrollbar, ViewResizePixel( GetEditWin(), rOfst, aSz, aEditSz, *m_pVScrollbar,
*m_pHScrollbar, m_pPageUpBtn, m_pPageDownBtn, *m_pHScrollbar, *m_pScrollFill, m_pVRuler, m_pHRuler,
m_pNaviBtn,
*m_pScrollFill, m_pVRuler, m_pHRuler,
0 != PTR_CAST(SwWebView, this),
m_pWrtShell->GetViewOptions()->IsVRulerRight()); m_pWrtShell->GetViewOptions()->IsVRulerRight());
if ( m_bShowAtResize ) if ( m_bShowAtResize )
ShowAtResize(); ShowAtResize();
...@@ -1096,11 +1066,8 @@ void SwView::OuterResizePixel( const Point &rOfst, const Size &rSize ) ...@@ -1096,11 +1066,8 @@ void SwView::OuterResizePixel( const Point &rOfst, const Size &rSize )
SvBorder aBorder; SvBorder aBorder;
CalcAndSetBorderPixel( aBorder, sal_False ); CalcAndSetBorderPixel( aBorder, sal_False );
const Size aEditSz( GetEditWin().GetOutputSizePixel() ); const Size aEditSz( GetEditWin().GetOutputSizePixel() );
ViewResizePixel( GetEditWin(), rOfst, rSize, aEditSz, sal_False, *m_pVScrollbar, ViewResizePixel( GetEditWin(), rOfst, rSize, aEditSz, *m_pVScrollbar,
*m_pHScrollbar, m_pPageUpBtn, m_pPageDownBtn, *m_pHScrollbar, *m_pScrollFill, m_pVRuler, m_pHRuler,
m_pNaviBtn,
*m_pScrollFill, m_pVRuler, m_pHRuler,
0 != PTR_CAST(SwWebView, this),
m_pWrtShell->GetViewOptions()->IsVRulerRight() ); m_pWrtShell->GetViewOptions()->IsVRulerRight() );
if ( m_bShowAtResize ) if ( m_bShowAtResize )
ShowAtResize(); ShowAtResize();
...@@ -1147,20 +1114,7 @@ void SwView::OuterResizePixel( const Point &rOfst, const Size &rSize ) ...@@ -1147,20 +1114,7 @@ void SwView::OuterResizePixel( const Point &rOfst, const Size &rSize )
bRepeat = sal_False; bRepeat = sal_False;
} }
}while ( bRepeat ); } while ( bRepeat );
if( m_pVScrollbar->IsVisible(sal_False) || m_pVScrollbar->IsAuto())
{
sal_Bool bShowButtons = m_pVScrollbar->IsVisible(sal_True);
if(m_pPageUpBtn && m_pPageUpBtn->IsVisible() != bShowButtons)
{
m_pPageUpBtn->Show(bShowButtons);
if(m_pPageDownBtn)
m_pPageDownBtn->Show(bShowButtons);
if(m_pNaviBtn)
m_pNaviBtn->Show(bShowButtons);
}
}
m_pWrtShell->UnlockPaint(); m_pWrtShell->UnlockPaint();
if( bUnLockView ) if( bUnLockView )
...@@ -1207,17 +1161,6 @@ sal_Bool SwView::UpdateScrollbars() ...@@ -1207,17 +1161,6 @@ sal_Bool SwView::UpdateScrollbars()
const sal_Bool bVScrollVisible = m_pVScrollbar->IsVisible(sal_True); const sal_Bool bVScrollVisible = m_pVScrollbar->IsVisible(sal_True);
m_pVScrollbar->DocSzChgd( aTmpSz ); m_pVScrollbar->DocSzChgd( aTmpSz );
m_pVScrollbar->ViewPortChgd( aTmpRect ); m_pVScrollbar->ViewPortChgd( aTmpRect );
sal_Bool bShowButtons = m_pVScrollbar->IsVisible(sal_True);
if(m_pPageUpBtn && m_pPageUpBtn->IsVisible() != bShowButtons)
{
m_pPageUpBtn->Show(bShowButtons);
if(m_pPageDownBtn)
m_pPageDownBtn->Show(bShowButtons);
if(m_pNaviBtn)
m_pNaviBtn->Show(bShowButtons);
}
if ( bVScrollVisible != m_pVScrollbar->IsVisible(sal_True) ) if ( bVScrollVisible != m_pVScrollbar->IsVisible(sal_True) )
bRet = sal_True; bRet = sal_True;
} }
......
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