Skip to content

Commit

Permalink
wrap play button in aspecframe to keep from weirdly resizing when par…
Browse files Browse the repository at this point in the history
…ent size increases
  • Loading branch information
13hannes11 committed Mar 19, 2024
1 parent 7c7f07e commit 92315c5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
5 changes: 5 additions & 0 deletions src/app.rs
Expand Up @@ -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,
Expand Down
21 changes: 13 additions & 8 deletions src/factories/container_list.rs
Expand Up @@ -33,14 +33,19 @@ impl FactoryComponent for Container {
#[watch]
set_title: format!{"{}: {}", self.hash, self.value.to_string()}.as_str(),

#[name(play_button)]
add_prefix = &gtk::Button {
// TODO: make component with state that either is waiting, play or pause
set_icon_name: icon_names::PLAY,
set_margin_top: 10,
set_margin_bottom: 10,
set_css_classes: &["circular"],
connect_clicked => ContainerMsg::Start,
add_prefix = &gtk::Box{
gtk::AspectFrame{
set_ratio: 1.0,
#[name(play_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,
set_margin_bottom: 10,
set_css_classes: &["circular"],
connect_clicked => ContainerMsg::Start,
},
},
},

add_suffix = &gtk::Box{
Expand Down

0 comments on commit 92315c5

Please sign in to comment.