Skip to content

Commit e4e9f44

Browse files
author
昔梦
committed
feat:工具栏新增禁用以及手模式和指针模式的选中样式
1 parent 6011766 commit e4e9f44

File tree

2 files changed

+45
-8
lines changed

2 files changed

+45
-8
lines changed

packages/x-flow/src/operator/Control/index.tsx

Lines changed: 43 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,33 @@ const Control = (props: any) => {
3434
</Tooltip>
3535
</NodeSelectPopover>
3636
<Tooltip title="添加注释">
37-
<div className="control-item" onClick={addNote}>
37+
{/* <div onClick={addNote} className="control-item">
3838
<IconView type="icon-sticky-note-add-line" className="icon" />
39-
</div>
39+
</div> */}
40+
<Button
41+
type="text"
42+
icon={<IconView type="icon-sticky-note-add-line" className="icon" />}
43+
onClick={addNote}
44+
/>
4045
</Tooltip>
4146
<div className="separator"></div>
4247
<Tooltip title="指针模式">
43-
<div
48+
<Button
49+
type="text"
50+
icon={
51+
<IconView
52+
type="icon-zhizhen"
53+
className="icon"
54+
style={{
55+
color: !panOnDrag ? 'rgb(21,94,239)' : '#666F83',
56+
fontSize: '14px',
57+
}}
58+
/>
59+
}
60+
onClick={() => panOnDrag && handleInteractionModeChange(false)}
61+
style={{ backgroundColor: !panOnDrag ? 'rgb(239,244,255)' : '' }}
62+
/>
63+
{/* <div
4464
className="control-item"
4565
onClick={() => panOnDrag && handleInteractionModeChange(false)}
4666
>
@@ -52,10 +72,10 @@ const Control = (props: any) => {
5272
fontSize:'14px'
5373
}}
5474
/>
55-
</div>
75+
</div> */}
5676
</Tooltip>
5777
<Tooltip title="手模式">
58-
<div
78+
{/* <div
5979
className="control-item"
6080
onClick={() => !panOnDrag && handleInteractionModeChange(true)}
6181
>
@@ -66,7 +86,24 @@ const Control = (props: any) => {
6686
color: panOnDrag ? 'rgba(0, 0, 0, 0.25)' : '#666F83',
6787
}}
6888
/>
69-
</div>
89+
</div> */}
90+
<Button
91+
type="text"
92+
icon={
93+
<IconView
94+
type="icon-xianxingshouzhangtubiao"
95+
className="icon"
96+
style={{
97+
color: panOnDrag ? 'rgb(21,94,239)' : '#666F83',
98+
}}
99+
/>
100+
}
101+
onClick={() => !panOnDrag && handleInteractionModeChange(true)}
102+
style={{
103+
backgroundColor: panOnDrag ? 'rgb(239,244,255)' : '',
104+
marginLeft: '1px',
105+
}}
106+
/>
70107
</Tooltip>
71108
<div className="separator"></div>
72109
<Tooltip title="整理节点">

packages/x-flow/src/operator/UndoRedo/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ export default memo(({ handleUndo, handleRedo, pastStates, futureStates }: UndoR
1616
<Tooltip title='撤销'>
1717
<Button
1818
type='text'
19-
icon={<IconView type='icon-undo' className="icon" />}
19+
icon={<IconView type='icon-undo' className="icon" style={{ color: !pastStates?.length ? 'rgba(0, 0, 0, 0.25)': '#666F83'}} />}
2020
onClick={handleUndo}
2121
disabled={!pastStates?.length}
2222
/>
2323
</Tooltip>
2424
<Tooltip title='重做'>
2525
<Button
2626
type='text'
27-
icon={<IconView type='icon-redo' className="icon" />}
27+
icon={<IconView type='icon-redo' className="icon" style={{ color: !futureStates?.length ? 'rgba(0, 0, 0, 0.25)' : '#666F83' }} />}
2828
onClick={handleRedo}
2929
disabled={!futureStates?.length}
3030
/>

0 commit comments

Comments
 (0)