Zoom level indicator?

Add-ons for Pale Moon and other applications
General discussion, compatibility, contributed extensions, themes, plugins, and more.

Moderators: FranklinDM, Lootyhoof

User avatar
Kris_88
Keeps coming back
Keeps coming back
Posts: 938
Joined: 2021-01-26, 11:18

Re: Zoom level indicator?

Unread post by Kris_88 » 2022-12-23, 18:12

back2themoon wrote:
2022-12-23, 10:56
Thank you for Zoom Label, tellu-white. :thumbup:
If you are about this add-on, it is mine
https://addons.palemoon.org/addon/zoom-label/
back2themoon wrote:
2022-12-23, 10:56
If you somehow manage to allow changing both full and text-only zoom simultaneously, it'd be a significant step closer to replacing the abandoned (?) NoSquint.
The internal logic of the browser is built on the fact that only one value for zoom is stored. To change this, a deep intervention in the browser is required and such an add-on will be very specific and sensitive to changes in the browser code. In any case, this goes beyond the functions of a simple indicator.

User avatar
back2themoon
Moon Magic practitioner
Moon Magic practitioner
Posts: 2409
Joined: 2012-08-19, 20:32

Re: Zoom level indicator?

Unread post by back2themoon » 2022-12-23, 18:39

Sorry, got a bit confused. So, it's two new zoom-related extensions! Many thanks to you too, Kris_88. :thumbup:

Yes, I suspected this. NoSquint does seem to "go deep" into the browser since it clearly states during install that it "replaces the browser native zoom functions" (or sth along these lines).

User avatar
tellu-white
Moon lover
Moon lover
Posts: 83
Joined: 2022-03-08, 22:02

Re: Zoom level indicator?

Unread post by tellu-white » 2022-12-23, 19:06

Kris_88 wrote:
2022-12-23, 18:12
If you are about this add-on, it is mine
https://addons.palemoon.org/addon/zoom-label/
back2themoon wrote:
2022-12-23, 18:39
Sorry, got a bit confused. So, it's two new zoom-related extensions!
My add-on is Zoom Controls with Label v1.2 - the one that:
tellu-white wrote:
2022-12-18, 20:57
completely replaces the "zoom out" and "zoom in" buttons in Pale Moon with new buttons that flank a label which displays the zoom of the active page (in percent). In addition, by right-clicking on this label you can toggle the options:

1. Toggle "Full-Page / Text-Only" Zoom
2. Toggle Enable / Disable "Site-Specific" Zoom

This add-on installs automatically to the end of "Menu Bar".
Screenshots:

1. "Tooltiptext" label:
01.png
01.png (18.31 KiB) Viewed 760 times
2. Options (Righy-Click):
02.png
02.png (14.73 KiB) Viewed 760 times
03.png
03.png (16.58 KiB) Viewed 760 times
*****
back2themoon wrote:
2022-12-23, 10:56
If you somehow manage to allow changing both full and text-only zoom simultaneously, it'd be a significant step closer to replacing the abandoned (?) NoSquint.
I tested the "NoSquint 2.2.2" add-on (latest version available) to see what effect the "changing both full and text-only zoom simultaneously" option has. There is a problem with the way this option works in the "NoSquint 2.2.2" add-on. To exemplify this problem I will post some screenshots, with 2 different settings (options):

Setting 1:
Full zoom level = 100%
Text zoom level = 100%
01.png
Setting 2:
Full zoom level = 200%
Text zoom level = 50%
02.png
As you can see, in "Setting 1" the zoom does not change at all - behaviour as expected. In "Setting 2", however, "Full zoom" should double all elements on the page except the text, which should be zoomed to 50%, meaning that the text should be only HALF the size of the text displayed by "Setting 1". However, it can be seen that the text in "Setting 2" has the SAME SIZE as the text in "Setting 1", even though, in the options window, "Setting 1" has "Text zoom level = 100%" and "Setting 2" has "Text zoom level = 50%"! In fact, the text in "Setting 2" has the REAL zoom level equal to 100%, and this can be obtained from "Full zoom level" multiplied by "Text zoom level" in decimal format: 2x0.5=1 (1 = 100%).

