mirror of
https://github.com/Eugeny/tabby.git
synced 2025-02-23 14:59:41 +08:00
Bugfix - Terminal Docking Issues (#1145)
Bugfix - Terminal Docking Issues
This commit is contained in:
commit
0896844e96
@ -1,7 +1,7 @@
|
||||
appearance:
|
||||
dock: off
|
||||
dockScreen: current
|
||||
dockFill: 50
|
||||
dockFill: 0.5
|
||||
tabsLocation: top
|
||||
cycleTabs: true
|
||||
theme: Standard
|
||||
|
@ -30,7 +30,8 @@ export class DockingService {
|
||||
}
|
||||
|
||||
const newBounds: Bounds = { x: 0, y: 0, width: 0, height: 0 }
|
||||
const fill = this.config.store.appearance.dockFill
|
||||
|
||||
const fill = this.config.store.appearance.dockFill <= 1 ? this.config.store.appearance.dockFill : 1;
|
||||
const [minWidth, minHeight] = this.hostApp.getWindow().getMinimumSize()
|
||||
|
||||
if (dockSide === 'left' || dockSide === 'right') {
|
||||
@ -63,15 +64,15 @@ export class DockingService {
|
||||
}
|
||||
|
||||
getScreens () {
|
||||
return this.electron.screen.getAllDisplays().map((display, index) => {
|
||||
const primaryDisplayID = this.electron.screen.getPrimaryDisplay().id;
|
||||
return this.electron.screen.getAllDisplays().sort((a,b) => (
|
||||
a.bounds.x === b.bounds.x ? a.bounds.y - b.bounds.y : a.bounds.x - b.bounds.x
|
||||
)).map((display,index) => {
|
||||
return {
|
||||
id: display.id,
|
||||
name: [
|
||||
'Primary display',
|
||||
'Secondary display',
|
||||
][index] || `Display ${index + 1}`,
|
||||
name: display.id === primaryDisplayID ? 'Primary Display' : `Display ${index +1}`,
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
private repositionWindow () {
|
||||
|
@ -1,7 +1,7 @@
|
||||
import * as yaml from 'js-yaml'
|
||||
import * as os from 'os'
|
||||
import { Subscription } from 'rxjs'
|
||||
import { Component, Inject, Input, HostBinding } from '@angular/core'
|
||||
import { Component, Inject, Input, HostBinding, NgZone } from '@angular/core'
|
||||
import {
|
||||
ElectronService,
|
||||
DockingService,
|
||||
@ -47,6 +47,7 @@ export class SettingsTabComponent extends BaseTabComponent {
|
||||
public hostApp: HostAppService,
|
||||
public homeBase: HomeBaseService,
|
||||
public shellIntegration: ShellIntegrationService,
|
||||
public zone: NgZone,
|
||||
hotkeys: HotkeysService,
|
||||
@Inject(SettingsTabProvider) public settingsProviders: SettingsTabProvider[],
|
||||
@Inject(Theme) public themes: Theme[],
|
||||
@ -68,6 +69,14 @@ export class SettingsTabComponent extends BaseTabComponent {
|
||||
this.configSubscription = config.changed$.subscribe(onConfigChange)
|
||||
onConfigChange()
|
||||
|
||||
const onScreenChange = () => {
|
||||
this.zone.run(() => this.screens = this.docking.getScreens());
|
||||
}
|
||||
|
||||
electron.screen.on('display-added', onScreenChange);
|
||||
electron.screen.on('display-removed', onScreenChange);
|
||||
electron.screen.on('display-metrics-changed', onScreenChange);
|
||||
|
||||
hotkeys.getHotkeyDescriptions().then(descriptions => {
|
||||
this.hotkeyDescriptions = descriptions
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user