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("1242344".to_string(), 3);
containers.insert("1265464".to_string(), 3);
containers.insert(
"126222222222222222222222222222222222222222233333333333333333333333333333333325464"
.to_string(),
3,
);
let model = Self {
about_dialog,

View File

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