I created my little rollershutter-widget, merely by collecting ideas from others and combining them to a very minimal popover.
It looks like:
- The numbers on the scale work as shortcuts to the positions
- The slider can move to any position
Now my problem:
The vertical size of the slider never adjusts to the column with the numbers. The goal would be that it is automatically be a little longer than the list of the numbers. Currently I hardcoded the pixels (in the screenshot a little to much to show the effect) but that behaves different on different screens.
It would be great if somebody with more knowledge about flex-boxes, css etc. could have a look and give me a hint how the vertical size of the first column could propagate to the slider.
And maybe one additional question: Can (and how) I avoid scrollbars appearing when the popover exceeds a certain size? If I try to increase the width of the whole widget I get ugly scrollbars (just on some screens).
Here is the code of the widget
uid: universal_shutter_v6
tags: []
props:
parameters:
- description: rollershutter widget
label: Titel
name: title
required: false
type: TEXT
- context: item
description: Rollershutter control (receives UP, DOWN, STOP commands)
label: Rollershutter control
name: control
required: true
type: TEXT
parameterGroups: []
timestamp: Dec 25, 2024, 9:55:39 AM
component: f7-card
config:
style:
background: rgb(40,40,40)
margin: 15px
margin-top: 0px
#width: 230px
title: =props.title
slots:
default:
- component: f7-card-content
slots:
default:
- component: f7-row
config:
style:
display: flex
height: 180px
justify-content: left
margin-top: 10px
slots:
default:
- component: f7-col
config:
style:
align-items: flex-start
flex-direction: column
width: 50px
slots:
default:
- component: oh-list
slots:
default:
- component: oh-button
config:
action: command
actionCommand: "10"
actionItem: =props.control
text: 10%
- component: oh-button
config:
action: command
actionCommand: "25"
actionItem: =props.control
text: 25%
- component: oh-button
config:
action: command
actionCommand: "50"
actionItem: =props.control
text: 50%
- component: oh-button
config:
action: command
actionCommand: "75"
actionItem: =props.control
text: 75%
- component: oh-button
config:
action: command
actionCommand: "90"
actionItem: =props.control
text: 90%
- component: f7-col
config:
style:
height: 100%
slots:
default:
- component: oh-slider
config:
color: white
item: =props.control
label: true
releaseOnly: true
scale: false
step: 5
style:
--f7-range-bar-active-bg-color: linear-gradient(to top, rgba(246,158,81,0),
rgba(246,158,81,0.8))
--f7-range-bar-bg-color: rgba(246, 158, 81, 0.2)
--f7-range-bar-border-radius: 10px
--f7-range-bar-size: 18px
--f7-range-knob-box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3)
--f7-range-knob-size: 20px
--f7-range-label-text-color: black
vertical: true
vertical-reversed: true
- component: f7-col
config:
style:
align-items: center
display: flex
flex-direction: column
height: 85%
justify-content: center
margin-left: 5px
slots:
default:
- component: oh-link
config:
action: command
actionCommand: UP
actionItem: =props.control
colorTheme: gray
iconF7: arrowtriangle_up
iconSize: 20
style:
background-color: rgba(246, 158, 81, 0.2)
border-radius: 15px 15px 0px 0px
padding: 10px
- component: oh-link
config:
action: command
actionCommand: STOP
actionItem: =props.control
iconF7: stop
iconSize: 20
style:
background-color: rgba(246, 158, 81, 0.2)
padding: 10px
- component: oh-link
config:
action: command
actionCommand: DOWN
actionItem: =props.control
colorTheme: gray
iconF7: arrowtriangle_down
iconSize: 20
style:
background-color: rgba(246, 158, 81, 0.2)
border-radius: 0px 0px 15px 15px
padding: 10px
- component: oh-button
config:
fill: true
outline: true
popupClose: .popover
style:
margin-left: 10px
margin-right: 10px
margin-top: 20px
justify-content: center
text: OK