I (additionally) tested this conclusion as follows:

Setting 1:

Code: Select all

gBrowser.selectedTab.linkedBrowser.fullZoom = 1;
gBrowser.selectedTab.linkedBrowser.textZoom = 1;
Setting 2:

Code: Select all

gBrowser.selectedTab.linkedBrowser.fullZoom = 2;
gBrowser.selectedTab.linkedBrowser.textZoom = 0.5;
I got the same visual results as displayed by the "NoSquint 2.2.2" add-on.

Given the situation above, I don't think it's a good idea "changing both full and text-only zoom simultaneously", even if I could account for the fact that the REAL value of "textZoom" is equal to the product of the set value of "fullZoom" and the set value of "textZoom" and display this real value in the "label".

User avatar
back2themoon
Moon Magic practitioner
Moon Magic practitioner
Posts: 2409
Joined: 2012-08-19, 20:32

Re: Zoom level indicator?

Unread post by back2themoon » 2022-12-23, 19:27

NoSquint also has a slider bug. Do not use that, but the tiny up/down arrows to change zoom levels.

User avatar
tellu-white
Moon lover
Moon lover
Posts: 83
Joined: 2022-03-08, 22:02

Re: Zoom level indicator?

Unread post by tellu-white » 2022-12-23, 20:07

back2themoon wrote:
2022-12-23, 19:27
NoSquint also has a slider bug. Do not use that, but the tiny up/down arrows to change zoom levels.
No, the behaviour described above is not "a slider bug". Also, if "tiny up/down arrows to change zoom levels" are used, the result is the same:

Setting 1:
Full zoom level = 100%
Text zoom level = 100%
05.png
Setting 2:
Full zoom level = 200%
Text zoom level = 50%
06.png
In these tests, too:
tellu-white wrote:
2022-12-23, 19:06
it can be seen that the text in "Setting 2" has the SAME SIZE as the text in "Setting 1", even though, in the options window, "Setting 1" has "Text zoom level = 100%" and "Setting 2" has "Text zoom level = 50%"! In fact, the text in "Setting 2" has the REAL zoom level equal to 100%, and this can be obtained from "Full zoom level" multiplied by "Text zoom level" in decimal format: 2x0.5=1 (1 = 100%).
This problem has to do with the way "fullZoom" and "textZoom" work in Pale Moon and not with "a slider bug" in "NoSquint 2.2.2" add-on (latest version available).

User avatar
back2themoon
Moon Magic practitioner
Moon Magic practitioner
Posts: 2409
Joined: 2012-08-19, 20:32

Re: Zoom level indicator?

Unread post by back2themoon » 2022-12-23, 21:40

Sorry, I remembered incorrectly. The sliders work. It's the arrows and text boxes that do not change the zoom (well, they do if you press ok - it's the instant preview that doesn't work).

This minor NoSquint bug aside, I'm not sure what you mean. Full zoom is indeed supposed to change everything, text included. At least it always worked this way in NoSquint.
tellu-white wrote:
2022-12-23, 19:06
..."Full zoom" should double all elements on the page except the text...
It doesn't work this way. However, perhaps you expected that when using the full zoom, the text-zoom percentage should also change, since text-zoom is changed too?

It would make sense I guess, but it still works and you can fine-tune it as you like, even if the actual percentage numbers are wrong.

User avatar
tellu-white
Moon lover
Moon lover
Posts: 83
Joined: 2022-03-08, 22:02

Re: Zoom level indicator?

Unread post by tellu-white » 2022-12-23, 23:09

