mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-03-17 09:03:36 +01:00
Zoom stuff.
This commit is contained in:
@@ -1229,7 +1229,7 @@ var Editor = Module("editor", XPCOM(Ci.nsIEditActionListener, ModuleBase), {
|
|||||||
},
|
},
|
||||||
{ count: true });
|
{ count: true });
|
||||||
|
|
||||||
mappings.add([modes.TEXT_EDIT, modes.VISUAL],
|
mappings.add([modes.COMMAND],
|
||||||
['"'], "Bind a register to the next command",
|
['"'], "Bind a register to the next command",
|
||||||
function ({ arg }) {
|
function ({ arg }) {
|
||||||
editor.currentRegister = arg;
|
editor.currentRegister = arg;
|
||||||
|
|||||||
@@ -175,7 +175,10 @@ var Buffer = Module("Buffer", {
|
|||||||
* @property {number} The current browser's zoom level, as a
|
* @property {number} The current browser's zoom level, as a
|
||||||
* percentage with 100 as 'normal'.
|
* percentage with 100 as 'normal'.
|
||||||
*/
|
*/
|
||||||
get zoomLevel() this.contentViewer[this.fullZoom ? "fullZoom" : "textZoom"] * 100,
|
get zoomLevel() {
|
||||||
|
let v = this.contentViewer;
|
||||||
|
return v[v.textZoom == 1 ? "fullZoom" : "textZoom"] * 100
|
||||||
|
},
|
||||||
set zoomLevel(value) { this.setZoom(value, this.fullZoom); },
|
set zoomLevel(value) { this.setZoom(value, this.fullZoom); },
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1162,7 +1165,7 @@ var Buffer = Module("Buffer", {
|
|||||||
fullZoom = ZoomManager.useFullZoom;
|
fullZoom = ZoomManager.useFullZoom;
|
||||||
|
|
||||||
let values = ZoomManager.zoomValues;
|
let values = ZoomManager.zoomValues;
|
||||||
let cur = values.indexOf(ZoomManager.snap(this.zoom));
|
let cur = values.indexOf(ZoomManager.snap(this.zoomLevel / 100));
|
||||||
let i = Math.constrain(cur + steps, 0, values.length - 1);
|
let i = Math.constrain(cur + steps, 0, values.length - 1);
|
||||||
|
|
||||||
util.assert(i != cur || fullZoom != ZoomManager.useFullZoom);
|
util.assert(i != cur || fullZoom != ZoomManager.useFullZoom);
|
||||||
|
|||||||
Reference in New Issue
Block a user