Make mobile interface better

This commit is contained in:
Victor Fuentes 2023-02-19 13:38:24 -05:00
parent bb2afaa587
commit 3734802f08
No known key found for this signature in database
GPG Key ID: 0A88B68D6A9ACAE0
3 changed files with 45 additions and 28 deletions

View File

@ -2,11 +2,11 @@
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1675545634,
"narHash": "sha256-TbQeQcM5TA/wIho6xtzG+inUfiGzUXi8ewwttiQWYJE=",
"lastModified": 1676721149,
"narHash": "sha256-mN2EpTGxxVNnFZLoLWRwh6f7UWhXy4qE+wO2CZyrXps=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "0591d6b57bfeb55dfeec99a671843337bc2c3323",
"rev": "5f4e07deb7c44f27d498f8df9c5f34750acf52d2",
"type": "github"
},
"original": {
@ -24,11 +24,11 @@
},
"utils": {
"locked": {
"lastModified": 1667395993,
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
"lastModified": 1676283394,
"narHash": "sha256-XX2f9c3iySLCw54rJ/CZs+ZK6IQy7GXNY4nSOyu2QG4=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
"rev": "3db36a8b464d0c4532ba1c7dda728f4576d6d073",
"type": "github"
},
"original": {

View File

@ -199,6 +199,7 @@ impl Component for PkgModel {
},
#[wrap(Some)]
set_title_widget = &gtk::Label {
set_ellipsize: pango::EllipsizeMode::End,
#[watch]
set_label: &model.name
},
@ -263,32 +264,44 @@ impl Component for PkgModel {
set_pixel_size: 128,
}
},
gtk::Box {
gtk::FlowBox {
set_halign: gtk::Align::Fill,
set_orientation: gtk::Orientation::Horizontal,
set_min_children_per_line: 1,
set_max_children_per_line: 2,
set_selection_mode: gtk::SelectionMode::None,
// Details
gtk::Box {
set_halign: gtk::Align::Fill,
set_valign: gtk::Align::Center,
set_hexpand: true,
set_orientation: gtk::Orientation::Vertical,
set_spacing: 6,
gtk::Label {
add_css_class: "title-1",
set_halign: gtk::Align::Start,
#[watch]
set_label: &model.name,
},
gtk::Label {
add_css_class: "dim-label",
add_css_class: "heading",
set_halign: gtk::Align::Start,
#[watch]
set_label: &model.pkg,
append = &gtk::FlowBoxChild {
gtk::Box {
set_halign: gtk::Align::Fill,
set_valign: gtk::Align::Center,
set_hexpand: true,
set_orientation: gtk::Orientation::Vertical,
set_spacing: 6,
gtk::Label {
add_css_class: "title-1",
set_halign: gtk::Align::Start,
set_wrap: true,
set_wrap_mode: pango::WrapMode::WordChar,
set_natural_wrap_mode: gtk::NaturalWrapMode::Word,
#[watch]
set_label: &model.name,
},
gtk::Label {
add_css_class: "dim-label",
add_css_class: "heading",
set_halign: gtk::Align::Start,
set_wrap: true,
set_wrap_mode: pango::WrapMode::WordChar,
set_natural_wrap_mode: gtk::NaturalWrapMode::Word,
#[watch]
set_label: &model.pkg,
},
},
},
// Install options
adw::Bin {
set_width_request: 150,
append = &gtk::FlowBoxChild {
set_halign: gtk::Align::End,
gtk::Box {
set_halign: gtk::Align::End,
@ -296,6 +309,7 @@ impl Component for PkgModel {
match model.installtype {
InstallType::User => {
gtk::Box {
#[name(userinstallstack)]
if model.workqueue.iter().any(|x| x.pkg == model.pkg && x.pkgtype == InstallType::User) /*model.installinguserpkgs.contains(&model.pkg)*/ {
gtk::Box {
gtk::Spinner {
@ -399,6 +413,7 @@ impl Component for PkgModel {
}
InstallType::System => {
gtk::Box {
#[name(systeminstallstack)]
if model.workqueue.iter().any(|x| x.pkg == model.pkg && x.pkgtype == InstallType::System) {
gtk::Box {
gtk::Spinner {
@ -1026,6 +1041,8 @@ impl Component for PkgModel {
}",
);
let widgets = view_output!();
widgets.userinstallstack.set_hhomogeneous(false);
widgets.systeminstallstack.set_hhomogeneous(false);
let group = RelmActionGroup::<ModeActionGroup>::new();
let nixenv: RelmAction<NixEnvAction> = {

View File

@ -335,7 +335,7 @@ impl Component for AppModel {
set_selection_mode: gtk::SelectionMode::None,
set_homogeneous: true,
set_max_children_per_line: 3,
set_min_children_per_line: 2,
set_min_children_per_line: 1,
set_column_spacing: 14,
set_row_spacing: 14,
},