back2themoon wrote:
2022-12-23, 21:40
Full zoom is indeed supposed to change everything, text included.
You're right, "fullZoom" is supposed to change everything, including the text. But this add-on gives the impression that "textZoom" is independent from "fullZoom", since the former has some controls dedicated to it exclusively. The impression that "textZoom" is independent from "fullZoom" is reinforced by the fact that in the "NoSquint Site Settings" window the displayed zoom value for "textZoom" does not change when you change "fullZoom"(not even after pressing the OK button). In the example I gave (in "Setting 2"), the text ON PAGE should have a zoom of 50% since the options window shows "Text zoom level 50%", but the REAL "textZoom" (ON PAGE) is not 50% but 100%. Because of this behaviour, you will never know what the real zoom of the text on the page is. This is the type of add-on behaviour I was referring to when I said that "fullZoom" should double all elements on the page except the text (since "textZoom" is independent from "fullZoom" ;-) ). If however this is not possible (or is not implemented by code), then the add-on code must take this into account and correctly calculate the "textZoom" before displaying it in the "NoSquint Site Settings" window. So, it should also automatically change the displayed "textZoom" value (to match the new reality on the page) when the "fullZoom" is changed.

User avatar
back2themoon
Moon Magic practitioner
Moon Magic practitioner
Posts: 2409
Joined: 2012-08-19, 20:32

Re: Zoom level indicator?

Unread post by back2themoon » 2022-12-23, 23:29

This is really not a problem. It's just a 'displayed numbers' issue. The most important thing is how the website looks to the users' eyes. No one will remember or care about the "actual" percentages.

Furthermore, if NoSquint also changed the "textZoom" value along with the "fullZoom" value, it would be more difficult to fine-tune a site's zoom level, with both numbers constantly changing. With this logic, then the reverse should be true: touching "textZoom" should also affect the "fullZoom" values in some way.

It's much better to keep these two values totally separate, as two entirely different and independent settings: Global Zoom (= everything, unified) vs. Text-only Zoom. The user can customize them at will, which is really what Pale Moon is about (ok, other things too).

Update: I've been using NoSquint since... forever, so I'm not really familiar with how Pale Moon internally deals with text/global zoom values. As far as I know, they are separate and cannot be used at the same time. So, I assume these values do not interact or modify each other (exactly as in NoSquint), the difference being that NS allows using/changing both values simultaneously, on the same website.

User avatar
tellu-white
Moon lover
Moon lover
Posts: 83
Joined: 2022-03-08, 22:02

Re: Zoom level indicator?

Unread post by tellu-white » 2022-12-27, 19:00

back2themoon wrote:
2022-12-23, 23:29
No one will remember or care about the "actual" percentages.
Furthermore, if NoSquint also changed the "textZoom" value along with the "fullZoom" value, it would be more difficult to fine-tune a site's zoom level, with both numbers constantly changing. With this logic, then the reverse should be true: touching "textZoom" should also affect the "fullZoom" values in some way.
In fact, I want to be correctly informed about zooom levels. Also, it is possible to modify "Text Zoom" and "NON-Text Zoom" INDEPENDENT of each other, so it will be simple to "fine-tune a site's zoom level". This behaviour is possible, so I made the add-on Text-Zoom and NON-Text-Zoom Controls with Label which meets the above requirements.

The add-on saves in real time (in "prefs.js" file) the "Text Zoom" and "NON-Text Zoom" changes for all "domains" affected by the changes (but NOT for individual URLs). When reverting to the "default" values (100%) for a particular "domain", that "domain" will be deleted from "prefs.js" file.

Being saved to disk, the add-on will remember the modified "Text Zoom" and "NON-Text Zoom" levels for each domain affected by changes and so they will be available again after restarting Pale Moon.

IMPORTANT!


To work correctly, the add-on modifies the following "default" settings in "about:config" as follows:

browser.zoom.full = false
browser.zoom.siteSpecific = false

However, it is no longer necessary the "browser.zoom.siteSpecific = true" setting because the add-on remembers all zoom changes made to all "domains" ("siteSpecific").

Also, the "browser.zoom.full = true" setting is no longer needed because it makes Pale Moon treat "Text Zoom" and "NON-Text Zoom" as a whole while my add-on treats them independently.

This add-on installs automatically to the end of "Menu Bar".

HELP:

"Click" on the "+" button ONLY zooms the text on the page (Text Zoom IN) .
"Ctrl-Click" on the "+" button zooms everything EXCEPT text (NON-Text Zoom IN).

