-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug: #3981 Signed-off-by: Michaël Charfadi <michael.charfadi@obeosoft.com>
- Loading branch information
Showing
34 changed files
with
423 additions
and
391 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,6 @@ | |
* | ||
* @author fbarbin | ||
*/ | ||
|
||
public interface IPaletteEntry { | ||
|
||
String id(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
43 changes: 43 additions & 0 deletions
43
...tend/sirius-components-diagrams/src/renderer/palette/quick-access-tool/AdjustSizeTool.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2024 Obeo. | ||
* This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v2.0 | ||
* which accompanies this distribution, and is available at | ||
* https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* Obeo - initial API and implementation | ||
*******************************************************************************/ | ||
|
||
import AdjustIcon from '@mui/icons-material/Adjust'; | ||
import IconButton from '@mui/material/IconButton'; | ||
import Tooltip from '@mui/material/Tooltip'; | ||
import { makeStyles } from 'tss-react/mui'; | ||
import { useAdjustSize } from '../../adjust-size/useAdjustSize'; | ||
import { AdjustSizeToolProps } from './AdjustSizeTool.types'; | ||
|
||
const useStyle = makeStyles()((theme) => ({ | ||
toolIcon: { | ||
width: theme.spacing(4.5), | ||
color: theme.palette.text.primary, | ||
}, | ||
})); | ||
|
||
export const AdjustSizeTool = ({ diagramElementId }: AdjustSizeToolProps) => { | ||
const { classes } = useStyle(); | ||
const { adjustSize } = useAdjustSize(); | ||
return ( | ||
<Tooltip title="Adjust size" key={'tooltip_adjust_element_tool'}> | ||
<IconButton | ||
className={classes.toolIcon} | ||
size="small" | ||
aria-label="Adjust element" | ||
onClick={() => adjustSize(diagramElementId)} | ||
data-testid="adjust-element"> | ||
<AdjustIcon fontSize="small" /> | ||
</IconButton> | ||
</Tooltip> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
...end/sirius-components-diagrams/src/renderer/palette/quick-access-tool/FadeElementTool.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2024 Obeo. | ||
* This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v2.0 | ||
* which accompanies this distribution, and is available at | ||
* https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* Obeo - initial API and implementation | ||
*******************************************************************************/ | ||
|
||
import TonalityIcon from '@mui/icons-material/Tonality'; | ||
import IconButton from '@mui/material/IconButton'; | ||
import Tooltip from '@mui/material/Tooltip'; | ||
import { makeStyles } from 'tss-react/mui'; | ||
import { useFadeDiagramElements } from '../../fade/useFadeDiagramElements'; | ||
import { FadeElementToolProps } from './FadeElementTool.types'; | ||
|
||
const useStyle = makeStyles()((theme) => ({ | ||
toolIcon: { | ||
width: theme.spacing(4.5), | ||
color: theme.palette.text.primary, | ||
}, | ||
})); | ||
|
||
export const FadeElementTool = ({ diagramElementId, isFaded }: FadeElementToolProps) => { | ||
const { classes } = useStyle(); | ||
const { fadeDiagramElements } = useFadeDiagramElements(); | ||
if (isFaded) { | ||
return ( | ||
<Tooltip title="Unfade element" key={'tooltip_unfade_element_tool'}> | ||
<IconButton | ||
className={classes.toolIcon} | ||
size="small" | ||
aria-label="Unfade element" | ||
onClick={() => fadeDiagramElements([diagramElementId], false)} | ||
data-testid="Fade-element"> | ||
<TonalityIcon fontSize="small" /> | ||
</IconButton> | ||
</Tooltip> | ||
); | ||
} else { | ||
return ( | ||
<Tooltip title="Fade element" key={'tooltip_fade_element_tool'}> | ||
<IconButton | ||
className={classes.toolIcon} | ||
size="small" | ||
aria-label="Fade element" | ||
onClick={() => fadeDiagramElements([diagramElementId], true)} | ||
data-testid="Fade-element"> | ||
<TonalityIcon fontSize="small" /> | ||
</IconButton> | ||
</Tooltip> | ||
); | ||
} | ||
}; |
16 changes: 16 additions & 0 deletions
16
...irius-components-diagrams/src/renderer/palette/quick-access-tool/FadeElementTool.types.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2024 Obeo. | ||
* This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v2.0 | ||
* which accompanies this distribution, and is available at | ||
* https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* Obeo - initial API and implementation | ||
*******************************************************************************/ | ||
export interface FadeElementToolProps { | ||
diagramElementId: string; | ||
isFaded: boolean; | ||
} |
Oops, something went wrong.