From d19f7b12d950e23c739412d8a9d85da0cff7bb5a Mon Sep 17 00:00:00 2001 From: skomerko <168652295+skomerko@users.noreply.github.com> Date: Mon, 16 Sep 2024 11:41:14 +0200 Subject: [PATCH] WebUI: Improve hash copy actions in context menu This PR provides better feedback for hash context menu actions and now it is clearly shown if there is anything to copy. PR #21321. --- src/webui/www/private/css/style.css | 30 ++++++++++---------- src/webui/www/private/index.html | 4 +-- src/webui/www/private/scripts/contextmenu.js | 41 ++++++++++++++++++++++------ 3 files changed, 48 insertions(+), 27 deletions(-) diff --git a/src/webui/www/private/css/style.css b/src/webui/www/private/css/style.css index 9e6947f7a..6613dcad5 100644 --- a/src/webui/www/private/css/style.css +++ b/src/webui/www/private/css/style.css @@ -225,6 +225,18 @@ a.propButton img { .contextMenu li { margin: 0; padding: 0; + user-select: none; +} + +.contextMenu li.disabled { + background-color: transparent; + cursor: default; + filter: grayscale(1); + opacity: 0.6; +} + +.contextMenu li.disabled a { + pointer-events: none; } .contextMenu li a { @@ -248,14 +260,6 @@ a.propButton img { filter: var(--color-icon-hover); } -.contextMenu li a.disabled { - font-style: italic; -} - -.contextMenu li a.disabled:hover { - color: var(--color-text-disabled); -} - .contextMenu li ul { background: var(--color-background-default); border: 1px solid var(--color-border-default); @@ -272,19 +276,13 @@ a.propButton img { position: relative; } -.contextMenu li a.arrow-right, -.contextMenu li a:hover.arrow-right { +.contextMenu li:not(.disabled) .arrow-right { background-image: url("../images/arrow-right.gif"); background-position: right center; background-repeat: no-repeat; } -.contextMenu li:hover ul, -.contextMenu li.ieHover ul, -.contextMenu li li.ieHover ul, -.contextMenu li li li.ieHover ul, -.contextMenu li li:hover ul, -.contextMenu li li li:hover ul { +.contextMenu li:not(.disabled):hover > ul { /* lists nested under hovered list items */ left: auto; } diff --git a/src/webui/www/private/index.html b/src/webui/www/private/index.html index 0b243cc18..44f3c1af6 100644 --- a/src/webui/www/private/index.html +++ b/src/webui/www/private/index.html @@ -198,8 +198,8 @@ QBT_TR(Copy)QBT_TR[CONTEXT=TransferListWidget] QBT_TR(Copy)QBT_TR[CONTEXT=TransferListWidget]