"Click" on the "-" button ONLY zooms-out the text on the page (Text Zoom OUT).
"Ctrl-Click" on the "-" button zooms-out everything EXCEPT text (NON-Text Zoom OUT).

"Right-Click" on any of the two "labels" (Text Zoom Label / NON-Text Zoom Label) resets both "Text Zoom" and "NON-Text Zoom" to the "default" (100%) for the "domain" to which the current page belongs.

"Ctrl-Click" on any of the two "labels" (Text Zoom Label / NON-Text Zoom Label) displays the domains saved in "prefs.js" file along with the "Text Zoom" and "NON-Text Zoom" values.

Screenshots:
01.png
02.png
03.png
04.png
05.png
06.png
*****

Text-Zoom and NON-Text-Zoom Controls with Label v1.0 download link:

https://www.mediafire.com/file/1ixndb5yg7b0bbf/both_zoom_controls_with_label_v1_0.zip/file

User avatar
back2themoon
Moon Magic practitioner
Moon Magic practitioner
Posts: 2409
Joined: 2012-08-19, 20:32

Re: Zoom level indicator?

Unread post by back2themoon » 2022-12-27, 22:21

Thank you, I will try it soon. You should really upload your extension(s) to the Add-ons Site to avoid file confusion and allow automatic updates, should they be required. Links to MediaFire and similar hosting services are not ideal.

However, it's understandable if you don't want to commit to the Add-ons Site (user support, updates etc.).

User avatar
tellu-white
Moon lover
Moon lover
Posts: 83
Joined: 2022-03-08, 22:02

Re: Zoom level indicator?

Unread post by tellu-white » 2022-12-27, 23:09

back2themoon wrote:
2022-12-27, 22:21
Thank you, I will try it soon.
You're welcome. I hope you will like it.

*****

I've added new functionality to the add-on:

• Reset only "Text Zoom" to the "default" (100%).
• Reset only "NON-Text Zoom" to the "default" (100%).

New HELP:

"Click" on the "+" button ONLY zooms the text on the page (Text Zoom IN) .
"Ctrl+Click" on the "+" button zooms everything EXCEPT text (NON-Text Zoom IN).

"Click" on the "-" button ONLY zooms-out the text on the page (Text Zoom OUT).
"Ctrl+Click" on the "-" button zooms-out everything EXCEPT text (NON-Text Zoom OUT).

"Shift+Click" on "Text Zoom Label" resets only "Text Zoom" to the "default" (100%) for the "domain" to which the current page belongs.

"Shift+Click" on "NON-Text Zoom Label" resets only "NON-Text Zoom" to the "default" (100%) for the "domain" to which the current page belongs.

"Right-Click" on any of the two "labels" (Text Zoom Label / NON-Text Zoom Label) resets both "Text Zoom" and "NON-Text Zoom" to the "default" (100%) for the "domain" to which the current page belongs.

"Ctrl+Click" on any of the two "labels" (Text Zoom Label / NON-Text Zoom Label) displays the domains saved in "prefs.js" file along with the "Text Zoom" and "NON-Text Zoom" values.

Screenshots:
04.png
05.png
***

Text-Zoom and NON-Text-Zoom Controls with Label v1.1 download link:

https://www.mediafire.com/file/jj91ijgpm9ekqpt/both_zoom_controls_with_label_v1_1.zip/file

User avatar
Kris_88
Keeps coming back
Keeps coming back
Posts: 938
Joined: 2021-01-26, 11:18

Re: Zoom level indicator?

Unread post by Kris_88 » 2022-12-28, 08:36

Things become simpler if you reuse the code that is allready present in the browser.
Look how simple it can be done.

Code: Select all

<?xml version="1.0"?>
<overlay id="zoomlabel2_overlay"	xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">

