Skip to content

Instantly share code, notes, and snippets.

@Fredemus
Created July 23, 2023 19:41
Show Gist options
  • Save Fredemus/4bb5c6cdc9873de889262f012601cded to your computer and use it in GitHub Desktop.
Save Fredemus/4bb5c6cdc9873de889262f012601cded to your computer and use it in GitHub Desktop.
use vizia::prelude::*;
const STYLE: &str = r#"
.toggle_button {
background-color: transparent;
border-radius: 4px;
max-width: 8px;
min-width: 8px;
max-height: 8px;
min-height: 8px;
border-width: 1px;
border-color: #ff9330;
box-shadow: 0px 0px 0px #00000000;
}
.module-sidebar {
width: 14px;
height: 1s;
child-left: 1s;
child-right: 1s;
child-top: 5px;
background-color: #242424;
border-top-left-radius: 4px;
border-bottom-left-radius: 4px;
border-width: 1px;
border-color: blue;
}
.module-sidebar:checked {
color: #ffffff;
}
.module-sidebar-title {
top: 1s;
width: auto;
height: 20px;
overflow: visible;
bottom: 10px;
border-width: 1px;
border-color: red;
z-index: 200;
/* child-right: 1s; */
rotate: -90deg;
color: #ffffff;
}
"#;
fn main() {
Application::new(|cx| {
cx.add_stylesheet(STYLE);
HStack::new(cx, |cx| {
VStack::new(cx, |cx| {
Button::new(cx, |_| {}, |cx| Label::new(cx, " ")).class("toggle_button");
Label::new(cx, "SAMPLER").class("module-sidebar-title");
})
.class("module-sidebar")
.height(Pixels(128.));
})
.width(Stretch(1.))
.height(Stretch(1.));
})
.title("Button")
.inner_size((700, 200))
.run();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment