Bug 45705 - DRAW/IMPRESS: New UNO commands for "Zoom in" and "Zoom out" of document canvas, to support keyboard zoom (comment 47)
Summary: DRAW/IMPRESS: New UNO commands for "Zoom in" and "Zoom out" of document canva...
Status: ASSIGNED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: Other All
: high enhancement
Assignee: Rafael Lima
URL:
Whiteboard: target:7.1.0 target:7.6.0
Keywords: easyHack, needsDevEval, topicUI
: 48485 52503 59617 68929 101867 104653 108895 112896 115217 118552 122391 122414 124331 136669 146240 153513 (view as bug list)
Depends on:
Blocks: Customize-Dialog-Keyboard UNO-Command-New Shortcuts-Accelerators Zoom
  Show dependency treegraph
 
Reported: 2012-02-06 07:48 UTC by Florian R. A. Angermeier
Modified: 2023-02-19 22:07 UTC (History)
36 users (show)

See Also:
Crash report or crash signature:
Regression By:


Attachments
Basic macro which has needed functionality (19.10 KB, application/vnd.oasis.opendocument.text)
2012-12-14 07:35 UTC, sasha.libreoffice
Details
variant of macro for presentations (21.69 KB, application/vnd.oasis.opendocument.presentation)
2012-12-14 10:14 UTC, sasha.libreoffice
Details
Zoom toolbar for Writer and Calc packaged as extension (6.21 KB, application/vnd.openofficeorg.extension)
2014-10-06 13:18 UTC, sasha.libreoffice
Details
Zoom toolbar for Impress packaged as extension (6.25 KB, application/vnd.openofficeorg.extension)
2014-10-06 13:20 UTC, sasha.libreoffice
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Florian R. A. Angermeier 2012-02-06 07:48:20 UTC
I want to propose a - i guess - simple improvement of the useablity.

It is at least affecting Writer (including Math and Web), Calc, Impress and Draw. I am not sure if there the possibility of zooming in Base.

Shortcuts for "Zoom in", "Zoom out" and "Zoom to 100 %". I have tried to find them but have not found one so I guess there noones at the moment. If I am wrong please let me know.

Ctrl + "+" and Ctrl + "-" are not free so they can not be used.

I would suggest:
(Ctrl +) Alt + "+" for "Zoom in"
(Ctrl +) Alt + "-" for "Zoom out"
(Ctrl +) Alt + "0" (Zero) for "Zoom to 100 %"

And maybe:
(Ctrl +) Alt + "2" for "Zoom to 200 %"
(Ctrl +) Alt + "5" for "Zoom to 50 %"

Anyone else who is interessted in such improvement?
Comment 1 sasha.libreoffice 2012-03-21 02:17:21 UTC
Thanks for new idea
Such functionality exist in InkScape. May be assign shortcuts as there for users not re-learn shortcuts?

Meanwhile, enable experimental functionality in settings, record Basic macros for this. Use Tools->Macros->Record macro.
Then assign produced macros to shortcuts. Use Tools->Customize, tab "Keyboard", category "LibreOffice macros"
Comment 2 peter Roots 2012-09-04 19:14:46 UTC
On Tools> Customise >Keyboard is is possible to attach the function Zoom in and Zoom out from the View category. Unfortunately these do not work even though Zoom does, but this is not that much use as a shortcut.
http://user.services.openoffice.org/en/forum/viewtopic.php?f=9&t=47378
Comment 3 peter Roots 2012-09-04 19:18:22 UTC Comment hidden (obsolete)
Comment 4 sasha.libreoffice 2012-12-14 07:35:30 UTC
Created attachment 71489 [details]
Basic macro which has needed functionality

I have written Basic Macro which allows Zoom In, Zoom Out, Zoom 100% and some another.
Comment 5 Stefan Knorr (astron) 2012-12-14 09:25:01 UTC
*** Bug 52503 has been marked as a duplicate of this bug. ***
Comment 6 Stefan Knorr (astron) 2012-12-14 09:32:13 UTC
Confirming with 4.1.0.0alpha0+ (master) for Writer, Calc and Math.
In Impress/Draw it works – with some hickups:
* only Alt-– and Alt–+ work, Alt-0 does nothing;
* it doesn't work immediately after opening a file, you have to click the
  document area first