<script type="application/javascript"><![CDATA[

  ZoomManager.getZoomForBrowser = function(aBrowser) {
    var full = Math.round(aBrowser.fullZoom * 100);
    var text = Math.round(aBrowser.textZoom * 100);

    return((full*1000 + text) / 100000);
  };


  ZoomManager.setZoomForBrowser = function(aBrowser, aVal) {
    var mix = Math.round(aVal*100000);
    var text = mix % 1000; var full = (mix - text) / 1000;
    text = text / 100; full = full / 100;

    if (full < this.MIN || full > this.MAX) full = 1;
    if (text < this.MIN || text > this.MAX) text = 1;

    aBrowser.fullZoom = full;
    aBrowser.textZoom = text;
  };


  ZoomManager.enlarge = function() {
    var mix = Math.round(this.zoom*100000);
    var text = mix % 1000; var full = (mix - text) / 1000;
    text = text / 100; full = full / 100;

    if (this.useFullZoom) {
      var i = this.zoomValues.indexOf(this.snap(full)) + 1;
      if (i < this.zoomValues.length) full = this.zoomValues[i];
//      full += 0.1; if(full > this.MAX) full = this.MAX;
    } else {
      var i = this.zoomValues.indexOf(this.snap(text)) + 1;
      if (i < this.zoomValues.length) text = this.zoomValues[i];
//      text += 0.1; if(text > this.MAX) text = this.MAX;
    };

    this.zoom = full + text / 1000;
  };


  ZoomManager.reduce = function() {
    var mix = Math.round(this.zoom*100000);
    var text = mix % 1000; var full = (mix - text) / 1000;
    text = text / 100; full = full / 100;

    if (this.useFullZoom) {
      var i = this.zoomValues.indexOf(this.snap(full)) - 1;
      if (i >= 0) full = this.zoomValues[i];
//      full -= 0.1; if(full < this.MIN) full = this.MIN;
    } else {
      var i = this.zoomValues.indexOf(this.snap(text)) - 1;
      if (i >= 0) text = this.zoomValues[i];
//      text -= 0.1; if(text < this.MIN) text = this.MIN;
    };

    this.zoom = full + text / 1000;
  };


  FullZoom._ensureValid = function(aValue) {
    if (isNaN(aValue)) return(1);

    var mix = Math.round(aValue*100000);
    var text = mix % 1000; var full = (mix - text) / 1000;
    text = text / 100; full = full / 100;

    if (full < ZoomManager.MIN) full = ZoomManager.MIN;
    if (full > ZoomManager.MAX) full = ZoomManager.MAX;
    if (text < ZoomManager.MIN) text = ZoomManager.MIN;
    if (text > ZoomManager.MAX) text = ZoomManager.MAX;

    return(full + text / 1000);
  };



  window.addEventListener("load", function(e) {

    if(ZoomManager.zoomlabel2_origSZFB) return;

    var label1 = null, label2 = null;
    var lastZoom = 0, lastType = 0;

    FindLabel();

    ZoomManager.zoomlabel2_origSZFB = ZoomManager.setZoomForBrowser;
    ZoomManager.setZoomForBrowser = function(aBrowser, aVal) {
      ZoomManager.zoomlabel2_origSZFB(aBrowser, aVal);
      UpdateLabel();
    };

    gBrowser.addEventListener("ZoomChangeUsingMouseWheel", function() {
      UpdateLabel();
    });

    gBrowser.addProgressListener({ onLocationChange: function() {
      UpdateLabel();
    }});

    document.addEventListener("aftercustomization", function() {
      FindLabel();

      lastZoom = 0; lastType = 0;
      UpdateLabel();
    });


    UpdateLabel();



    function FindLabel() {
      if(label1) try {
        label1.removeEventListener("DOMMouseScroll", onWheel1);
        label1.removeEventListener("click", onClick);
      } catch(e) {};
      label1 = null;

      if(label2) try {
        label2.removeEventListener("DOMMouseScroll", onWheel2);
        label2.removeEventListener("click", onClick);
      } catch(e) {};
      label2 = null;

      label1 = document.getElementById('zoomlabel2-UI1');
      if(label1) {
        label1.addEventListener("DOMMouseScroll", onWheel1);
        label1.addEventListener("click", onClick);
      };

      label2 = document.getElementById('zoomlabel2-UI2');
      if(label2) {
        label2.addEventListener("DOMMouseScroll", onWheel2);
        label2.addEventListener("click", onClick);
      };

    };


    function UpdateLabel() {
      if(label1 && label2) try {
        var zoom = ZoomManager.getZoomForBrowser(gBrowser.selectedBrowser);
        var type = (ZoomManager.useFullZoom) ? 1 : -1;

        if(lastZoom != zoom) {
          lastZoom = zoom;

          var mix = Math.round(zoom*100000);
          var text = mix % 1000; var full = (mix - text) / 1000;

          label1.label = full + '%';
          label2.label = text + '%';
        };

        if(lastType != type) {
          lastType = type;
          label1.style.textDecoration = (type>0) ? 'underline' : 'none';
          label2.style.textDecoration = (type<0) ? 'underline' : 'none';
        };

      } catch(e) {};
    };


    function onWheel1(e) {
      ZoomManager.useFullZoom = true;
      if(e.detail > 0) { FullZoom.reduce(); } else { FullZoom.enlarge(); };
    };

    function onWheel2(e) {
      ZoomManager.useFullZoom = false;
      if(e.detail > 0) { FullZoom.reduce(); } else { FullZoom.enlarge(); };
    };

    function onClick(e) {
      if(e.button == 0) FullZoom.reset(); 
      if(e.button == 1) ZoomManager.toggleZoom();
    };

  });

]]></script>


  <toolbarpalette id="BrowserToolbarPalette">
    <toolbaritem id="zoomlabel2-UI0" title="Zoom Label" class="chromeclass-toolbar-additional">
      <button id="zoomlabel2-UI1"
        tooltiptext="Full Zoom" label="100%"
        style="-moz-appearance:none; min-width:0px; list-style-image:none; background:transparent; border:0px; margin-right:0px;"
      />
      <button id="zoomlabel2-UI2"
        tooltiptext="Text Zoom" label="100%"
        style="-moz-appearance:none; min-width:0px; list-style-image:none; background:transparent; border:0px; margin-left:0px;"
      />
    </toolbaritem>
  </toolbarpalette>


