Tooltip improvements

This commit is contained in:
Nils Maier 2019-09-05 09:03:50 +02:00
parent 639a582804
commit 5c2700ca36
2 changed files with 11 additions and 4 deletions

View File

@ -439,6 +439,8 @@ body > * {
justify-items: stretch;
border-radius: 4px;
box-shadow: 2px 2px 6px black;
-webkit-user-select: none;
user-select: none;
}
#tooltip-infos {

View File

@ -609,8 +609,12 @@ export class DownloadTable extends VirtualTable {
this.selection.clear();
this.tooltip = null;
this.on("hover", async info => {
if (!(await Prefs.get("tooltip"))) {
const tooltipWatcher = new PrefWatcher("tooltip", true);
this.on("hover", info => {
if (!document.hasFocus()) {
return;
}
if (!tooltipWatcher.value) {
return;
}
const item = this.downloads.filtered[info.rowid];
@ -804,6 +808,7 @@ export class DownloadTable extends VirtualTable {
}
async openFile() {
this.dismissTooltip();
const {focusRow} = this;
if (focusRow < 0) {
return;
@ -823,8 +828,8 @@ export class DownloadTable extends VirtualTable {
}
finally {
setTimeout(() => {
item.opening = false;
this.invalidateRow(focusRow);
item.opening = false;
this.invalidateRow(focusRow);
}, 500);
}
}