mirror of
https://github.com/an-anime-team/an-anime-game-launcher.git
synced 2025-02-18 00:02:06 +03:00
feat(ui): redesigned main button
This commit is contained in:
parent
7a7cdb38f1
commit
e2f66180d2
1 changed files with 29 additions and 28 deletions
|
@ -385,6 +385,9 @@ impl SimpleComponent for App {
|
|||
set_css_classes: &["background", "round-bin"],
|
||||
|
||||
gtk::Button {
|
||||
adw::ButtonContent {
|
||||
set_icon_name: "media-playback-start-symbolic",
|
||||
|
||||
#[watch]
|
||||
set_label: &match model.state {
|
||||
Some(LauncherState::Launch) => tr("launch"),
|
||||
|
@ -402,6 +405,7 @@ impl SimpleComponent for App {
|
|||
Some(LauncherState::GameNotInstalled(_)) => tr("download"),
|
||||
|
||||
None => String::from("...")
|
||||
}
|
||||
},
|
||||
|
||||
#[watch]
|
||||
|
@ -427,21 +431,21 @@ impl SimpleComponent for App {
|
|||
#[watch]
|
||||
set_css_classes: match &model.state {
|
||||
Some(LauncherState::GameOutdated { .. }) |
|
||||
Some(LauncherState::VoiceOutdated(_)) => &["warning"],
|
||||
Some(LauncherState::VoiceOutdated(_)) => &["warning", "pill"],
|
||||
|
||||
Some(LauncherState::UnityPlayerPatchAvailable(UnityPlayerPatch { status, .. })) |
|
||||
Some(LauncherState::XluaPatchAvailable(XluaPatch { status, .. })) => match status {
|
||||
PatchStatus::NotAvailable |
|
||||
PatchStatus::Outdated { .. } |
|
||||
PatchStatus::Preparation { .. } => &["error"],
|
||||
PatchStatus::Preparation { .. } => &["error", "pill"],
|
||||
|
||||
PatchStatus::Testing { .. } => &["warning"],
|
||||
PatchStatus::Available { .. } => &["suggested-action"]
|
||||
PatchStatus::Testing { .. } => &["warning", "pill"],
|
||||
PatchStatus::Available { .. } => &["suggested-action", "pill"]
|
||||
},
|
||||
|
||||
Some(_) => &["suggested-action"],
|
||||
Some(_) => &["suggested-action", "pill"],
|
||||
|
||||
None => &[]
|
||||
None => &["pill"]
|
||||
},
|
||||
|
||||
#[watch]
|
||||
|
@ -475,15 +479,12 @@ impl SimpleComponent for App {
|
|||
set_css_classes: &["background", "round-bin"],
|
||||
|
||||
gtk::Button {
|
||||
#[watch]
|
||||
set_width_request: match model.style {
|
||||
LauncherStyle::Modern => -1,
|
||||
LauncherStyle::Classic => 40
|
||||
},
|
||||
|
||||
#[watch]
|
||||
set_sensitive: !model.disabled_buttons,
|
||||
|
||||
set_width_request: 48,
|
||||
|
||||
add_css_class: "circular",
|
||||
set_icon_name: "emblem-system-symbolic",
|
||||
|
||||
connect_clicked => AppMsg::OpenPreferences
|
||||
|
|
Loading…
Add table
Reference in a new issue