fixed transfers dropdown being clipped by the terminal - fixes #4688

上级 b5cf66c2
...@@ -57,15 +57,20 @@ title-bar( ...@@ -57,15 +57,20 @@ title-bar(
div([class.ml-3]='hasIcons(button.submenuItems)') {{item.title}} div([class.ml-3]='hasIcons(button.submenuItems)') {{item.title}}
.d-flex( .d-flex(
*ngIf='activeTransfers.length > 0',
ngbDropdown, ngbDropdown,
[(open)]='activeTransfersDropdownOpen' container='body',
#activeTransfersDropdown='ngbDropdown'
) )
button.btn.btn-secondary.btn-tab-bar( button.btn.btn-secondary.btn-tab-bar(
*ngIf='activeTransfers.length > 0',
title='File transfers', title='File transfers',
ngbDropdownToggle ngbDropdownToggle
) !{require('../icons/download-solid.svg')} ) !{require('../icons/download-solid.svg')}
transfers-menu(ngbDropdownMenu, [(transfers)]='activeTransfers') transfers-menu(
ngbDropdownMenu,
[(transfers)]='activeTransfers',
(transfersChange)='onTransfersChange()'
)
.drag-space.background([class.persistent]='config.store.appearance.frame == "thin" && hostApp.platform != Platform.macOS') .drag-space.background([class.persistent]='config.store.appearance.frame == "thin" && hostApp.platform != Platform.macOS')
......
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */ /* eslint-disable @typescript-eslint/explicit-module-boundary-types */
import { Component, Inject, Input, HostListener, HostBinding, ViewChildren } from '@angular/core' import { Component, Inject, Input, HostListener, HostBinding, ViewChildren, ViewChild } from '@angular/core'
import { trigger, style, animate, transition, state } from '@angular/animations' import { trigger, style, animate, transition, state } from '@angular/animations'
import { NgbModal } from '@ng-bootstrap/ng-bootstrap' import { NgbDropdown, NgbModal } from '@ng-bootstrap/ng-bootstrap'
import { CdkDragDrop, moveItemInArray } from '@angular/cdk/drag-drop' import { CdkDragDrop, moveItemInArray } from '@angular/cdk/drag-drop'
import { HostAppService, Platform } from '../api/hostApp' import { HostAppService, Platform } from '../api/hostApp'
...@@ -60,10 +60,10 @@ export class AppRootComponent { ...@@ -60,10 +60,10 @@ export class AppRootComponent {
@HostBinding('class.platform-linux') platformClassLinux = process.platform === 'linux' @HostBinding('class.platform-linux') platformClassLinux = process.platform === 'linux'
@HostBinding('class.no-tabs') noTabs = true @HostBinding('class.no-tabs') noTabs = true
@ViewChildren(TabBodyComponent) tabBodies: TabBodyComponent[] @ViewChildren(TabBodyComponent) tabBodies: TabBodyComponent[]
@ViewChild('activeTransfersDropdown') activeTransfersDropdown: NgbDropdown
unsortedTabs: BaseTabComponent[] = [] unsortedTabs: BaseTabComponent[] = []
updatesAvailable = false updatesAvailable = false
activeTransfers: FileTransfer[] = [] activeTransfers: FileTransfer[] = []
activeTransfersDropdownOpen = false
private logger: Logger private logger: Logger
constructor ( constructor (
...@@ -147,7 +147,7 @@ export class AppRootComponent { ...@@ -147,7 +147,7 @@ export class AppRootComponent {
platform.fileTransferStarted$.subscribe(transfer => { platform.fileTransferStarted$.subscribe(transfer => {
this.activeTransfers.push(transfer) this.activeTransfers.push(transfer)
this.activeTransfersDropdownOpen = true this.activeTransfersDropdown.open()
}) })
config.ready$.toPromise().then(() => { config.ready$.toPromise().then(() => {
...@@ -200,6 +200,12 @@ export class AppRootComponent { ...@@ -200,6 +200,12 @@ export class AppRootComponent {
this.app.emitTabsChanged() this.app.emitTabsChanged()
} }
onTransfersChange () {
if (this.activeTransfers.length === 0) {
this.activeTransfersDropdown.close()
}
}
private getToolbarButtons (aboveZero: boolean): ToolbarButton[] { private getToolbarButtons (aboveZero: boolean): ToolbarButton[] {
let buttons: ToolbarButton[] = [] let buttons: ToolbarButton[] = []
this.config.enabledServices(this.toolbarButtonProviders).forEach(provider => { this.config.enabledServices(this.toolbarButtonProviders).forEach(provider => {
......
...@@ -51,3 +51,7 @@ ...@@ -51,3 +51,7 @@
button { button {
flex: none; flex: none;
} }
svg {
height: 14px;
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册