-
-
Notifications
You must be signed in to change notification settings - Fork 531
feat(GcodePreview): adds multi-tool support #1753
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
Changes from all commits
c693d3b
0a84fe6
8d5703a
e0a5244
3f65d5d
28478b4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,67 @@ | ||||||
| <template> | ||||||
| <div | ||||||
| class="gcode-preview-tool" | ||||||
| :class="{ | ||||||
| active: active | ||||||
| }" | ||||||
| > | ||||||
| <span | ||||||
| class="extruder-color mr-1" | ||||||
| :style="{ | ||||||
| background: color | ||||||
| }" | ||||||
| /> | ||||||
| {{ tool }} | ||||||
| </div> | ||||||
| </template> | ||||||
|
|
||||||
| <script lang="ts"> | ||||||
| import { Component, Prop, Vue } from 'vue-property-decorator' | ||||||
| import type { Tool } from '@/store/gcodePreview/types' | ||||||
|
|
||||||
| @Component({}) | ||||||
| export default class GcodePreviewTool extends Vue { | ||||||
| @Prop({ type: String, required: true }) | ||||||
| readonly tool!: Tool | ||||||
|
|
||||||
| @Prop({ type: String, required: true }) | ||||||
| readonly color!: string | ||||||
|
|
||||||
| @Prop({ type: Boolean }) | ||||||
| readonly active?: boolean | ||||||
| } | ||||||
| </script> | ||||||
|
|
||||||
| <style lang="scss" scoped> | ||||||
| @import 'vuetify/src/styles/styles.sass'; | ||||||
|
|
||||||
| @include theme(gcode-preview-tool) using ($material) { | ||||||
| .extruder-color { | ||||||
| border-color: map-deep-get($material, 'text', 'primary'); | ||||||
| } | ||||||
| } | ||||||
|
|
||||||
| .gcode-preview-tool { | ||||||
| display: inline-flex; | ||||||
| border: 1px solid transparent; | ||||||
| border-radius: 6px; | ||||||
| align-items: center; | ||||||
| padding: 0 4px; | ||||||
|
|
||||||
| &.active { | ||||||
| border-color: map-deep-get($material-dark, 'text', 'primary'); | ||||||
|
|
||||||
| & .extruder-color { | ||||||
| border-color: map-deep-get($material-dark, 'text', 'primary'); | ||||||
|
||||||
| border-color: map-deep-get($material-dark, 'text', 'primary'); | |
| border-color: map-deep-get($material, 'text', 'primary'); |
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.
That's for inverted color, so keep as is.
Copilot
AI
Nov 29, 2025
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.
The active state always uses $material-dark theme colors regardless of current theme. Should use $material variable (line 38-41 pattern) to respect light/dark theme.
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.
That's for inverted color, so keep as is.
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.
The active state styling uses hardcoded
$material-darktheme variables instead of the dynamic$materialvariable from the@include themeblock. This means the border color won't adapt to the current theme (light/dark). Usemap-deep-get($material, 'text', 'primary')instead to match the theme-aware styling on line 40.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.
That's for inverted color, so keep as is.