Skip to content

Commit dc50826

Browse files
committed
enhance: hide mouse cursor after a timeout
1 parent 24227fd commit dc50826

2 files changed

Lines changed: 9 additions & 16 deletions

File tree

src/styles/layout/modes.css

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
}
4646
}
4747

48-
& .column{
48+
& .column {
4949
/* to show outline card buttons*/
5050
padding: 0 calc(1 / var(--zoom-level) * 50vw);
5151
}
@@ -87,7 +87,6 @@
8787
}
8888
}
8989

90-
9190
/* to prevent cards from wobbling when hovering over them */
9291
#columns-container.zoom-enabled {
9392
* {
@@ -96,8 +95,8 @@
9695
}
9796

9897
#columns-container.zoom-enabled {
99-
.lineage-floating-button{
100-
opacity: 0.5 !important
98+
.lineage-floating-button {
99+
opacity: 0.5 !important;
101100
}
102101
.lineage-card:not(:hover) .lineage-floating-button:not(.collapse-button) {
103102
visibility: hidden;
@@ -111,4 +110,9 @@
111110
display: none;
112111
}
113112
}
113+
114+
.inactive-node:not(.inactive-node-hover) {
115+
opacity: var(--inactive-card-opacity) !important;
116+
cursor: none !important;
117+
}
114118
}

src/view/actions/hide-floating-buttons.ts

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
import { AlwaysShowCardButtons } from 'src/stores/settings/derived/view-settings-store';
2-
import { getView } from 'src/view/components/container/context';
3-
41
const toggleHideButtons = (element: HTMLElement, hide: boolean) => {
52
element.toggleClass('hide-floating-buttons', hide);
63
};
@@ -30,18 +27,10 @@ export const hideFloatingButtons = (element: HTMLElement) => {
3027
delayedHideButtons();
3128
};
3229

33-
const view = getView();
34-
const subscription = AlwaysShowCardButtons(view).subscribe((show) => {
35-
if (show) {
36-
element.addEventListener('mousemove', onMousemove);
37-
} else {
38-
element.removeEventListener('mousemove', onMousemove);
39-
}
40-
});
30+
element.addEventListener('mousemove', onMousemove);
4131
return {
4232
destroy: () => {
4333
resetHideButtons();
44-
subscription();
4534
element.removeEventListener('mousemove', onMousemove);
4635
},
4736
};

0 commit comments

Comments
 (0)