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
Newbie
Newbie
Posts: 4
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
Apollo supporter
Apollo supporter
Posts: 32
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
Newbie
Newbie
Posts: 4
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.

User avatar
pale guru
Moonbather
Moonbather
Posts: 61
Joined: 2021-11-06, 11:10
Location: Tyskland

Re: UI/UX Improvement Suggestion - Zoom Reset

Unread post by pale guru » 2022-02-12, 03:26

→ please move thread to support forum.

You can define your own button w/o much internal knowledge with the original Prefbar @tuxfamily.org archives.

In the preferences, you can create a new button…
Image

… and add:
Id: cmd_FullZoomReset
Label: ZoomReset

and as onClick insert
if ("FullZoom" in window)
FullZoom.reset();
else
ZoomManager.prototype.getInstance().reset();

(based on the original Prefbar code for Font+ and Font- buttons.
… tanning in dimmed LCD light. – Evry 1′s a beginner, baby, that's the truth…

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35473
Joined: 2011-08-28, 17:27
Location: Motala, SE
Contact:

Re: UI/UX Improvement Suggestion - Zoom Reset

Unread post by Moonchild » 2022-02-12, 16:09

pale guru wrote:
2022-02-12, 03:26
→ please move thread to support forum.
please don't backseat-moderate.

just because your answer would provide support doesn't take away from the browser development request posted.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

User avatar
coolsnoo
Newbie
Newbie
Posts: 4
Joined: 2021-11-21, 03:23

Re: UI/UX Improvement Suggestion - Zoom Reset

Unread post by coolsnoo » 2022-03-03, 14:21

Thanks for the replies and for your consideration of this idea.

@pale guru, I downloaded Prefbar from that website, but get an error that states it is not compatible with Pale Moon 29.4.4 when trying to install the plugin, so couldn't try your suggestion. Thanks anyway!

coffeebreak
Moon Magic practitioner
Moon Magic practitioner
Posts: 2986
Joined: 2015-09-26, 04:51
Location: U.S.

Re: UI/UX Improvement Suggestion - Zoom Reset

Unread post by coffeebreak » 2022-03-04, 08:33

coolsnoo wrote:
2022-03-03, 14:21
I downloaded Prefbar from that website, but get an error that states it is not compatible with Pale Moon 29.4.4 when trying to install the plugin, so couldn't try your suggestion.
With the next major Pale Moon release, the original PrefBar should be compatible again
(see: A change of direction for Pale Moon in 2022).

But there is also a Pale Moon-compatible fork you might try, QuickPrefBar.

User avatar
coolsnoo
Newbie
Newbie
Posts: 4
Joined: 2021-11-21, 03:23

Re: UI/UX Improvement Suggestion - Zoom Reset

Unread post by coolsnoo » 2022-03-08, 01:01

Thanks a lot. Got it working with QuickPrefBar. Functional, if not totally elegant and a bit overkill of a solution. But I appreciate the help and suggestions. Put the menu right next to the +/- buttons and it does what it says on the tin!
Image

I still think it would make a nice UX improvement for the browser (and also to bring the View menu option under the condensed "Pale Moon" menu drop down when the Menu Bar is hidden), but recognize that it is ultimately a relatively small and trivial improvement.

Locked