mirror of
https://github.com/IRBorisov/ConceptPortal.git
synced 2025-06-26 04:50:36 +03:00
M: Add distinguishing border for focusCst
This commit is contained in:
parent
9b4cf2bde2
commit
9fadfec1b3
|
@ -33,6 +33,7 @@ export function TGNode(node: TGNodeInternal) {
|
||||||
const { focusCst, setFocus: setFocusCst, navigateCst } = useRSEdit();
|
const { focusCst, setFocus: setFocusCst, navigateCst } = useRSEdit();
|
||||||
const filter = useTermGraphStore(state => state.filter);
|
const filter = useTermGraphStore(state => state.filter);
|
||||||
const coloring = useTermGraphStore(state => state.coloring);
|
const coloring = useTermGraphStore(state => state.coloring);
|
||||||
|
const isFocused = focusCst === node.data;
|
||||||
|
|
||||||
const label = node.data.alias;
|
const label = node.data.alias;
|
||||||
const description = !filter.noText ? node.data.term_resolved : '';
|
const description = !filter.noText ? node.data.term_resolved : '';
|
||||||
|
@ -40,7 +41,7 @@ export function TGNode(node: TGNodeInternal) {
|
||||||
function handleContextMenu(event: React.MouseEvent<HTMLElement>) {
|
function handleContextMenu(event: React.MouseEvent<HTMLElement>) {
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
setFocusCst(focusCst === node.data ? null : node.data);
|
setFocusCst(isFocused ? null : node.data);
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleDoubleClick(event: React.MouseEvent) {
|
function handleDoubleClick(event: React.MouseEvent) {
|
||||||
|
@ -57,10 +58,12 @@ export function TGNode(node: TGNodeInternal) {
|
||||||
style={{
|
style={{
|
||||||
backgroundColor: node.selected
|
backgroundColor: node.selected
|
||||||
? APP_COLORS.bgActiveSelection
|
? APP_COLORS.bgActiveSelection
|
||||||
: focusCst === node.data
|
: isFocused
|
||||||
? APP_COLORS.bgPurple
|
? APP_COLORS.bgPurple
|
||||||
: colorBgGraphNode(node.data, coloring),
|
: colorBgGraphNode(node.data, coloring),
|
||||||
fontSize: label.length > LABEL_THRESHOLD ? FONT_SIZE_MED : FONT_SIZE_MAX
|
fontSize: label.length > LABEL_THRESHOLD ? FONT_SIZE_MED : FONT_SIZE_MAX,
|
||||||
|
borderWidth: isFocused ? '2px' : '0px',
|
||||||
|
borderColor: isFocused ? APP_COLORS.bgSelected : 'transparent'
|
||||||
}}
|
}}
|
||||||
data-tooltip-id={globalIDs.tooltip}
|
data-tooltip-id={globalIDs.tooltip}
|
||||||
data-tooltip-html={describeCstNode(node.data)}
|
data-tooltip-html={describeCstNode(node.data)}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user