소스 검색

Some docking fixes (fixed #13)

Eugene Pankov 8 년 전
부모
커밋
d4840bafaf

+ 2 - 2
terminus-core/src/services/docking.service.ts

@@ -40,12 +40,12 @@ export class DockingService {
             newBounds.height = Math.round(fill * display.bounds.height)
         }
         if (dockSide === 'right') {
-            newBounds.x = display.bounds.x + display.bounds.width * (1.0 - fill)
+            newBounds.x = display.bounds.x + Math.round(display.bounds.width * (1.0 - fill))
         } else {
             newBounds.x = display.bounds.x
         }
         if (dockSide === 'bottom') {
-            newBounds.y = display.bounds.y + display.bounds.height * (1.0 - fill)
+            newBounds.y = display.bounds.y + Math.round(display.bounds.height * (1.0 - fill))
         } else {
             newBounds.y = display.bounds.y
         }

+ 4 - 4
terminus-settings/src/components/settingsTab.component.pug

@@ -109,17 +109,17 @@ ngb-tabset.vertical(type='tabs')
                                 label Display on
                                 br
                                 div(
-                                    '[(ngModel)]'='config.store.appearance.dockScreen'
-                                    '(ngModelChange)'='config.save(); docking.dock()'
+                                    [(ngModel)]='config.store.appearance.dockScreen',
+                                    (ngModelChange)='config.save(); docking.dock()',
                                     ngbRadioGroup
                                 )
                                     label.btn.btn-secondary
                                         input(
                                             type='radio',
-                                            [value]='"current"'
+                                            value='current'
                                         )
                                         | Current
-                                    label.btn.btn-secondary(*ngFor='let screen of docking.getScreens()')
+                                    label.btn.btn-secondary(*ngFor='let screen of screens')
                                         input(
                                             type='radio',
                                             [value]='screen.id'

+ 2 - 0
terminus-settings/src/components/settingsTab.component.ts

@@ -14,6 +14,7 @@ import { SettingsTabProvider } from '../api'
 export class SettingsTabComponent extends BaseTabComponent {
     hotkeyFilter = ''
     private hotkeyDescriptions: IHotkeyDescription[]
+    private screens
 
     constructor (
         public config: ConfigService,
@@ -28,6 +29,7 @@ export class SettingsTabComponent extends BaseTabComponent {
         this.hotkeyDescriptions = hotkeyProviders.map(x => x.hotkeys).reduce((a, b) => a.concat(b))
         this.title$.next('Settings')
         this.scrollable = true
+        this.screens = this.docking.getScreens()
     }
 
     getRecoveryToken (): any {