Skip to content

Commit 42d6f02

Browse files
Fix the mouse cursors on NADs (#3297)
* Fix the mouse cursors on NADs --------- Signed-off-by: BOUTIER Charly <[email protected]>
1 parent 12a0766 commit 42d6f02

File tree

4 files changed

+20
-7
lines changed

4 files changed

+20
-7
lines changed

src/components/grid-layout/cards/diagrams/diagram-styles.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,20 @@ export const styles = {
104104
transform: 'unset !important',
105105
},
106106
},
107+
nadDefaultCursors: {
108+
'& .nad-branch-edges .nad-edge-path, & .nad-3wt-edges .nad-edge-path, & .nad-branch-edges .nad-winding, & .nad-3wt-nodes .nad-winding, & .nad-edge-infos':
109+
{
110+
cursor: 'context-menu',
111+
},
112+
},
113+
nadEditModeCursors: {
114+
'& .nad-label-box, & .nad-vl-nodes .nad-busnode': {
115+
cursor: 'grab',
116+
},
117+
'& .nad-edge-infos': {
118+
cursor: 'default',
119+
},
120+
},
107121
paperBorders: (theme) => ({
108122
borderLeft: '1px solid ' + theme.palette.action.disabled,
109123
borderBottom: '1px solid ' + theme.palette.action.disabledBackground,

src/components/grid-layout/cards/diagrams/networkAreaDiagram/network-area-diagram-content.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,8 @@ function NetworkAreaDiagramContent(props: NetworkAreaDiagramContentProps) {
393393
styles.divDiagram,
394394
styles.divNetworkAreaDiagram,
395395
loadFlowStatus !== RunningStatus.SUCCEED ? styles.divDiagramInvalid : undefined,
396-
isEditNadMode && !showLabels ? styles.hideLabels : undefined
396+
isEditNadMode && !showLabels ? styles.hideLabels : undefined,
397+
isEditNadMode ? styles.nadEditModeCursors : styles.nadDefaultCursors
397398
)}
398399
/>
399400
<DiagramControls

src/index.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ code {
162162
stroke: none;
163163
fill: black;
164164
font: 11px 'Verdana';
165+
cursor: context-menu !important;
165166
}
166167
.sld-graph-label {
167168
stroke: none;
@@ -300,6 +301,7 @@ code {
300301
.sld-voltage-level:has(circle.sld-bus-8:hover, .sld-bus-8.sld-busbar-section:hover) .sld-bus-8.sld-busbar-section,
301302
.sld-voltage-level:has(circle.sld-bus-9:hover, .sld-bus-9.sld-busbar-section:hover) .sld-bus-9.sld-busbar-section {
302303
stroke-width: 5px;
304+
cursor: context-menu !important;
303305
}
304306
.sld-voltage-level:has(circle.sld-bus-0:hover, .sld-bus-0.sld-busbar-section:hover) .sld-bus-0.sld-wire,
305307
.sld-voltage-level:has(circle.sld-bus-1:hover, .sld-bus-1.sld-busbar-section:hover) .sld-bus-1.sld-wire,

src/nad-index.css

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
.nad-branch-edges .nad-edge-path,
2-
.nad-3wt-edges .nad-edge-path {
3-
stroke: var(--vl-color, lightgrey);
4-
stroke-width: 0.25%;
5-
fill: none;
6-
}
2+
.nad-3wt-edges .nad-edge-path,
73
.nad-branch-edges .nad-winding,
84
.nad-3wt-nodes .nad-winding {
95
stroke: var(--vl-color, lightgrey);
@@ -67,7 +63,7 @@ foreignObject.nad-text-nodes {
6763
width: max-content;
6864
padding: 10px;
6965
border-radius: 10px;
70-
cursor: grab;
66+
cursor: default;
7167
border: 2px solid rgba(0,0,0,0);
7268
}
7369
.nad-legend-square {

0 commit comments

Comments
 (0)