* when editing text, it doesn't work either.
Comment 7 sasha.libreoffice 2012-12-14 10:14:59 UTC
Created attachment 71494 [details]
variant of macro for presentations
Comment 8 brian.bj.parker99 2013-03-10 08:05:59 UTC
In Mac OS X, CMD+ and CMD- are the standard keyboard commands for zooming across all applications, and it is quite disorienting to have otherwise in LibreOffice. 
As a special case for OS X, these shortcuts should be used (I believe they do not clash with anything else). (In particular, Draw currently counter-intuitively uses shift-+ and - to zoom).
Comment 9 Liam Morland 2014-06-08 16:15:41 UTC
*** Bug 68929 has been marked as a duplicate of this bug. ***
Comment 10 Liam Morland 2014-06-08 16:15:57 UTC
*** Bug 48485 has been marked as a duplicate of this bug. ***
Comment 11 Liam Morland 2014-06-08 16:16:18 UTC
*** Bug 59617 has been marked as a duplicate of this bug. ***
Comment 12 sasha.libreoffice 2014-10-06 13:18:55 UTC
Created attachment 107426 [details]
Zoom toolbar for Writer and Calc packaged as extension
Comment 13 sasha.libreoffice 2014-10-06 13:20:17 UTC
Created attachment 107427 [details]
Zoom toolbar for Impress packaged as extension
Comment 14 Yousuf Philips (jay) (retired) 2016-03-01 17:31:23 UTC
Was just about to submit a duplicate bug report because i was unable to assign a shortcut for the Zoom In and Out commands in the Customize dialog, though shortcuts for other Zoom commands worked fine - .uno:ZoomPage, .uno:ZoomPageWidth, .uno:ZoomOptimal, .uno:Zoom100Percent

I planned to set Zoom In and Zoom Out as Ctrl + Alt + Plus and Ctrl + Alt + Minus on all 3 platforms. (Cmd + Alt + Plus and Cmd + Alt + Minus on mac are reserved for screen zooming on Mac)

