transfer styling from old application

This commit is contained in:
2024-03-19 18:08:11 +01:00
parent 5da62888d1
commit 7c7f07e670
2 changed files with 18 additions and 4 deletions

View File

@@ -100,6 +100,7 @@ impl Component for App {
#[local_ref] #[local_ref]
container_box -> gtk::ListBox { container_box -> gtk::ListBox {
set_size_request: (200, -1),
set_selection_mode: gtk::SelectionMode::None, set_selection_mode: gtk::SelectionMode::None,
set_valign: Align::Start, set_valign: Align::Start,
set_margin_all: 30, set_margin_all: 30,

View File

@@ -4,6 +4,7 @@ use relm4::adw::prelude::ActionRowExt;
use relm4::adw::prelude::PreferencesRowExt; use relm4::adw::prelude::PreferencesRowExt;
use relm4::factory::{FactoryComponent, FactorySender}; use relm4::factory::{FactoryComponent, FactorySender};
use relm4::gtk; use relm4::gtk;
use relm4::gtk::prelude::WidgetExt;
use relm4_icons::icon_names; use relm4_icons::icon_names;
#[derive(Debug)] #[derive(Debug)]
@@ -36,13 +37,25 @@ impl FactoryComponent for Container {
add_prefix = &gtk::Button { add_prefix = &gtk::Button {
// TODO: make component with state that either is waiting, play or pause // TODO: make component with state that either is waiting, play or pause
set_icon_name: icon_names::PLAY, set_icon_name: icon_names::PLAY,
set_margin_top: 10,
set_margin_bottom: 10,
set_css_classes: &["circular"],
connect_clicked => ContainerMsg::Start, connect_clicked => ContainerMsg::Start,
}, },
#[name(add_button)] add_suffix = &gtk::Box{
add_suffix = &gtk::Button { gtk::AspectFrame{
set_icon_name: icon_names::TERMINAL, set_ratio: 1.0,
connect_clicked => ContainerMsg::Start, #[name(add_button)]
gtk::Button {
set_icon_name: icon_names::TERMINAL,
set_margin_start: 10,
set_margin_top: 10,
set_margin_bottom: 10,
set_css_classes: &["flat"],
connect_clicked => ContainerMsg::Start,
},
},
}, },
} }
} }