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

View File

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