Skip to content

Commit

Permalink
Merge pull request #1781 from OpenC3/margins
Browse files Browse the repository at this point in the history
Add computedStyle to ROLLUP, LED, and SIGNAL widgets
  • Loading branch information
jmthomas authored Dec 19, 2024
2 parents e9ecd6e + af5eea1 commit 620b543
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 10 deletions.
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

0 comments on commit 620b543

Please sign in to comment.