[desktop] fix bug 42729

This commit is contained in:
Maxim Kadushkin 2020-03-15 18:13:29 +03:00
parent aa984412b2
commit 586d26619f
3 changed files with 12 additions and 4 deletions

View file

@ -236,7 +236,8 @@ define([
var win_width = (this.initConfig.width=='auto') ? parseInt(this.$window.find('.body').css('width')) : this.initConfig.width;
var top = Math.floor((parseInt(main_height) - parseInt(win_height)) / 2);
var top = Common.Utils.InternalSettings.get('window-inactive-area-top') +
Math.floor((parseInt(main_height) - parseInt(win_height)) / 2);
var left = Math.floor((parseInt(main_width) - parseInt(win_width)) / 2);
this.$window.css('left',left);
@ -311,10 +312,11 @@ define([
if (this.dragging.enabled) {
var zoom = (event instanceof jQuery.Event) ? Common.Utils.zoom() : 1,
left = event.pageX*zoom - this.dragging.initx,
top = event.pageY*zoom - this.dragging.inity;
top = event.pageY*zoom - this.dragging.inity,
topedge = Common.Utils.InternalSettings.get('window-inactive-area-top');
left < 0 ? (left = 0) : left > this.dragging.maxx && (left = this.dragging.maxx);
top < 0 ? (top = 0) : top > this.dragging.maxy && (top = this.dragging.maxy);
top < topedge ? (top = topedge) : top > this.dragging.maxy && (top = this.dragging.maxy);
this.$window.css({left: left, top: top});
}

View file

@ -87,6 +87,10 @@ define([
Common.NotificationCenter.trigger('app:config', {canUndock:true});
}
}
if (_.isNumber(obj.skiptoparea)) {
Common.Utils.InternalSettings.set('window-inactive-area-top', obj.skiptoparea);
}
} else
if (/window:status/.test(cmd)) {
var obj = JSON.parse(param);

View file

@ -214,8 +214,9 @@ Common.Utils = _.extend(new(function() {
documentSettingsType: documentSettingsType,
importTextType: importTextType,
zoom: function() {return me.zoom;},
topOffset: 0,
innerWidth: function() {return me.innerWidth;},
innerHeight: function() {return me.innerHeight;}
innerHeight: function() {return me.innerHeight - Common.Utils.InternalSettings.get('window-inactive-area-top');}
}
})(), Common.Utils || {});
@ -891,6 +892,7 @@ Common.Utils.InternalSettings.set('toolbar-height-tabs', 32);
Common.Utils.InternalSettings.set('toolbar-height-tabs-top-title', 28);
Common.Utils.InternalSettings.set('toolbar-height-controls', 67);
Common.Utils.InternalSettings.set('document-title-height', 28);
Common.Utils.InternalSettings.set('window-inactive-area-top', 0);
Common.Utils.InternalSettings.set('toolbar-height-compact', Common.Utils.InternalSettings.get('toolbar-height-tabs'));
Common.Utils.InternalSettings.set('toolbar-height-normal', Common.Utils.InternalSettings.get('toolbar-height-tabs') + Common.Utils.InternalSettings.get('toolbar-height-controls'));