</overlay>

User avatar
tellu-white
Moon lover
Moon lover
Posts: 83
Joined: 2022-03-08, 22:02

Re: Zoom level indicator?

Unread post by tellu-white » 2022-12-28, 15:58

Kris_88 wrote:
2022-12-28, 08:36
Things become simpler if you reuse the code that is allready present in the browser.
Look how simple it can be done.
Unfortunately, it's not that simple !

The code you provide behaves the same as the one in the "NoSquint 2.2.2" add-on. That is, when you change the "Full Zoom" level, the "Text Zoom" level changes AUTOMATICALLY.

As I said in a previous comment:

1. I want to be correctly informed about zoom levels.
2. It is possible to modify "Text Zoom" and "NON-Text Zoom" INDEPENDENT of each other.
3. I made the add-on Text-Zoom and NON-Text-Zoom Controls with Label which meets the above requirements.

Screenshots:

WARNING!
In my add-on, the "Text Zoom" label is the first of the two labels, the position of this label is reversed compared to Kris_88's add-on, where the "Text Zoom" label is the second label.

1. Add-ons

Kris_88 Add-on
01.png
tellu_white Add-on

01.png
2. Text-Zoom = 100%

Kris_88 • Full-Zoom = 100%

02.png
tellu_white • NON-Text-Zoom = 100%
02.png
3. Text-Zoom = 50%

Kris_88 • Full-Zoom = 100%
03.png
tellu_white • NON-Text-Zoom = 100%
03.png
***********************

So far everything is OK with Kris_88's code. The problems with this code start now, when I modify "Full Zoom". Unlike Kris_88's code, my add-on does NOT use "the code that is allready present in the browser", but ONLY modifies "NON-Text Zoom". This avoids the undesirable behavior that changes the "Text Zoom" level AUTOMATICALLY when changing "Full Zoom".

