UI/UX Improvement Suggestion - Zoom Reset

Talk about code development, features, specific bugs, enhancements, patches, and similar things.
Forum rules
Please keep everything here strictly on-topic.
This board is meant for Pale Moon source code development related subjects only like code snippets, patches, specific bugs, git, the repositories, etc.

This is not for tech support! Please do not post tech support questions in the "Development" board!
Please make sure not to use this board for support questions. Please post issues with specific websites, extensions, etc. in the relevant boards for those topics.

Please keep things on-topic as this forum will be used for reference for Pale Moon development. Expect topics that aren't relevant as such to be moved or deleted.
User avatar
coolsnoo
New to the forum
New to the forum
Posts: 2
Joined: 2021-11-21, 03:23

UI/UX Improvement Suggestion - Zoom Reset

Unread post by coolsnoo » 2021-11-21, 03:58

Hi all, just found this browser and think it's great. I appreciate all the hard work that went into building it, maintaining it, and making it as good as it is.

One small UI/UX improvement I'd suggest relates to zoom functionality: add an easy way to reset zoom to default level using the UI.

I am aware of the keyboard shortcuts (CTRL+0 to reset zoom), and realize there is a menu item in the menu bar under view->zoom, but 1) this menu bar is hidden by default (and in my personal opinion the UI looks much better with it hidden anyway), 2) the view->zoom menu isn't replicated in the main Pale Moon drop down that appears in the top left when the menu bar is hidden (maybe this was just missed, as it seems all other menu items are replicated here in some capacity), 3) I prefer (and maybe others do too) to interact with the browser via UI elements rather than keyboard shortcuts, and 4) the - + zoom toolbar buttons don't have a reset option that I am aware of.

In terms of implementation, I'd say either add the view->zoom item to the main Pale Moon drop down to be able to access the reset option there without having to toggle the menu bar on and off to do this, or just add a reset option between the - + toolbar buttons, or maybe just do both to give the user options. If you throw in the zoomed % between these - + toggles that also acts as the reset button, it would also I think solve this poster's suggestion: viewtopic.php?f=5&t=26478&p=211593 .

It's a small thing admittedly, but one that I believe would add just that little extra bit of class to the UX and seems to be a relatively easy addition.

I tried solving this issue by using the NoSquint add-on, but it just breaks the zoom functionality for me (can't zoom in and out with keyboard shortcuts or otherwise). This add-on seems like overkill for my needs anyway.

Anyway, if I just missed something here blatantly obvious, please let me know. Otherwise, thanks for the consideration.

Keiji
Hobby Astronomer
Hobby Astronomer
Posts: 18
Joined: 2017-09-27, 19:31

Re: UI/UX Improvement Suggestion - Zoom Reset

Unread post by Keiji » 2021-12-03, 23:41

I have no experience with XUL, but I searched around the latest PM source code a bit and I think it might be pretty simple to hack it around to what you need.

In palemoon/base/content/browser.xul search for <toolbarpalette id="BrowserToolbarPalette">

This appears to contain all the toolbar buttons that can appear when you Customize the toolbar.

The Zoom Controls item (id="zoom-controls") just has two items inside it, while the Cut, Copy, Paste buttons seem good examples of simple action buttons with nothing special about them.

Meanwhile, each button has a command (such as command="cmd_fullZoomEnlarge").

A bit of guesswork revealed that cmd_fullZoomReset is also a command id, this appears elsewhere (e.g. in browser-menubar.inc where it is placed in the menu).

So I'd imagine you could either add, inside the Zoom Controls item, this:

Code: Select all

        <toolbarbutton id="zoom-reset-button" class="toolbarbutton-1"
                       label="&fullZoomResetCmd.label;"
                       command="cmd_fullZoomReset"
                       tooltiptext="&zoomResetButton.tooltip;"/>
Or add as a separate button, like Cut, Copy, Paste:

Code: Select all

      <toolbarbutton id="zoom-reset-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
                     label="&fullZoomResetCmd.label;"
                     command="cmd_fullZoomReset"
                     tooltiptext="&zoomResetButton.tooltip;"/>
(and now I'm noticing these are the exact same thing, except for the extra class on the second one.)

The text strings are in palemoon\locales\en-US\chrome\browser\browser.dtd and fullZoomResetCmd is already defined as just the word "Reset" (as that's what it needs to say in the menu) so if you wanted it to say "Reset Zoom" or something else you'd presumably need to make a new entity for it. Similarly palemoon\themes\windows\browser.css and palemoon\themes\linux\browser.css define the images used (e.g. at #cut-button), not sure exactly how you'd go about adding a brand new icon here though.

I also don't know if you'd need to recompile PM to make this change, or if the file just exists somewhere in the installation and can be modified in a built version, but hopefully it's a start...

Incidentally I only even had this idea as NoSquint places "Zoom In", "Zoom Out" and "Reset Zoom" as separate icons in the toolbar. I'm not even sure why these separate items aren't included in the browser by default really, they'd remove the need for the combined "Zoom Controls" item and allow the user to decide where they want them and whether they want a reset button in there or not.

User avatar
coolsnoo
New to the forum
New to the forum
Posts: 2
Joined: 2021-11-21, 03:23

Re: UI/UX Improvement Suggestion - Zoom Reset

Unread post by coolsnoo » 2021-12-16, 21:27

Thanks a lot and appreciate the detailed response and efforts investigating this. Your suggestions are a little beyond my technical skills, however. But, if I ever get the chance to dive into this to try to figure it out, I'll give your suggestions a try.

Post Reply