feat(ui): Add auto show progress previews setting

This commit is contained in:
blessedcoolant
2023-05-01 10:45:27 +12:00
committed by psychedelicious
parent 29743a9e02
commit d4b250d509
7 changed files with 123 additions and 100 deletions

View File

@ -23,6 +23,7 @@ const initialUIState: UIState = {
openUnifiedCanvasAccordionItems: [],
floatingProgressImageRect: { x: 0, y: 0, width: 0, height: 0 },
shouldShowProgressImages: false,
shouldAutoShowProgressImages: false,
};
const initialState: UIState = initialUIState;
@ -122,8 +123,14 @@ export const uiSlice = createSlice({
...action.payload,
};
},
shouldShowProgressImagesToggled: (state) => {
state.shouldShowProgressImages = !state.shouldShowProgressImages;
setShouldShowProgressImages: (state, action: PayloadAction<boolean>) => {
state.shouldShowProgressImages = action.payload;
},
setShouldAutoShowProgressImages: (
state,
action: PayloadAction<boolean>
) => {
state.shouldAutoShowProgressImages = action.payload;
},
},
});
@ -150,7 +157,8 @@ export const {
openAccordionItemsChanged,
floatingProgressImageMoved,
floatingProgressImageResized,
shouldShowProgressImagesToggled,
setShouldShowProgressImages,
setShouldAutoShowProgressImages,
} = uiSlice.actions;
export default uiSlice.reducer;

View File

@ -31,4 +31,5 @@ export interface UIState {
openUnifiedCanvasAccordionItems: number[];
floatingProgressImageRect: Rect;
shouldShowProgressImages: boolean;
shouldAutoShowProgressImages: boolean;
}