mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-07 05:31:22 +00:00
GUAC-642: Control display of scroll bars directly.
This commit is contained in:
@@ -785,11 +785,19 @@ GuacUI.Client.setScale = function(new_scale) {
|
|||||||
|
|
||||||
GuacUI.Client.zoom_state.textContent = Math.round(new_scale * 100) + "%";
|
GuacUI.Client.zoom_state.textContent = Math.round(new_scale * 100) + "%";
|
||||||
|
|
||||||
// Auto-fit is enabled iff minimum zoom level
|
// If at minimum zoom level, auto fit is ON
|
||||||
GuacUI.Client.auto_fit.checked = (new_scale === GuacUI.Client.min_zoom);
|
if (new_scale === GuacUI.Client.min_zoom) {
|
||||||
|
GuacUI.Client.main.style.overflow = "hidden";
|
||||||
|
GuacUI.Client.auto_fit.checked = true;
|
||||||
|
GuacUI.Client.auto_fit.disabled = (GuacUI.Client.min_zoom >= 1);
|
||||||
|
}
|
||||||
|
|
||||||
// Disable auto-fit if zoom is required
|
// If at minimum zoom level, auto fit is OFF
|
||||||
GuacUI.Client.auto_fit.disabled = (GuacUI.Client.min_zoom >= 1 && new_scale === GuacUI.Client.min_zoom);
|
else {
|
||||||
|
GuacUI.Client.main.style.overflow = "auto";
|
||||||
|
GuacUI.Client.auto_fit.checked = false;
|
||||||
|
GuacUI.Client.auto_fit.disabled = false;
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1524,29 +1532,21 @@ GuacUI.Client.attach = function(guac) {
|
|||||||
* Send size events on resize
|
* Send size events on resize
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var resize_timeout = null;
|
|
||||||
|
|
||||||
window.onresize = function() {
|
window.onresize = function() {
|
||||||
|
|
||||||
// Remove scrollbars during resize
|
// Remove scrollbars during resize
|
||||||
GuacUI.Client.main.style.overflow = "hidden";
|
GuacUI.Client.main.style.overflow = "hidden";
|
||||||
|
|
||||||
// Wait for resize to settle before updating
|
var pixel_density = window.devicePixelRatio || 1;
|
||||||
window.clearTimeout(resize_timeout);
|
var width = window.innerWidth * pixel_density;
|
||||||
resize_timeout = window.setTimeout(function() {
|
var height = window.innerHeight * pixel_density;
|
||||||
|
|
||||||
var pixel_density = window.devicePixelRatio || 1;
|
GuacUI.Client.main.style.overflow = "auto";
|
||||||
var width = window.innerWidth * pixel_density;
|
|
||||||
var height = window.innerHeight * pixel_density;
|
|
||||||
|
|
||||||
GuacUI.Client.main.style.overflow = "auto";
|
if (GuacUI.Client.attachedClient)
|
||||||
|
GuacUI.Client.attachedClient.sendSize(width, height);
|
||||||
|
|
||||||
if (GuacUI.Client.attachedClient)
|
GuacUI.Client.updateDisplayScale();
|
||||||
GuacUI.Client.attachedClient.sendSize(width, height);
|
|
||||||
|
|
||||||
GuacUI.Client.updateDisplayScale();
|
|
||||||
|
|
||||||
}, 10);
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user