mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-01-07 12:14:11 +01:00
display an informational message when the text zoom value is changed
This commit is contained in:
@@ -40,6 +40,24 @@ function Buffer() //{{{
|
|||||||
for (var i = ZOOM_INTERVAL; i <= zoom_manager.MAX; i += ZOOM_INTERVAL)
|
for (var i = ZOOM_INTERVAL; i <= zoom_manager.MAX; i += ZOOM_INTERVAL)
|
||||||
zoom_manager.zoomFactors.push(i);
|
zoom_manager.zoomFactors.push(i);
|
||||||
|
|
||||||
|
function setZoom(value)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
zoom_manager.textZoom = value;
|
||||||
|
vimperator.echo("Text zoom: " + zoom_manager.textZoom + "%");
|
||||||
|
// TODO: shouldn't this just recalculate hint coords, rather than
|
||||||
|
// unsuccessfully attempt to reshow hints? i.e. isn't it just relying
|
||||||
|
// on the recalculation side effect? -- djk
|
||||||
|
// NOTE: we could really do with a zoom event...
|
||||||
|
vimperator.hints.reshowHints();
|
||||||
|
}
|
||||||
|
catch (e) // Components.results.NS_ERROR_INVALID_ARG
|
||||||
|
{
|
||||||
|
vimperator.echoerr("Zoom value out of range (" + zoom_manager.MIN + "-" + zoom_manager.MAX + ")");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// NOTE: this is only needed as there's currently no way to specify a
|
// NOTE: this is only needed as there's currently no way to specify a
|
||||||
// {count} when calling ZM.reduce()/ZM.enlarge(). TODO: see if we can get
|
// {count} when calling ZM.reduce()/ZM.enlarge(). TODO: see if we can get
|
||||||
// this added to ZoomManager.
|
// this added to ZoomManager.
|
||||||
@@ -62,8 +80,7 @@ function Buffer() //{{{
|
|||||||
else if (next > end)
|
else if (next > end)
|
||||||
next = end;
|
next = end;
|
||||||
|
|
||||||
zoom_manager.textZoom = zoom_manager.zoomFactors[next];
|
setZoom(zoom_manager.zoomFactors[next]);
|
||||||
vimperator.hints.reshowHints();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////}}}
|
/////////////////////////////////////////////////////////////////////////////}}}
|
||||||
@@ -87,20 +104,7 @@ function Buffer() //{{{
|
|||||||
|
|
||||||
this.__defineSetter__("textZoom", function(value)
|
this.__defineSetter__("textZoom", function(value)
|
||||||
{
|
{
|
||||||
try
|
setZoom(value);
|
||||||
{
|
|
||||||
zoom_manager.textZoom = value;
|
|
||||||
}
|
|
||||||
catch (e) // Components.results.NS_ERROR_INVALID_ARG
|
|
||||||
{
|
|
||||||
vimperator.echoerr("Zoom value out of range (" + zoom_manager.MIN + "-" + zoom_manager.MAX + ")");
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO: shouldn't this just recalculate hint coords, rather than
|
|
||||||
// unsuccessfully attempt to reshow hints? i.e. isn't it just relying
|
|
||||||
// on the recalculation side effect? -- djk
|
|
||||||
// NOTE: we could really do with a zoom event...
|
|
||||||
vimperator.hints.reshowHints();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
this.__defineGetter__("title", function()
|
this.__defineGetter__("title", function()
|
||||||
|
|||||||
Reference in New Issue
Block a user