Skip to content

Commit

Permalink
diagrams: refactor to use theme colors
Browse files Browse the repository at this point in the history
  • Loading branch information
ES-Alexander authored and patrickelectric committed Dec 11, 2024
1 parent a105a15 commit b98cd01
Show file tree
Hide file tree
Showing 12 changed files with 50 additions and 101 deletions.
6 changes: 3 additions & 3 deletions core/frontend/public/img/icons/motordetection.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
60 changes: 22 additions & 38 deletions core/frontend/src/assets/img/configuration/camera/gimbal-pitch.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 6 additions & 6 deletions core/frontend/src/assets/img/configuration/failsafes/battery.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions core/frontend/src/assets/img/configuration/failsafes/ekf.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions core/frontend/src/assets/img/configuration/failsafes/leak.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 1 addition & 24 deletions core/frontend/src/components/utils/themedSVG.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,14 @@
<div class="ma-4 d-flex justify-center">
<!-- this is theoretically not safe, but we have a command that gives users root access, so... -->
<!-- eslint-disable vue/no-v-html -->
<i :class="`${svg_outside_style} svg-icon`" v-html="image" />
<i class="svg-icon" v-html="image" />
</div>
</template>

<script lang="ts">
import axios from 'axios'
import Vue from 'vue'
import settings from '@/store/settings'
export default Vue.extend({
name: 'ThemedSVG',
props: {
Expand All @@ -26,11 +24,6 @@ export default Vue.extend({
image: '',
}
},
computed: {
svg_outside_style(): string {
return `mr-0 ${settings.is_dark_theme ? 'svg-outline-dark' : 'svg-outline-light'}`
},
},
watch: {
src() {
axios.get(this.src).then((response) => {
Expand All @@ -55,20 +48,4 @@ i.svg-icon svg {
height: 100% !important;
min-width: 180px;
}
i.svg-outline-dark path {
fill: #D1EAF1;
}
i.svg-outline-light path {
fill: #002F45;
}
i.svg-outline-dark text {
fill: #D1EAF1 !important;
}
i.svg-outline-light text {
fill: #002F45 !important;
}
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<div class="ma-4">
<!-- this is theoretically not safe, but we have a command that gives users root access, so... -->
<!-- eslint-disable vue/no-v-html -->
<i :class="`${svg_outside_style} svg-icon`" v-html="image" />
<i class="svg-icon" v-html="image" />
</div>
<div class="d-flex flex-column justify-center">
<v-card-title> {{ failsafeDefinition.name }}</v-card-title>
Expand Down Expand Up @@ -40,7 +40,6 @@ import { Dictionary } from 'vue-router/types/router.js'
import { FailsafeDefinition, ParamDefinitions } from '@/components/vehiclesetup/configuration/failsafes/types'
import autopilot_data from '@/store/autopilot'
import settings from '@/store/settings'
import Parameter from '@/types/autopilot/parameter'
export default Vue.extend({
Expand All @@ -61,9 +60,6 @@ export default Vue.extend({
}
},
computed: {
svg_outside_style(): string {
return `mr-0 ${settings.is_dark_theme ? 'svg-outline-dark' : 'svg-outline-light'}`
},
params(): Dictionary<Parameter> {
return autopilot_data.parameters
.filter((param) => this.failsafeDefinition.params.map((parameter) => parameter.name)
Expand Down Expand Up @@ -101,14 +97,6 @@ i.svg-icon svg {
min-width: 180px;
}
i.svg-outline-dark path {
fill: #d1eaf1;
}
i.svg-outline-light path {
fill: #002f45;
}
.failsafe-card {
margin-left: auto;
margin-right: auto;
Expand Down

0 comments on commit b98cd01

Please sign in to comment.