Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2261)

Unified Diff: Source/devtools/front_end/ui/SplitView.js

Issue 342683008: [DevTools] Fix UI extreme cases: very small window and very large zoom. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/devtools/front_end/main/AdvancedApp.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/ui/SplitView.js
diff --git a/Source/devtools/front_end/ui/SplitView.js b/Source/devtools/front_end/ui/SplitView.js
index 8de09e72e2228c22488f2c126016fa1b355a8fb6..2974515343267d7c1574663cbb41518652dae804 100644
--- a/Source/devtools/front_end/ui/SplitView.js
+++ b/Source/devtools/front_end/ui/SplitView.js
@@ -34,8 +34,9 @@
* @param {string=} settingName
* @param {number=} defaultSidebarWidth
* @param {number=} defaultSidebarHeight
+ * @param {boolean=} constraintsInDip
*/
-WebInspector.SplitView = function(isVertical, secondIsSidebar, settingName, defaultSidebarWidth, defaultSidebarHeight)
+WebInspector.SplitView = function(isVertical, secondIsSidebar, settingName, defaultSidebarWidth, defaultSidebarHeight, constraintsInDip)
{
WebInspector.View.call(this);
@@ -68,6 +69,7 @@ WebInspector.SplitView = function(isVertical, secondIsSidebar, settingName, defa
this._defaultSidebarWidth = defaultSidebarWidth || 200;
this._defaultSidebarHeight = defaultSidebarHeight || this._defaultSidebarWidth;
+ this._constraintsInDip = !!constraintsInDip;
this._settingName = settingName;
this.setSecondIsSidebar(secondIsSidebar);
@@ -367,6 +369,7 @@ WebInspector.SplitView.prototype = {
*/
setSidebarSize: function(size)
{
+ size *= WebInspector.zoomManager.zoomFactor();
this._savedSidebarSize = size;
this._saveSetting();
this._innerSetSidebarSize(size, false, true);
@@ -377,7 +380,8 @@ WebInspector.SplitView.prototype = {
*/
sidebarSize: function()
{
- return Math.max(0, this._sidebarSize);
+ var size = Math.max(0, this._sidebarSize);
+ return size / WebInspector.zoomManager.zoomFactor();
},
/**
@@ -565,7 +569,7 @@ WebInspector.SplitView.prototype = {
_applyConstraints: function(sidebarSize, userAction)
{
var totalSize = this._totalSizeDIP();
- var zoomFactor = WebInspector.zoomManager.zoomFactor();
+ var zoomFactor = this._constraintsInDip ? 1 : WebInspector.zoomManager.zoomFactor();
var constraints = this._sidebarView.constraints();
var minSidebarSize = this.isVertical() ? constraints.minimum.width : constraints.minimum.height;
@@ -593,7 +597,7 @@ WebInspector.SplitView.prototype = {
preferredMainSize *= zoomFactor;
var savedMainSize = this.isVertical() ? this._savedVerticalMainSize : this._savedHorizontalMainSize;
if (typeof savedMainSize !== "undefined")
- preferredMainSize = Math.min(preferredMainSize, savedMainSize);
+ preferredMainSize = Math.min(preferredMainSize, savedMainSize * zoomFactor);
if (userAction)
preferredMainSize = minMainSize;
« no previous file with comments | « Source/devtools/front_end/main/AdvancedApp.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698