[Libreoffice-commits] core.git: 2 commits - icon-themes/galaxy officecfg/registry sd/inc sd/sdi sd/source sd/uiconfig
Maxim Monastirsky
momonasmon at gmail.com
Sun Sep 14 06:47:15 PDT 2014
icon-themes/galaxy/links.txt | 2
officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu | 8 ++
sd/inc/app.hrc | 1
sd/sdi/_drvwsh.sdi | 5 +
sd/sdi/sdraw.sdi | 24 ++++++++
sd/source/ui/func/fuzoom.cxx | 30 +++++++---
sd/source/ui/view/drviews2.cxx | 3 -
sd/source/ui/view/drviews7.cxx | 1
sd/source/ui/view/drviewsc.cxx | 1
sd/source/ui/view/drviewse.cxx | 14 ++++
sd/source/ui/view/outlnvs2.cxx | 10 ++-
sd/uiconfig/sdraw/toolbar/zoombar.xml | 1
sd/uiconfig/simpress/toolbar/zoombar.xml | 1
13 files changed, 89 insertions(+), 12 deletions(-)
New commits:
commit dffe40bc4e8be7c845d66a8118248d02dd70a707
Author: Maxim Monastirsky <momonasmon at gmail.com>
Date: Sun Sep 14 15:06:27 2014 +0300
Related: fdo#83572 Improve zoom mode
Make this mode permanent, and add also zoom out/pan
functionality. Hold Ctrl for zoom out, Shift for pan.
Change-Id: I5bd8adfcc4d403c35b33185e5894a2b020d604d0
diff --git a/sd/source/ui/func/fuzoom.cxx b/sd/source/ui/func/fuzoom.cxx
index f3bda04..daf1f16 100644
--- a/sd/source/ui/func/fuzoom.cxx
+++ b/sd/source/ui/func/fuzoom.cxx
@@ -82,12 +82,19 @@ bool FuZoom::MouseButtonDown(const MouseEvent& rMEvt)
aBeginPosPix = rMEvt.GetPosPixel();
aBeginPos = mpWindow->PixelToLogic(aBeginPosPix);
+ aZoomRect.SetSize( Size( 0, 0 ) );
+ aZoomRect.SetPos( aBeginPos );
return true;
}
bool FuZoom::MouseMove(const MouseEvent& rMEvt)
{
+ if (rMEvt.IsShift())
+ mpWindow->SetPointer(Pointer(POINTER_HAND));
+ else if (nSlotId != SID_ZOOM_PANNING)
+ mpWindow->SetPointer(Pointer(POINTER_MAGNIFY));
+
if (bStartDrag)
{
if (bVisible)
@@ -101,7 +108,7 @@ bool FuZoom::MouseMove(const MouseEvent& rMEvt)
aEndPos = mpWindow->PixelToLogic(aPosPix);
aBeginPos = mpWindow->PixelToLogic(aBeginPosPix);
- if (nSlotId == SID_ZOOM_PANNING)
+ if (nSlotId == SID_ZOOM_PANNING || (rMEvt.IsShift() && !bVisible) )
{
// Panning
@@ -123,9 +130,8 @@ bool FuZoom::MouseMove(const MouseEvent& rMEvt)
aZoomRect = aRect;
aZoomRect.Justify();
mpViewShell->DrawMarkRect(aZoomRect);
+ bVisible = true;
}
-
- bVisible = true;
}
return bStartDrag;
@@ -145,19 +151,27 @@ bool FuZoom::MouseButtonUp(const MouseEvent& rMEvt)
Point aPosPix = rMEvt.GetPosPixel();
- if(SID_ZOOM_PANNING != nSlotId)
+ if(SID_ZOOM_PANNING != nSlotId && !rMEvt.IsShift())
{
// Zoom
Size aZoomSizePixel = mpWindow->LogicToPixel(aZoomRect).GetSize();
sal_uLong nTol = DRGPIX + DRGPIX;
- if ( aZoomSizePixel.Width() < (long) nTol && aZoomSizePixel.Height() < (long) nTol )
+ if ( ( aZoomSizePixel.Width() < (long) nTol && aZoomSizePixel.Height() < (long) nTol ) || rMEvt.IsMod1() )
{
// click at place: double zoom factor
Point aPos = mpWindow->PixelToLogic(aPosPix);
Size aSize = mpWindow->PixelToLogic(mpWindow->GetOutputSizePixel());
- aSize.Width() /= 2;
- aSize.Height() /= 2;
+ if ( rMEvt.IsMod1() )
+ {
+ aSize.Width() *= 2;
+ aSize.Height() *= 2;
+ }
+ else
+ {
+ aSize.Width() /= 2;
+ aSize.Height() /= 2;
+ }
aPos.X() -= aSize.Width() / 2;
aPos.Y() -= aSize.Height() / 2;
aZoomRect.SetPos(aPos);
@@ -165,6 +179,7 @@ bool FuZoom::MouseButtonUp(const MouseEvent& rMEvt)
}
mpViewShell->SetZoomRect(aZoomRect);
+ mpViewShell->GetViewFrame()->GetBindings().Invalidate( SidArrayZoom );
}
Rectangle aVisAreaWin = mpWindow->PixelToLogic(Rectangle(Point(0,0),
@@ -173,7 +188,6 @@ bool FuZoom::MouseButtonUp(const MouseEvent& rMEvt)
bStartDrag = false;
mpWindow->ReleaseMouse();
- mpViewShell->Cancel();
return true;
}
diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx
index 8a21b68..59ece90 100644
--- a/sd/source/ui/view/drviews2.cxx
+++ b/sd/source/ui/view/drviews2.cxx
@@ -1227,7 +1227,6 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
{
mbZoomOnPage = false;
SetCurrentFunction( FuZoom::Create(this, GetActiveWindow(), mpDrawView, GetDoc(), rReq) );
- // finishes itself, no Cancel() needed!
Invalidate( SID_ZOOM_TOOLBOX );
rReq.Ignore ();
}
commit f5129ca7610ec4ec20ed1c00e5c94bf51d5de2cc
Author: Maxim Monastirsky <momonasmon at gmail.com>
Date: Sun Sep 14 15:48:45 2014 +0300
fdo#55903 Immediate effect for zoom in button
That's what apparently people expect from this button
to do, similar to the nearby zoom out button. This is
also consistent with a similar button in math, and in
print preview (both are using the same icon and same
tooltip).
The zoom mode that was assigned to this button until now,
moved to a dedicated button (thus could be further improved
to host other functionality as well - see the next commit).
Change-Id: Ie640c72cf1aab1e3fc8a14211702a33a86bb3672
diff --git a/icon-themes/galaxy/links.txt b/icon-themes/galaxy/links.txt
index 94b4da2..69160dc 100644
--- a/icon-themes/galaxy/links.txt
+++ b/icon-themes/galaxy/links.txt
@@ -4,3 +4,5 @@ cmd/lc_datastreamsstop.png avmedia/res/avl02051.png
cmd/sc_datastreamsstop.png avmedia/res/av02051.png
cmd/lc_showsinglepage.png cmd/lc_adddirect.png
cmd/sc_showsinglepage.png cmd/sc_adddirect.png
+cmd/lc_zoommode.png cmd/lc_zoomoptimal.png
+cmd/sc_zoommode.png cmd/sc_zoomoptimal.png
\ No newline at end of file
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu
index 31aa4d7..8819d85 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu
@@ -1480,6 +1480,14 @@
<value xml:lang="en-US">E-mail as ~OpenDocument Presentation...</value>
</prop>
</node>
+ <node oor:name=".uno:ZoomMode" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">Zoom Tool</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
</node>
<node oor:name="Popups">
<node oor:name=".uno:ModifyMenu" oor:op="replace">
diff --git a/sd/inc/app.hrc b/sd/inc/app.hrc
index aacb357..0bbd319 100644
--- a/sd/inc/app.hrc
+++ b/sd/inc/app.hrc
@@ -447,6 +447,7 @@
#define SID_ADD_MOTION_PATH (SID_SD_START+442)
#define SID_TABLE_TOOLBOX (SID_SD_START+443)
// free
+#define SID_ZOOM_MODE (SID_SD_START+447)
#define SID_HIDE_LAST_LEVEL (SID_SD_START+448)
#define SID_SHOW_NEXT_LEVEL (SID_SD_START+449)
#define SID_PRESENTATION_MINIMIZER (SID_SD_START+450)
diff --git a/sd/sdi/_drvwsh.sdi b/sd/sdi/_drvwsh.sdi
index 999bb69..1519008 100644
--- a/sd/sdi/_drvwsh.sdi
+++ b/sd/sdi/_drvwsh.sdi
@@ -624,6 +624,11 @@ interface DrawView
]
SID_ZOOM_OUT // ole : no, status : play rec
[
+ ExecMethod = FuSupport ;
+ StateMethod = GetMenuState ;
+ ]
+ SID_ZOOM_MODE // ole : no, status : play rec
+ [
ExecMethod = FuTemporary ;
StateMethod = GetMenuState ;
]
diff --git a/sd/sdi/sdraw.sdi b/sd/sdi/sdraw.sdi
index 7b9f7ea..a774026 100644
--- a/sd/sdi/sdraw.sdi
+++ b/sd/sdi/sdraw.sdi
@@ -6151,6 +6151,30 @@ SfxVoidItem ZoomPanning SID_ZOOM_PANNING
GroupId = GID_VIEW;
]
+SfxVoidItem ZoomMode SID_ZOOM_MODE
+()
+[
+ /* flags: */
+ AutoUpdate = TRUE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ RecordAbsolute = FALSE,
+ RecordPerSet;
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_VIEW;
+]
+
SfxVoidItem Mirror SID_OBJECT_MIRROR
( SfxBoolItem MirrorVert ID_VAL_MIRRORVERT )
[
diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx
index 05c6c40..8a21b68 100644
--- a/sd/source/ui/view/drviews2.cxx
+++ b/sd/source/ui/view/drviews2.cxx
@@ -1222,7 +1222,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
}
break;
- case SID_ZOOM_OUT:
+ case SID_ZOOM_MODE:
case SID_ZOOM_PANNING:
{
mbZoomOnPage = false;
diff --git a/sd/source/ui/view/drviews7.cxx b/sd/source/ui/view/drviews7.cxx
index b6dff0c..67227ba 100644
--- a/sd/source/ui/view/drviews7.cxx
+++ b/sd/source/ui/view/drviews7.cxx
@@ -1345,6 +1345,7 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet )
rSet.DisableItem( SID_ZOOM_IN );
rSet.DisableItem( SID_ZOOM_OUT );
rSet.DisableItem( SID_ZOOM_PANNING );
+ rSet.DisableItem( SID_ZOOM_MODE );
rSet.DisableItem( SID_ZOOM_NEXT );
rSet.DisableItem( SID_ZOOM_PREV );
rSet.DisableItem( SID_SIZE_REAL );
diff --git a/sd/source/ui/view/drviewsc.cxx b/sd/source/ui/view/drviewsc.cxx
index b5a4e31..84a1a2e 100644
--- a/sd/source/ui/view/drviewsc.cxx
+++ b/sd/source/ui/view/drviewsc.cxx
@@ -106,6 +106,7 @@ sal_uInt16 DrawViewShell::GetIdBySubId( sal_uInt16 nSId )
case SID_SIZE_OPTIMAL:
case SID_ZOOM_NEXT:
case SID_ZOOM_PREV:
+ case SID_ZOOM_MODE:
{
nMappedSId = SID_ZOOM_TOOLBOX;
}
diff --git a/sd/source/ui/view/drviewse.cxx b/sd/source/ui/view/drviewse.cxx
index 45f0fd7..373a2bc 100644
--- a/sd/source/ui/view/drviewse.cxx
+++ b/sd/source/ui/view/drviewse.cxx
@@ -1142,6 +1142,20 @@ void DrawViewShell::FuSupport(SfxRequest& rReq)
}
break;
+ case SID_ZOOM_OUT:
+ {
+ mbZoomOnPage = false;
+ SetZoom( std::min( (long) ( GetActiveWindow()->GetZoom() * 2 ), (long) GetActiveWindow()->GetMaxZoom() ) );
+ Rectangle aVisAreaWin = GetActiveWindow()->PixelToLogic( Rectangle( Point(0,0),
+ GetActiveWindow()->GetOutputSizePixel()) );
+ mpZoomList->InsertZoomRect(aVisAreaWin);
+ Invalidate( SID_ZOOM_IN );
+ Invalidate( SID_ZOOM_PANNING );
+ Invalidate( SID_ZOOM_TOOLBOX );
+ rReq.Done ();
+ }
+ break;
+
case SID_SIZE_VISAREA:
{
Rectangle aVisArea = mpFrameView->GetVisArea();
diff --git a/sd/source/ui/view/outlnvs2.cxx b/sd/source/ui/view/outlnvs2.cxx
index 7ad626c..249780c 100644
--- a/sd/source/ui/view/outlnvs2.cxx
+++ b/sd/source/ui/view/outlnvs2.cxx
@@ -143,8 +143,14 @@ void OutlineViewShell::FuTemporary(SfxRequest &rReq)
case SID_ZOOM_OUT:
{
- SetCurrentFunction( FuZoom::Create(this, GetActiveWindow(), pOlView, GetDoc(), rReq) );
- // ends itself, no need for Cancel()!
+ SetZoom( std::min( (long) ( GetActiveWindow()->GetZoom() * 2 ), (long) GetActiveWindow()->GetMaxZoom() ) );
+ Rectangle aVisAreaWin = GetActiveWindow()->PixelToLogic( Rectangle( Point(0,0),
+ GetActiveWindow()->GetOutputSizePixel()) );
+ mpZoomList->InsertZoomRect(aVisAreaWin);
+ Invalidate( SID_ATTR_ZOOM );
+ Invalidate( SID_ZOOM_IN );
+ Invalidate( SID_ATTR_ZOOMSLIDER );
+ Cancel();
rReq.Done();
}
break;
diff --git a/sd/uiconfig/sdraw/toolbar/zoombar.xml b/sd/uiconfig/sdraw/toolbar/zoombar.xml
index 4d18688..788568a 100644
--- a/sd/uiconfig/sdraw/toolbar/zoombar.xml
+++ b/sd/uiconfig/sdraw/toolbar/zoombar.xml
@@ -29,5 +29,6 @@
<toolbar:toolbaritem xlink:href=".uno:ZoomOptimal" toolbar:helpid="10101"/>
<toolbar:toolbaritem xlink:href=".uno:ZoomObjects" toolbar:helpid="27099"/>
<toolbar:toolbarseparator/>
+ <toolbar:toolbaritem xlink:href=".uno:ZoomMode"/>
<toolbar:toolbaritem xlink:href=".uno:ZoomPanning" toolbar:helpid="27017"/>
</toolbar:toolbar>
\ No newline at end of file
diff --git a/sd/uiconfig/simpress/toolbar/zoombar.xml b/sd/uiconfig/simpress/toolbar/zoombar.xml
index 4d18688..788568a 100644
--- a/sd/uiconfig/simpress/toolbar/zoombar.xml
+++ b/sd/uiconfig/simpress/toolbar/zoombar.xml
@@ -29,5 +29,6 @@
<toolbar:toolbaritem xlink:href=".uno:ZoomOptimal" toolbar:helpid="10101"/>
<toolbar:toolbaritem xlink:href=".uno:ZoomObjects" toolbar:helpid="27099"/>
<toolbar:toolbarseparator/>
+ <toolbar:toolbaritem xlink:href=".uno:ZoomMode"/>
<toolbar:toolbaritem xlink:href=".uno:ZoomPanning" toolbar:helpid="27017"/>
</toolbar:toolbar>
\ No newline at end of file
More information about the Libreoffice-commits
mailing list