-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(Slice): Use keyboard to change slices of the active view #679
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for volview-dev ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Making dreams come true here.
If you rebase on top of main
rather than merge we can avoid thoes pesky merge commits.
const nextSlice = () => () => { | ||
const { currentImageID } = useCurrentImage(); | ||
const { activeViewID } = useViewStore(); | ||
|
||
const { slice: currentSlice } = useSliceConfig(activeViewID, currentImageID); | ||
currentSlice.value += 1; | ||
}; | ||
|
||
const previousSlice = () => () => { | ||
const { currentImageID } = useCurrentImage(); | ||
const { activeViewID } = useViewStore(); | ||
|
||
const { slice: currentSlice } = useSliceConfig(activeViewID, currentImageID); | ||
currentSlice.value -= 1; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To remove duplicate code, could define something like offsetSlice(offset: number)
then
const nextSlice = () => offsetSlice(1)
const previousSlice = () => offsetSlice(-1)
@@ -28,6 +29,13 @@ import { useViewStore } from '../store/views'; | |||
|
|||
export default defineComponent({ | |||
name: 'LayoutGrid', | |||
methods: { | |||
onFocusView(id: string, type: string) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍️ Good
Also, when I scroll with mouse wheel on a view, then press the arrow keys, its not always the same view that gets its slice changed. So maybe setActiveView on scroll events too?
This needs this PR to be merged first: #676