fixed glitchy window drag in macOS - fixes #4324

This commit is contained in:
Eugene Pankov 2021-08-02 09:17:08 +02:00
parent 3b09dfa145
commit 4e4788bf57
No known key found for this signature in database
GPG Key ID: 5896FCBBDD1CF4F4
3 changed files with 18 additions and 14 deletions

View File

@ -182,17 +182,6 @@ export class AppRootComponent {
return this.config.store.appearance.tabsLocation === 'left' || this.config.store.appearance.tabsLocation === 'right'
}
onTabDragStart (tab: BaseTabComponent) {
this.app.emitTabDragStarted(tab)
}
onTabDragEnd () {
setTimeout(() => {
this.app.emitTabDragEnded()
this.app.emitTabsChanged()
})
}
async generateButtonSubmenu (button: ToolbarButton) {
if (button.submenu) {
button.submenuItems = await button.submenu()

View File

@ -2,13 +2,17 @@
.progressbar([style.width]='progress + "%"', *ngIf='progress != null')
.activity-indicator(*ngIf='tab.activity$|async')
ng-container(*ngIf='!config.store.terminal.hideTabIndex')
.index(*ngIf='hostApp.platform === Platform.macOS', cdkDragHandle) {{index + 1}}
.index(*ngIf='hostApp.platform !== Platform.macOS') {{index + 1}}
.index(*ngIf='!config.store.terminal.hideTabIndex && hostApp.platform === Platform.macOS', cdkDragHandle) {{index + 1}}
.index(*ngIf='!config.store.terminal.hideTabIndex && hostApp.platform !== Platform.macOS') {{index + 1}}
.name(
[title]='tab.customTitle || tab.title',
[class.no-hover]='config.store.terminal.hideCloseButton'
cdkDrag,
cdkDragRootElement='tab-header',
[cdkDragData]='tab',
(cdkDragStarted)='onTabDragStart(tab)',
(cdkDragEnded)='onTabDragEnd()',
) {{tab.customTitle || tab.title}}
button(*ngIf='!config.store.terminal.hideCloseButton',(click)='app.closeTab(tab, true)') ×

View File

@ -72,6 +72,17 @@ export class TabHeaderComponent extends BaseComponent {
return items.slice(1)
}
onTabDragStart (tab: BaseTabComponent) {
this.app.emitTabDragStarted(tab)
}
onTabDragEnd () {
setTimeout(() => {
this.app.emitTabDragEnded()
this.app.emitTabsChanged()
})
}
@HostBinding('class.flex-width') get isFlexWidthEnabled (): boolean {
return this.config.store.appearance.flexTabs
}