Hi,
I wanted to display the status of my sensors using circles of various colors: green, yellow, and flashing red.
I’m unsure which widget would perform best, and what the best approach is to achieve this.
I can change a button’s shape via CSS to make it round, and I can change its color, but I’m uncertain whether it’s correct to manually change the background color of the buttons every time the GUI update timer occurs. My hardware isn’t powerful, and I would like to know the best approach to achieve this.
I can make some icons representing my state (maybe for blinking change color from red to gray in a timer) and try to use this piece of css posted by @ntd in Link
.i, .o, .um {
font-size: 75%;
}
.i label, .o label {
color: inherit;
padding: 0;
margin: 0;
}
.i check, .o check {
-gtk-icon-source: -gtk-scaled(url("assets/led-off.svg"));
background: none;
border-width: 0;
background: none;
box-shadow: none;
padding: 0;
margin: 2px 4px 2px 0;
transition: none;
min-width: 18px;
min-height: 18px;
}
.i check:active, .o check:active {
-gtk-icon-transform: none;
}
.i check:checked {
background: none;
-gtk-icon-source: -gtk-scaled(url("assets/led-green.svg"));
}
.o check:checked {
-gtk-icon-source: -gtk-scaled(url("assets/led-red.svg"));
}
But again i’m not sure how to set my three state into the GtkCheckButton that Nicola was using.
Thank you for any reply.