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; justify-items: stretch;
border-radius: 4px; border-radius: 4px;
box-shadow: 2px 2px 6px black; box-shadow: 2px 2px 6px black;
-webkit-user-select: none;
user-select: none;
} }
#tooltip-infos { #tooltip-infos {

View File

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