mirror of
https://github.com/Eugeny/tabby
synced 2024-12-13 23:02:41 +00:00
.
This commit is contained in:
parent
6cb5351460
commit
791822be12
3 changed files with 8 additions and 7 deletions
|
@ -24,7 +24,7 @@ title-bar(
|
|||
|
||||
.btn-group
|
||||
button.btn.btn-secondary.btn-tab-bar(
|
||||
*ngFor='let button of getLeftToolbarButtons()',
|
||||
*ngFor='let button of leftToolbarButtons',
|
||||
[title]='button.title',
|
||||
(click)='button.click()',
|
||||
)
|
||||
|
@ -34,7 +34,7 @@ title-bar(
|
|||
|
||||
.btn-group
|
||||
button.btn.btn-secondary.btn-tab-bar(
|
||||
*ngFor='let button of getRightToolbarButtons()',
|
||||
*ngFor='let button of rightToolbarButtons',
|
||||
[title]='button.title',
|
||||
(click)='button.click()',
|
||||
)
|
||||
|
|
|
@ -44,6 +44,8 @@ export class AppRootComponent {
|
|||
toasterConfig: ToasterConfig
|
||||
Platform = Platform
|
||||
@Input() ready = false
|
||||
@Input() leftToolbarButtons: IToolbarButton[]
|
||||
@Input() rightToolbarButtons: IToolbarButton[]
|
||||
private logger: Logger
|
||||
|
||||
constructor (
|
||||
|
@ -68,6 +70,9 @@ export class AppRootComponent {
|
|||
timeout: 4000,
|
||||
})
|
||||
|
||||
this.leftToolbarButtons = this.getToolbarButtons(false)
|
||||
this.rightToolbarButtons = this.getToolbarButtons(true)
|
||||
|
||||
this.hotkeys.matchedHotkey.subscribe((hotkey) => {
|
||||
if (hotkey.startsWith('tab-')) {
|
||||
let index = parseInt(hotkey.split('-')[1])
|
||||
|
@ -126,10 +131,6 @@ export class AppRootComponent {
|
|||
}
|
||||
}
|
||||
|
||||
getLeftToolbarButtons (): IToolbarButton[] { return this.getToolbarButtons(false) }
|
||||
|
||||
getRightToolbarButtons (): IToolbarButton[] { return this.getToolbarButtons(true) }
|
||||
|
||||
async ngOnInit () {
|
||||
await this.tabRecovery.recoverTabs()
|
||||
this.ready = true
|
||||
|
|
|
@ -115,7 +115,7 @@ export class HotkeysService {
|
|||
for (let sequence of this.getHotkeysConfig()[id]) {
|
||||
let currentStrokes = this.getCurrentKeystrokes()
|
||||
if (currentStrokes.length < sequence.length) {
|
||||
break
|
||||
continue
|
||||
}
|
||||
if (sequence.every((x, index) => {
|
||||
return x.toLowerCase() === currentStrokes[currentStrokes.length - sequence.length + index].toLowerCase()
|
||||
|
|
Loading…
Reference in a new issue