Kaydet (Commit) 20824c11 authored tarafından Thomas Arnhold's avatar Thomas Arnhold Kaydeden (comit) Michael Meeks

fdo#63351 make use of ZoomSlider in StarMath

In collaboration with Marcos Souza <marcos.souza.org@gmail.com> :)

Includes some reordering of the statusbar: Zoom and ZoomSlider right,
left field with automatic size adjustment.

Change-Id: Ibfb1eab1abef7b026eeb7fd7c0a778c433c9e208
Reviewed-on: https://gerrit.libreoffice.org/4053Reviewed-by: 's avatarMichael Meeks <michael.meeks@suse.com>
Tested-by: 's avatarMichael Meeks <michael.meeks@suse.com>
üst c845557a
...@@ -283,6 +283,11 @@ interface FormulaView ...@@ -283,6 +283,11 @@ interface FormulaView
ExecMethod = Execute ; ExecMethod = Execute ;
StateMethod = GetState ; StateMethod = GetState ;
] ]
SID_ATTR_ZOOMSLIDER
[
ExecMethod = Execute ;
StateMethod = GetState ;
]
//idlpp kein Menueeintrag , also keine Texte //idlpp kein Menueeintrag , also keine Texte
SID_TEXTSTATUS //idlpp ole : no , status : no SID_TEXTSTATUS //idlpp ole : no , status : no
[ [
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include <svx/svxids.hrc> #include <svx/svxids.hrc>
#include <svx/modctrl.hxx> #include <svx/modctrl.hxx>
#include <svx/zoomctrl.hxx> #include <svx/zoomctrl.hxx>
#include <svx/zoomsliderctrl.hxx>
#include <sfx2/docfac.hxx> #include <sfx2/docfac.hxx>
#include <svx/lboxctrl.hxx> #include <svx/lboxctrl.hxx>
#include <sfx2/docfile.hxx> #include <sfx2/docfile.hxx>
...@@ -67,6 +68,7 @@ namespace ...@@ -67,6 +68,7 @@ namespace
SmViewShell::RegisterFactory(1); SmViewShell::RegisterFactory(1);
SvxZoomStatusBarControl::RegisterControl(SID_ATTR_ZOOM, pModule); SvxZoomStatusBarControl::RegisterControl(SID_ATTR_ZOOM, pModule);
SvxZoomSliderControl::RegisterControl(SID_ATTR_ZOOMSLIDER, pModule);
SvxModifyControl::RegisterControl(SID_TEXTSTATUS, pModule); SvxModifyControl::RegisterControl(SID_TEXTSTATUS, pModule);
SvxUndoRedoControl::RegisterControl(SID_UNDO, pModule); SvxUndoRedoControl::RegisterControl(SID_UNDO, pModule);
SvxUndoRedoControl::RegisterControl(SID_REDO, pModule); SvxUndoRedoControl::RegisterControl(SID_REDO, pModule);
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include <svl/stritem.hxx> #include <svl/stritem.hxx>
#include <svl/eitem.hxx> #include <svl/eitem.hxx>
#include <sfx2/zoomitem.hxx> #include <sfx2/zoomitem.hxx>
#include <svx/zoomslideritem.hxx>
#include <svx/svxids.hrc> #include <svx/svxids.hrc>
#include <svl/slstitm.hxx> #include <svl/slstitm.hxx>
......
...@@ -51,6 +51,7 @@ ...@@ -51,6 +51,7 @@
#include <svl/undo.hxx> #include <svl/undo.hxx>
#include <svl/whiter.hxx> #include <svl/whiter.hxx>
#include <svx/dialogs.hrc> #include <svx/dialogs.hrc>
#include <svx/zoomslideritem.hxx>
#include <editeng/editeng.hxx> #include <editeng/editeng.hxx>
#include <svx/svxdlg.hxx> #include <svx/svxdlg.hxx>
#include <sfx2/zoomitem.hxx> #include <sfx2/zoomitem.hxx>
...@@ -613,7 +614,10 @@ void SmGraphicWindow::SetZoom(sal_uInt16 Factor) ...@@ -613,7 +614,10 @@ void SmGraphicWindow::SetZoom(sal_uInt16 Factor)
SetTotalSize(); SetTotalSize();
SmViewShell *pViewSh = GetView(); SmViewShell *pViewSh = GetView();
if (pViewSh) if (pViewSh)
{
pViewSh->GetViewFrame()->GetBindings().Invalidate(SID_ATTR_ZOOM); pViewSh->GetViewFrame()->GetBindings().Invalidate(SID_ATTR_ZOOM);
pViewSh->GetViewFrame()->GetBindings().Invalidate(SID_ATTR_ZOOMSLIDER);
}
Invalidate(); Invalidate();
} }
...@@ -1853,6 +1857,19 @@ void SmViewShell::Execute(SfxRequest& rReq) ...@@ -1853,6 +1857,19 @@ void SmViewShell::Execute(SfxRequest& rReq)
} }
break; break;
case SID_ATTR_ZOOMSLIDER:
{
const SfxItemSet *pArgs = rReq.GetArgs();
const SfxPoolItem* pItem;
if ( pArgs && SFX_ITEM_SET == pArgs->GetItemState(SID_ATTR_ZOOMSLIDER, sal_True, &pItem ) )
{
const sal_uInt16 nCurrentZoom = ((const SvxZoomSliderItem *)pItem)->GetValue();
aGraphic.SetZoom( nCurrentZoom );
}
}
break;
case SID_TOOLBOX: case SID_TOOLBOX:
{ {
GetViewFrame()->ToggleChildWindow( SmToolBoxWrapper::GetChildWindowId() ); GetViewFrame()->ToggleChildWindow( SmToolBoxWrapper::GetChildWindowId() );
...@@ -1936,6 +1953,15 @@ void SmViewShell::GetState(SfxItemSet &rSet) ...@@ -1936,6 +1953,15 @@ void SmViewShell::GetState(SfxItemSet &rSet)
rSet.DisableItem( nWh ); rSet.DisableItem( nWh );
break; break;
case SID_ATTR_ZOOMSLIDER :
{
const sal_uInt16 nCurrentZoom = aGraphic.GetZoom();
SvxZoomSliderItem aZoomSliderItem( nCurrentZoom, MINZOOM, MAXZOOM );
aZoomSliderItem.AddSnappingPoint( 100 );
rSet.Put( aZoomSliderItem );
}
break;
case SID_NEXTERR: case SID_NEXTERR:
case SID_PREVERR: case SID_PREVERR:
case SID_NEXTMARK: case SID_NEXTMARK:
......
...@@ -18,8 +18,9 @@ ...@@ -18,8 +18,9 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 . * the License at http://www.apache.org/licenses/LICENSE-2.0 .
--> -->
<statusbar:statusbar xmlns:statusbar="http://openoffice.org/2001/statusbar" xmlns:xlink="http://www.w3.org/1999/xlink"> <statusbar:statusbar xmlns:statusbar="http://openoffice.org/2001/statusbar" xmlns:xlink="http://www.w3.org/1999/xlink">
<statusbar:statusbaritem xlink:href=".uno:TextStatus" statusbar:align="left" statusbar:width="300"/> <statusbar:statusbaritem xlink:href=".uno:TextStatus" statusbar:align="left" statusbar:autosize="true" statusbar:width="300"/>
<statusbar:statusbaritem xlink:href=".uno:Zoom" statusbar:align="center" statusbar:width="54"/>
<statusbar:statusbaritem xlink:href=".uno:ModifiedStatus" statusbar:align="center" statusbar:ownerdraw="true" statusbar:width="9"/> <statusbar:statusbaritem xlink:href=".uno:ModifiedStatus" statusbar:align="center" statusbar:ownerdraw="true" statusbar:width="9"/>
<statusbar:statusbaritem xlink:href=".uno:Signature" statusbar:align="center" statusbar:ownerdraw="true" statusbar:width="16"/> <statusbar:statusbaritem xlink:href=".uno:Signature" statusbar:align="center" statusbar:ownerdraw="true" statusbar:width="16"/>
<statusbar:statusbaritem xlink:href=".uno:ZoomSlider" statusbar:align="right" statusbar:ownerdraw="true" statusbar:width="130"/>
<statusbar:statusbaritem xlink:href=".uno:Zoom" statusbar:align="center" statusbar:width="54"/>
</statusbar:statusbar> </statusbar:statusbar>
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