Skip to content
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

Add computedStyle to ROLLUP, LED, and SIGNAL widgets #1781

Merged
merged 1 commit into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs.openc3.com/docs/guides/scripting-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -3238,7 +3238,7 @@ The local_screen allows you to create a local screen directly from a script whic
Python / Ruby Syntax:

```ruby
local_screen("<Screen Name>" "<Definition>", <X Position (optional)>, <Y Position (optional)>)
local_screen("<Screen Name>", "<Definition>", <X Position (optional)>, <Y Position (optional)>)
```

| Parameter | Description |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@
<template>
<v-tooltip location="top">
<template v-slot:activator="{ props }">
<div class="led mt-1" :style="cssProps" v-bind="props"></div>
<div
class="ledwidget mt-1"
:style="[cssProps, computedStyle]"
v-bind="props"
></div>
</template>
<span>{{ fullName }}</span>
</v-tooltip>
Expand Down Expand Up @@ -59,8 +63,6 @@ export default {
color = 'openc3-black'
}
return {
'--height': this.height + 'px',
'--width': this.width + 'px',
'--color': color,
}
},
Expand All @@ -81,6 +83,11 @@ export default {
break
}
})
// Throw width and height into the appliedSettings so they are set
// and we don't get the default flex value
this.appliedSettings.push(['WIDTH', this.width])
this.appliedSettings.push(['HEIGHT', this.height])

if (!this.parameters[3]) {
this.parameters[3] = 'CONVERTED'
}
Expand All @@ -94,9 +101,7 @@ export default {
</script>

<style scoped>
.led {
height: var(--height);
width: var(--width);
.ledwidget {
background-color: var(--color);
border-radius: 50%;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<template>
<rux-monitoring-icon
class="rux-icon"
:style="pointerStyle"
:style="[pointerStyle, computedStyle]"
:icon="icon"
:status="status"
:label="label"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
-->

<template>
<v-icon @click="clickHandler"> {{ displayedIcon }} </v-icon>
<v-icon @click="clickHandler" :style="computedStyle">
{{ displayedIcon }}
</v-icon>
</template>

<script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
-->

<template>
<div ref="container" class="d-flex flex-column" :style="computedStyle">
<div ref="container" :style="computedStyle">
<component
v-bind="listeners"
v-for="(widget, index) in widgets"
Expand Down
Loading