4. Text-Zoom = 50%

Kris_88 • Full-Zoom = 300%
04.png
tellu_white • NON-Text-Zoom = 300%
04.png
5. Text-Zoom = 100%

Kris_88 • Full-Zoom = 300%
05.png
tellu_white • NON-Text-Zoom = 300%
05.png
***

Below is the link to the add-on made with the code (unchanged) provided by Kris_88:

fullZoom and textZoom Labels Kris_88 download link:

https://www.mediafire.com/file/w2zf6zvbneisrfi/fullZoom_textZoom_Labels_Kris_88.zip/file

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

Re: Zoom level indicator?

Unread post by Moonchild » 2022-12-28, 16:19

Y'know, I think there's a slight difference interpretation of zoom levels here that causes some confusion.

One would see text zoom as a sub of full zoom.
One would see them independently.

i.e.: if one would set full zoom to 125% and text zoom to 150%, one interpretation would expect text to be 187.5% of the original (first zoom to 125%, then further zoom the text to 150% of that), while the other would expect text to be 150% of the original.

I don't know which extension does what. I don't think either one or the other is objectively right or wrong. It just depends on how you prefer it to be represented.
"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
Kris_88
Keeps coming back
Keeps coming back
Posts: 938
Joined: 2021-01-26, 11:18

Re: Zoom level indicator?

Unread post by Kris_88 » 2022-12-28, 17:30

tellu-white wrote:
2022-12-28, 15:58
The code you provide behaves the same as the one in the "NoSquint 2.2.2" add-on. That is, when you change the "Full Zoom" level, the "Text Zoom" level changes AUTOMATICALLY.
These are small details, it is easy to make it to work the same way as yours.
But I just like that I can proportionally change the scale of the entire page with one adjustment, and then additionally increase the text, if necessary.

The bottom line is not in this little things, but in everything else.
The browser contains all the functions
- for storing site-specific zoom
- for synchronization of the zoom level between tabs and windows
- for tracking of the predetermined values of the zoom (toolkit.zoomManager.zoomValues)
You can use it, you can sacrifice it and you can rewrite it all.
Just compare the code sizes...

User avatar
tellu-white
Moon lover
Moon lover
Posts: 83
Joined: 2022-03-08, 22:02

Re: Zoom level indicator?

Unread post by tellu-white » 2022-12-28, 18:08

Kris_88 wrote:
2022-12-28, 17:30
These are small details ... The bottom line is not in this little things, but in everything else.
I don't consider "small details" ("little things") neither the wrong display of the REAL "Text Zoom" level nor the fact that the "Text Zoom" level that I have already set (so the one I want) changes when I change "Full Zoom".

It is also false that "the browser contains all the functions" as far as "storing site-specific zoom" is concerned. Pale Moon will retain the WRONG value of "Text Zoom", NOT the REAL value. In order to display the real value of "Text Zoom" (which corresponds to the one on the page) and save this value for the future, "custom code" ("write from scratch") is required.

To prove me wrong, please post the code that belongs to Pale Moon and that solves the problems mentioned above.

User avatar
tellu-white
Moon lover
Moon lover
Posts: 83
Joined: 2022-03-08, 22:02

Re: Zoom level indicator?

Unread post by tellu-white » 2022-12-28, 18:49

Moonchild wrote:
2022-12-28, 16:19
I think there's a slight difference interpretation of zoom levels here that causes some confusion. ... I don't think either one or the other is objectively right or wrong. It just depends on how you prefer it to be represented.
I think the only correct version is the one where the displayed value of "Text Zoom" corresponds to the one on the page.

In the vast majority of cases, "Text Zoom" is more important than "Full Zoom" because the main problem with some pages is that they are difficult to read (they have the wrong font size). In many cases, changing the value of "Full Zoom" is not desirable because some elements on the page become blurred. If, however, I also want to change the size of other elements in the page (for example, with the code suggested by Kris_88), then the fact that changing "Full Zoom" leads to the automatic (unwanted) change of "Text Zoom" creates confusion. I don't think Pale Moon should decide for me that the value of "Text Zoom" should be changed if I just want to change the value of "Full Zoom" ("Text Zoom" being already set to the level I want).
Last edited by tellu-white on 2022-12-28, 18:52, edited 1 time in total.

