feat(ui): redesigned main button

This commit is contained in:
Observer KRypt0n_ 2023-05-16 20:30:46 +02:00
parent 7a7cdb38f1
commit e2f66180d2
No known key found for this signature in database
GPG key ID: 844DA47BA25FE1E2

View file

@ -385,23 +385,27 @@ impl SimpleComponent for App {
set_css_classes: &["background", "round-bin"],
gtk::Button {
#[watch]
set_label: &match model.state {
Some(LauncherState::Launch) => tr("launch"),
Some(LauncherState::PredownloadAvailable { .. }) => tr("launch"),
Some(LauncherState::FolderMigrationRequired { .. }) => tr("migrate-folders"),
Some(LauncherState::UnityPlayerPatchAvailable(_)) => tr("apply-patch"),
Some(LauncherState::XluaPatchAvailable(_)) => tr("apply-patch"),
Some(LauncherState::WineNotInstalled) => tr("download-wine"),
Some(LauncherState::PrefixNotExists) => tr("create-prefix"),
Some(LauncherState::VoiceUpdateAvailable(_)) => tr("update"),
Some(LauncherState::VoiceOutdated(_)) => tr("update"),
Some(LauncherState::VoiceNotInstalled(_)) => tr("download"),
Some(LauncherState::GameUpdateAvailable(_)) => tr("update"),
Some(LauncherState::GameOutdated(_)) => tr("update"),
Some(LauncherState::GameNotInstalled(_)) => tr("download"),
adw::ButtonContent {
set_icon_name: "media-playback-start-symbolic",
None => String::from("...")
#[watch]
set_label: &match model.state {
Some(LauncherState::Launch) => tr("launch"),
Some(LauncherState::PredownloadAvailable { .. }) => tr("launch"),
Some(LauncherState::FolderMigrationRequired { .. }) => tr("migrate-folders"),
Some(LauncherState::UnityPlayerPatchAvailable(_)) => tr("apply-patch"),
Some(LauncherState::XluaPatchAvailable(_)) => tr("apply-patch"),
Some(LauncherState::WineNotInstalled) => tr("download-wine"),
Some(LauncherState::PrefixNotExists) => tr("create-prefix"),
Some(LauncherState::VoiceUpdateAvailable(_)) => tr("update"),
Some(LauncherState::VoiceOutdated(_)) => tr("update"),
Some(LauncherState::VoiceNotInstalled(_)) => tr("download"),
Some(LauncherState::GameUpdateAvailable(_)) => tr("update"),
Some(LauncherState::GameOutdated(_)) => tr("update"),
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