1
1
mirror of https://github.com/Eugeny/tabby.git synced 2024-11-24 06:04:04 +03:00

fixed settings sidebar offset (fixes #549)

This commit is contained in:
Eugene Pankov 2018-12-10 11:27:32 +01:00
parent 76e8652492
commit a091f46100
2 changed files with 15 additions and 7 deletions

View File

@ -1,14 +1,13 @@
import * as yaml from 'js-yaml'
import * as os from 'os'
import { Subscription } from 'rxjs'
import { Component, Inject, Input } from '@angular/core'
import { Component, Inject, Input, HostBinding } from '@angular/core'
import { HotkeysService } from 'terminus-core'
import {
ElectronService,
DockingService,
ConfigService,
IHotkeyDescription,
HotkeyProvider,
BaseTabComponent,
Theme,
HostAppService,
@ -37,6 +36,7 @@ export class SettingsTabComponent extends BaseTabComponent {
configFile: string
isShellIntegrationInstalled = false
isFluentVibrancySupported = false
@HostBinding('class.pad-window-controls') padWindowControls = false
private configSubscription: Subscription
constructor (
@ -47,7 +47,6 @@ export class SettingsTabComponent extends BaseTabComponent {
public homeBase: HomeBaseService,
public shellIntegration: ShellIntegrationService,
hotkeys: HotkeysService,
@Inject(HotkeyProvider) hotkeyProviders: HotkeyProvider[],
@Inject(SettingsTabProvider) public settingsProviders: SettingsTabProvider[],
@Inject(Theme) public themes: Theme[],
) {
@ -58,16 +57,21 @@ export class SettingsTabComponent extends BaseTabComponent {
this.themes = config.enabledServices(this.themes)
this.configDefaults = yaml.safeDump(config.getDefaults())
this.configFile = config.readRaw()
this.configSubscription = config.changed$.subscribe(() => {
const onConfigChange = () => {
this.configFile = config.readRaw()
})
this.padWindowControls = hostApp.platform === Platform.macOS
&& config.store.appearance.tabsLocation === 'bottom'
}
this.configSubscription = config.changed$.subscribe(onConfigChange)
onConfigChange()
hotkeys.getHotkeyDescriptions().then(descriptions => {
this.hotkeyDescriptions = descriptions
})
this.isFluentVibrancySupported = process.platform === 'win32'
this.isFluentVibrancySupported = hostApp.platform === Platform.Windows
&& parseFloat(os.release()) >= 10
&& parseInt(os.release().split('.')[2]) >= 17063
}

View File

@ -21,3 +21,7 @@
:host /deep/ ngb-tabset > .tab-content > .tab-pane {
width: 100%;
}
:host.pad-window-controls /deep/ ngb-tabset > .nav {
padding-top: 40px;
}