-
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #540 from charlielee/frame-toolbar
Use mantine styles for toolbars
- Loading branch information
Showing
15 changed files
with
154 additions
and
107 deletions.
There are no files selected for viewing
8 changes: 0 additions & 8 deletions
8
src/renderer/components/animator/AnimationToolbar/AnimationToolbar.css
This file was deleted.
Oops, something went wrong.
47 changes: 0 additions & 47 deletions
47
src/renderer/components/animator/AnimationToolbar/AnimationToolbar.tsx
This file was deleted.
Oops, something went wrong.
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
46 changes: 46 additions & 0 deletions
46
src/renderer/components/animator/FrameToolbar/FrameToolbar.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,46 @@ | ||
import { Group, useMantineTheme } from "@mantine/core"; | ||
import { useContext } from "react"; | ||
import { useSelector } from "react-redux"; | ||
import { PageRoute } from "../../../../common/PageRoute"; | ||
import PlaybackContext from "../../../context/PlaybackContext/PlaybackContext"; | ||
import { RootState } from "../../../redux/store"; | ||
import { getTrackLength } from "../../../services/project/projectCalculator"; | ||
import IconName from "../../common/Icon/IconName"; | ||
import IconButton from "../../common/IconButton/IconButton"; | ||
import { ThemeWithOther } from "../../ui/Theme/Theme"; | ||
import { TitleToolbarTimestamp } from "./TitleToolbarTimestamp/TitleToolbarTimestamp"; | ||
import useProjectAndTake from "../../../hooks/useProjectAndTake"; | ||
import { UiActionIcon } from "../../ui/UiActionIcon/UiActionIcon"; | ||
|
||
export const FrameToolbar = (): JSX.Element => { | ||
const theme: ThemeWithOther = useMantineTheme(); | ||
|
||
const { take } = useProjectAndTake(); | ||
|
||
const { liveViewVisible, timelineIndex } = useContext(PlaybackContext); | ||
const frameTrack = useSelector((state: RootState) => state.project.take?.frameTrack); | ||
if (frameTrack === undefined) { | ||
throw "No frame track found in FrameToolbar"; | ||
} | ||
|
||
return ( | ||
<Group | ||
py="sm" | ||
px="md" | ||
style={{ | ||
borderTop: theme.other.border, | ||
backgroundColor: "var(--mantine-color-default)", | ||
}} | ||
> | ||
<TitleToolbarTimestamp take={take} /> | ||
<UiActionIcon | ||
icon={liveViewVisible ? IconName.UNDO : IconName.DELETE} | ||
onClick={ | ||
getTrackLength(frameTrack) === 0 ? () => undefined : PageRoute.ANIMATOR_DELETE_FRAME | ||
} | ||
> | ||
{timelineIndex === undefined ? "Undo Last Frame" : `Delete Frame ${timelineIndex + 1}`} | ||
</UiActionIcon> | ||
</Group> | ||
); | ||
}; |
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
7 changes: 3 additions & 4 deletions
7
src/renderer/components/animator/Timeline/TimelineTrackLabel/TimelineTrackLabel.css
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 |
---|---|---|
@@ -1,9 +1,8 @@ | ||
.timeline-track-label { | ||
align-items: center; | ||
color: var(--ba-light-mid); | ||
display: flex; | ||
height: var(--height-800); | ||
padding: var(--width-16); | ||
min-width: calc(var(--width-16) * 4); | ||
width: calc(var(--width-16) * 4); | ||
padding: var(--mantine-spacing-md); | ||
min-width: calc(var(--mantine-spacing-md) * 4); | ||
width: calc(var(--mantine-spacing-md) * 4); | ||
} |
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
3 changes: 0 additions & 3 deletions
3
src/renderer/components/animator/TitleToolbar/TitleToolbar.css
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.