wrap play button in aspecframe to keep from weirdly resizing when parent size increases

This commit is contained in:
2024-03-19 18:16:33 +01:00
parent 7c7f07e670
commit 92315c5652
2 changed files with 18 additions and 8 deletions

View File

@@ -139,6 +139,11 @@ impl Component for App {
containers.insert("5344".to_string(), 3); containers.insert("5344".to_string(), 3);
containers.insert("1242344".to_string(), 3); containers.insert("1242344".to_string(), 3);
containers.insert("1265464".to_string(), 3); containers.insert("1265464".to_string(), 3);
containers.insert(
"126222222222222222222222222222222222222222233333333333333333333333333333333325464"
.to_string(),
3,
);
let model = Self { let model = Self {
about_dialog, about_dialog,

View File

@@ -33,14 +33,19 @@ impl FactoryComponent for Container {
#[watch] #[watch]
set_title: format!{"{}: {}", self.hash, self.value.to_string()}.as_str(), set_title: format!{"{}: {}", self.hash, self.value.to_string()}.as_str(),
#[name(play_button)] add_prefix = &gtk::Box{
add_prefix = &gtk::Button { gtk::AspectFrame{
// TODO: make component with state that either is waiting, play or pause set_ratio: 1.0,
set_icon_name: icon_names::PLAY, #[name(play_button)]
set_margin_top: 10, gtk::Button {
set_margin_bottom: 10, // TODO: make component with state that either is waiting, play or pause
set_css_classes: &["circular"], set_icon_name: icon_names::PLAY,
connect_clicked => ContainerMsg::Start, set_margin_top: 10,
set_margin_bottom: 10,
set_css_classes: &["circular"],
connect_clicked => ContainerMsg::Start,
},
},
}, },
add_suffix = &gtk::Box{ add_suffix = &gtk::Box{