User avatar
Kris_88
Keeps coming back
Keeps coming back
Posts: 938
Joined: 2021-01-26, 11:18

Re: Zoom level indicator?

Unread post by Kris_88 » 2022-12-28, 18:51

tellu-white wrote:
2022-12-28, 18:08
I don't consider "small details" ("little things") neither the wrong display of the REAL "Text Zoom" level nor the fact that the "Text Zoom" level that I have already set (so the one I want) changes when I change "Full Zoom".
I cannot agree with your logic. The full zoom should change the scale of the entire document, the same for all elements of the document. Precisely because it is a FULL zoom. But if you have fixed the scale of the text and do not want it to change, then the full zoom cannot change anything at all, because it MUST change synchronously and equally the scale of all elements, but the scale of the text is already fixed and cannot be changed.
If you are simply not satisfied with the displayed value for the text zoom, then this is easy to fix - display the product of two values. These are really trifles.
To decide on the interpretation, I think that two scale values are applied to the document sequentially. First, a full zoom to the whole document, second - an additional zoom to the text. Such an interpretation is quite convenient for me.
tellu-white wrote:
2022-12-28, 18:08
It is also false that "the browser contains all the functions" as far as "storing site-specific zoom"
...
Just look where and how the site-specific zoom is stored...
tellu-white wrote:
2022-12-28, 18:08
To prove me wrong, please post the code that belongs to Pale Moon and that solves the problems mentioned above.
I have already posted enough code ...

User avatar
tellu-white
Moon lover
Moon lover
Posts: 83
Joined: 2022-03-08, 22:02

Re: Zoom level indicator?

Unread post by tellu-white » 2022-12-28, 19:15

Kris_88 wrote:
2022-12-28, 18:51
To decide on the interpretation, I think that two scale values are applied to the document sequentially. First, a full zoom to the whole document, second - an additional zoom to the text. Such an interpretation is quite convenient for me.
As I said in my reply to Moonchild, In the vast majority of cases, "Text Zoom" is more important than "Full Zoom" because the main problem with some pages is that they are difficult to read (they have the wrong font size). In many cases, changing the value of "Full Zoom" is not desirable because some elements on the page become blurred. I don't think Pale Moon should decide for me that the value of "Text Zoom" should be changed if I just want to change the value of "Full Zoom" ("Text Zoom" being already set to the level I want).
Kris_88 wrote:
2022-12-28, 18:51
But if you have fixed the scale of the text and do not want it to change, then the full zoom cannot change anything at all, because it MUST change synchronously and equally the scale of all elements, but the scale of the text is already fixed and cannot be changed.
These statements are not correct. To figure this out, you only have to look at the pictures I posted when I compared the results produced by the code you provided with the results produced by my add-on.
Kris_88 wrote:
2022-12-28, 18:51
If you are simply not satisfied with the displayed value for the text zoom, then this is easy to fix - display the product of two values. These are really trifles.
It may be easy to change, but it is hard to digest, given the confusion caused by the dissonance between the displayed "Text Zoom" values and the REAL situation on the page!
Kris_88 wrote:
2022-12-28, 18:51
Just look where and how the site-specific zoom is stored ... I have already posted enough code ...
Please don't avoid it with puerile reasons:
tellu-white wrote:
2022-12-28, 18:08
To prove me wrong, please post the code that belongs to Pale Moon and that solves the problems mentioned above.

User avatar
Kris_88
Keeps coming back
Keeps coming back
Posts: 938
Joined: 2021-01-26, 11:18

Re: Zoom level indicator?

Unread post by Kris_88 » 2022-12-28, 19:28

tellu-white wrote:
2022-12-28, 19:15
To prove me wrong, please post the code that belongs to Pale Moon and that solves the problems mentioned above.
I don't think I need it.
Good luck...

Locked