OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 cr.exportPath('options'); | 5 cr.exportPath('options'); |
6 | 6 |
7 /** | 7 /** |
8 * @typedef {{ | 8 * @typedef {{ |
9 * availableColorProfiles: Array<{profileId: number, name: string}>, | 9 * availableColorProfiles: Array<{profileId: number, name: string}>, |
10 * colorProfile: number, | 10 * colorProfile: number, |
(...skipping 725 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
736 // The width/height should be same as the first display: | 736 // The width/height should be same as the first display: |
737 var width = Math.ceil(this.displays_[0].width * this.visualScale_); | 737 var width = Math.ceil(this.displays_[0].width * this.visualScale_); |
738 var height = Math.ceil(this.displays_[0].height * this.visualScale_); | 738 var height = Math.ceil(this.displays_[0].height * this.visualScale_); |
739 | 739 |
740 var numDisplays = Math.max(MIN_NUM_DISPLAYS, this.displays_.length); | 740 var numDisplays = Math.max(MIN_NUM_DISPLAYS, this.displays_.length); |
741 | 741 |
742 var totalWidth = width + numDisplays * MIRRORING_OFFSET_PIXELS; | 742 var totalWidth = width + numDisplays * MIRRORING_OFFSET_PIXELS; |
743 var totalHeight = height + numDisplays * MIRRORING_OFFSET_PIXELS; | 743 var totalHeight = height + numDisplays * MIRRORING_OFFSET_PIXELS; |
744 | 744 |
745 this.displaysView_.style.height = totalHeight + 'px'; | 745 this.displaysView_.style.height = totalHeight + 'px'; |
746 this.displaysView_.classList.add( | |
747 'display-options-displays-view-mirroring'); | |
748 | 746 |
749 // The displays should be centered. | 747 // The displays should be centered. |
750 var offsetX = | 748 var offsetX = |
751 $('display-options-displays-view').offsetWidth / 2 - totalWidth / 2; | 749 $('display-options-displays-view').offsetWidth / 2 - totalWidth / 2; |
752 | 750 |
753 for (var i = 0; i < numDisplays; i++) { | 751 for (var i = 0; i < numDisplays; i++) { |
754 var div = document.createElement('div'); | 752 var div = document.createElement('div'); |
755 div.className = 'displays-display'; | 753 div.className = 'displays-display'; |
756 div.style.top = i * MIRRORING_OFFSET_PIXELS + 'px'; | 754 div.style.top = i * MIRRORING_OFFSET_PIXELS + 'px'; |
757 div.style.left = i * MIRRORING_OFFSET_PIXELS + offsetX + 'px'; | 755 div.style.left = i * MIRRORING_OFFSET_PIXELS + offsetX + 'px'; |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
956 mirroring, displays, layout, offset) { | 954 mirroring, displays, layout, offset) { |
957 DisplayOptions.getInstance().onDisplayChanged_( | 955 DisplayOptions.getInstance().onDisplayChanged_( |
958 mirroring, displays, layout, offset); | 956 mirroring, displays, layout, offset); |
959 }; | 957 }; |
960 | 958 |
961 // Export | 959 // Export |
962 return { | 960 return { |
963 DisplayOptions: DisplayOptions | 961 DisplayOptions: DisplayOptions |
964 }; | 962 }; |
965 }); | 963 }); |
OLD | NEW |