@Maxim, @Samuel, @Bubli: Any idea why these two commands are the only ones acting strange?
Comment 15 Yousuf Philips (jay) (retired) 2016-03-01 17:53:42 UTC
Adding the commands to the toolbar show that they are disabled, which would be the reason why they dont work with the shortcuts. But why as they work fine in print preview mode.
Comment 16 Maxim Monastirsky 2016-03-01 20:46:34 UTC
(In reply to Yousuf (Jay) Philips from comment #15)
> But why as they work fine in print preview mode.
They implemented only for print preview.
Comment 17 Yousuf Philips (jay) (retired) 2016-03-01 20:54:59 UTC Comment hidden (me-too)
Comment 18 Buovjaga 2016-09-23 19:57:43 UTC
*** Bug 101867 has been marked as a duplicate of this bug. ***
Comment 19 Mike Kaganski 2017-07-02 06:59:47 UTC
*** Bug 108895 has been marked as a duplicate of this bug. ***
Comment 20 Rogerio Luz Coelho 2017-09-17 15:16:09 UTC Comment hidden (obsolete)
Comment 21 Mike Kaganski 2017-09-17 18:11:48 UTC
(In reply to Rogerio Luz Coelho from comment #20)
> Now working on the 5.4.1.2 :
> 
> There are in the Customize > Keyboards > View > Zoom In / Out options for
> assigning shortcuts to these features, but the assignment does not work.

Wrong. It works. There's just misunderstanding about what this feature does. It is "zoom in/out in preview", which is unfortunately isn't explained well.

> Since the features IS available and it is broken, I changed the Importance
> of this bug.

Wrong. It is not broken, but is not implemented for what is expected by many users, that's why it's enhancement.

> Do not know if this ever worked in previous versions to be called a
> regression.

It is clearly stated in above discussion.
Comment 22 Mike Kaganski 2017-10-05 14:55:30 UTC
*** Bug 112896 has been marked as a duplicate of this bug. ***
Comment 23 Buovjaga 2018-02-16 16:35:08 UTC
*** Bug 115217 has been marked as a duplicate of this bug. ***
Comment 24 darrenllr 2018-02-20 07:14:16 UTC
Mine just got marked as a duplicate of this one - 

So I'll put it here also, not sure if anything is on the table to address the issue.

Also not sure how things are marked as 'bugs' or not, but according to the info on "How to report Bugs" at https://wiki.documentfoundation.org/QA/BugReport, this looks by definition to be a 'bug' :-

(..."Confirm that it really is a bug. Most of the time, a bug is something that makes the software behave in a way that a reasonable user would not want it to behave. This includes the software not doing what you want it to do")


LibreOffice Writer
Tools >
Customize >
Keyboard >
Category: View >

Set keys & Modify to:::

Zoom In = Ctrl++
Zoom Out = Ctrl--

Once modified in Keys, click OK

Nothing happens when using these keyboard shortcuts.

If you need anything else, just let me know.

Thanks ;-)

Steps to Reproduce:
LibreOffice Writer
Tools >
Customize >
Keyboard >
Category: View >

Set keys & Modify to:::

Zoom In = Ctrl++
Zoom Out = Ctrl--

Once modified in Keys, click OK

Nothing happens when using these keyboard shortcuts.

Actual Results:  
Nothing happens when using keyboard shortcuts

Expected Results:
Zoom in, and out (common keys Ctrl++, Ctrl-- work on lots of programs / applications - it's 2nd nature to use that key combo for me at least. 
 Probably for lots of others too, or a variant like Alt + for Photoshop etc.)


Reproducible: Always

User Profile Reset: No


Additional Info:
Not such an issue on a desktop (where a user would more often have a mouse with a scroll-wheel and can probably use Ctrl + scroll.

But on a laptop with a touchpad - not so convenient.

And, just not what I 'expect' after actually setting those in keyboard shortcuts etc.

Version: 5.3.7.2 (x64)
Build ID: 6b8ed514a9f8b44d37a1b96673cbbdd077e24059
CPU Threads: 4; OS Version: Windows 6.19; UI Render: default; Layout Engine: new; 
Locale: en-GB (en_US); Calc: group
Comment 25 V Stuart Foote 2018-07-05 14:12:29 UTC
*** Bug 118552 has been marked as a duplicate of this bug. ***
Comment 26 Maxim Monastirsky 2019-01-24 15:25:59 UTC
*** Bug 104653 has been marked as a duplicate of this bug. ***
Comment 27 Maxim Monastirsky 2019-01-24 15:32:23 UTC
*** Bug 122391 has been marked as a duplicate of this bug. ***
Comment 28 V Stuart Foote 2019-03-26 23:48:21 UTC
*** Bug 124331 has been marked as a duplicate of this bug. ***
Comment 29 Xisco Faulí 2019-12-02 11:09:15 UTC
Changing priority to 'high' since the number of duplicates is 5 or higher
Comment 30 nurali.medeu01 2020-09-11 07:14:00 UTC
I am using LibreOffice 7.0.1.2 and this issue is still present, 8 years since the first report of this bug. I am curious, when are you going to fix it?
Comment 31 Tom Atkinson 2020-09-11 14:41:00 UTC
@Mike I agree, in fact I have written up an extended article / review that focuses *purely* on the Zoom In / Zoom Out bug, and even has a screenshot of a real bad outcome: a bunch of cells overwritten, and the "Insert Cells" dialog appearing surprisingly.

Please see:
https://tomachi.co/review-libre-office-zoom-in-out-bug/

I breifly thought it was getting addrsesed also, because I was poking about this bug report a lot while writing this blog. Fingers crossed yours and now my comment this one will be the stimulation required. I'm going to also post a fresh new bug (I know theres lot of dupes already but heck, I already wrote it up in the post above so it's no biggy. If I had a faster more powerful computer I'd look into setting up my build env for some potentially contributions open source stylee. But for now I prey to the gods of open-source!

PS perhaps a 'bug bounty' on stack exchange should be considered? to raise funds for the friendly programmer or team that finally fixes this one?
Comment 32 V Stuart Foote 2020-09-11 15:15:57 UTC
*** Bug 122414 has been marked as a duplicate of this bug. ***
Comment 33 Buovjaga 2020-09-11 15:35:13 UTC
*** Bug 136669 has been marked as a duplicate of this bug. ***
Comment 34 V Stuart Foote 2020-09-11 17:40:16 UTC
Currently document canvas Zoom is implemented for document via popup dialog, zoom bar, or <ctrl>+mousewheel events.

Projects zoom via key_MOD1+mousewheel will progressively increase or decrease zoom percentage, the needed function. It unfortunately requires use of a mouse.

Keyboard only Zoom-in or zoom-out action is possible currently but it is *very* cumbersome, i.e. F10 + v + z + z (or as mnemonics are localized) and then enter zoom percentage or select zoom preset radio button.

Enhancement is to supplement the dialog, zoom bar, and key_Mod1+mousewheel Zoom actions with new control(s) (zoom-in/zoom-out), using existing SVX zoomtools/zoomctrl/zoom framework.  A simple key_mod controlled keyboard only stepped adjustment of zoom level at the zoom steps defined in zoomtools.cxx, that could also be reassigned via keyboard customizations.

Implementing with default shortcut assignments to match os/DE norms would help make for a seamless UX.
Comment 35 V Stuart Foote 2020-09-12 13:22:31 UTC
@Jim R, if you are looking for something lighter weight as you wrap up Outline mode this might be appealing...
Comment 36 Jim Raykowski 2020-09-16 06:51:24 UTC
Here is a patch that integrates the existing .uno:ZoomPlus and .uno:ZoomMinus user interface commands into the Writer document canvas.

https://gerrit.libreoffice.org/c/core/+/102830
Comment 37 Commit Notification 2020-09-27 04:35:56 UTC
Jim Raykowski committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/2cddaa6e199ed8bb6185b7825791199f9da4a670

tdf#45705 Integrate zoom UI commands into Writer text edit view

It will be available in 7.1.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 38 V Stuart Foote 2020-09-27 14:57:12 UTC
@Jim, looks great! 

We'll get to test drive with the 2020-09-28 TB nightlies...
Comment 39 Reuben Thomas 2020-09-27 15:11:19 UTC
Thanks very much to everyone involved in landing this enhancement!
Comment 40 V Stuart Foote 2020-10-01 18:45:03 UTC
Thanks Jim!

The shortcuts remain unassigned by default--and believe that is acceptable.

Rather the ZoomIn and ZoomOut UNO commands are now available to search for and assign via the Tools -> Customize dialog to the Writer module.

Zoom steps match well with behavior with Scroll wheel, so that is what most folks wanted--smooth keyboard zoom, in or out.

@Jim, Mike -- suitable for backport to 7.0?

=-testing-=
Version: 7.1.0.0.alpha0+ (x64)
Build ID: dda71436b8594fb0669b3ac06c02a3997a0674be
CPU threads: 8; OS: Windows 10.0 Build 18363; UI render: Skia/Vulkan; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: CL
Comment 41 Rogerio Luz Coelho 2020-10-02 02:11:35 UTC
Many thanks for all the invovled ... Great work !!!
Comment 42 Timur 2020-11-13 12:46:04 UTC
This bug is Verified but please explain:
1. how is this used, not with shortcuts in Comment 0 ?
2. request was for all modules and fix is for Writer, what's the status for all?
3. are duplicates checked?
Comment 43 Timur 2020-11-13 12:46:55 UTC
4. should something from here for Writer be added to Impress in bug 38169 ?
Comment 44 V Stuart Foote 2020-11-13 14:47:19 UTC
(In reply to Timur from comment #42)
> This bug is Verified but please explain:
> 1. how is this used, not with shortcuts in Comment 0 ?
> 2. request was for all modules and fix is for Writer, what's the status for
> all?

The UNO commands are available to apply as keyboard shortcut in all modules. The effects by module could use some work.

sm (Math) responds as sw (Writer) with smooth zoom increments.

sd (Draw, Impress) respond, but the increments are not the smooth scaling of the <Ctrl>+<MouseScroll> now present in sw (Writer).  The sc (Calc) sheets do not respond to the .uno:ZoomIn, .uno:ZoomOut controls, they apply against the print preview.

Something done for each module similar to https://gerrit.libreoffice.org/c/core/+/102830 perhaps?

> 3. are duplicates checked?

Feel free.
Comment 45 Commit Notification 2020-11-13 16:53:37 UTC
Jim Raykowski committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/95b27dd2e5b5bdcb39962f72882dcdf406bcb393

tdf#45705 rework zoom in and zoom out UI commands in Calc

It will be available in 7.1.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 46 V Stuart Foote 2020-11-15 18:14:00 UTC
(In reply to Commit Notification from comment #45)

> Affected users are encouraged to test the fix and report feedback.

Tested in Calc against
Version: 7.1.0.0.alpha1+ (x64)
Build ID: 42a691933429dbb315de2bd7ba2724993c60411f
CPU threads: 8; OS: Windows 10.0 Build 18363; UI render: Skia/Vulkan; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: CL

Tools -> Customize dialog -> Keyboard tab

Searching for zoom, select ZoomIn and then ZoomOut and modify a keyboard binding for each (used <Alt>+[ and <Alt>+] respectively).

The assigned keyboard shortcuts have nice smooth zoom scaling matching behavior of the <Ctrl>+<mousewheel> movements. Exactly what was needed for Calc.

Thanks Jim!

ps. didn't see that you'd had anything worked up for sd (Draw/Impress) a tougher nut to crack?
Comment 47 Jim Raykowski 2020-11-15 20:59:55 UTC
(In reply to V Stuart Foote from comment #46)
> 
> ps. didn't see that you'd had anything worked up for sd (Draw/Impress) a
> tougher nut to crack?

Stuart, thanks for testing!

I think this would be a nice beginning hack.

code pointers: 

Examine patches made for Writer and Calc and do the same for Draw/Impress.

sd/source/ui/view/viewshel.cxx is where the CommandEventId::Wheel behavior is defined.

sd/source/ui/view/drviewse.cxx is where user commands are handled: 
case SID_ZOOM_IN:
and
case SID_ZOOM_OUT:
Comment 48 V Stuart Foote 2021-12-15 13:18:25 UTC
*** Bug 146240 has been marked as a duplicate of this bug. ***
Comment 49 V Stuart Foote 2022-08-30 18:21:41 UTC
=> NEW for remaining Easyhack to provide UNO for sdraw and simpress use and keyboard assignment. Code pointers in comment 47.

@Jusitn, saw you unassigned Jim R. did you have a mentoree that is going to take this?
Comment 50 V Stuart Foote 2023-02-10 21:50:08 UTC
*** Bug 153513 has been marked as a duplicate of this bug. ***
Comment 51 Rafael Lima 2023-02-11 19:41:15 UTC
From what I understood of this ticket, we need a smoother SID_ZOOM_IN / SID_ZOOM_OUT in Impress/Draw.

The proposed patch is here:
https://gerrit.libreoffice.org/c/core/+/146825

This patch fixes the step size and makes it work as the zoom slider.

One question remains. Should we create default shortcuts for these commands?
Comment 52 Bernie Innocenti 2023-02-11 19:53:38 UTC
(In reply to Rafael Lima from comment #51)
> This patch fixes the step size and makes it work as the zoom slider.

Thanks!


> One question remains. Should we create default shortcuts for these commands?

Yes please. Many modern apps use ctrl +, ctrl - for zoom, and LibreOffice could follow this convention.
Comment 53 V Stuart Foote 2023-02-11 20:58:16 UTC
(In reply to Rafael Lima from comment #51)
> From what I understood of this ticket, we need a smoother SID_ZOOM_IN /
> SID_ZOOM_OUT in Impress/Draw.
> 
> The proposed patch is here:
> https://gerrit.libreoffice.org/c/core/+/146825
> 
> This patch fixes the step size and makes it work as the zoom slider.

Or the <Ctrl>+<M.Wheel> -- both at "incremental" steps of the +/- of the slider.

> 
> One question remains. Should we create default shortcuts for these commands?

Probably OK now to go ahead and set it globally.--users with dfferent prefs can customize the keyboard entries by module or globally.  

The <Ctrl>+ "- / =" might be a better assignment than "- / +" to avoid requiring use of a <Ctrl>+<Shift>. 

That seems to be the preferred Apple assignment (<Opt><Cmd>+= ) for Zoom-in
Comment 54 Commit Notification 2023-02-11 21:07:54 UTC
Rafael Lima committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/c96e1ec61835bc01e2969ec97fce9a1674fbf6d7

tdf#45705 Make SID_ZOOM_IN and SID_ZOOM_OUT smoother in Impress

It will be available in 7.6.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 55 Rafael Lima 2023-02-19 22:07:26 UTC
(In reply to V Stuart Foote from comment #53)
> The <Ctrl>+ "- / =" might be a better assignment than "- / +" to avoid
> requiring use of a <Ctrl>+<Shift>. 

It would be nice to have the same shortcut for .uno:ZoomMinus and .uno:ZoomPlus in all LO applications. From comment #53 the best candidates are <Ctrl>+ "- / =".

However, Ctrl + "-" is already used differently across applications:

In Writer
- Ctrl + "-" is associated with "Insert soft Hyphen"
- Ctrl + "=" is empty

In Calc
- Ctrl + "-" is associated with "Delete Cells"
- Ctrl + "=" is empty

In Impress/Draw
- Ctrl + "-" is associated with "Send Backward"
- Ctrl + "=" is empty

In the Basic IDE
- Ctrl + "-" is empty
- Ctrl + "=" is empty

In short, Ctrl + "=" is free to be associated with ZommPlus. But what can we do about ZoomMinus?