mirror of
https://github.com/an-anime-team/sleepy-launcher.git
synced 2025-02-16 17:59:46 +03:00
feat(ui): added dynamic main button icon switching
This commit is contained in:
parent
f3b7a53fea
commit
0f0cb33d46
1 changed files with 28 additions and 1 deletions
|
@ -386,7 +386,34 @@ impl SimpleComponent for App {
|
|||
|
||||
gtk::Button {
|
||||
adw::ButtonContent {
|
||||
set_icon_name: "media-playback-start-symbolic",
|
||||
#[watch]
|
||||
set_icon_name: match &model.state {
|
||||
Some(LauncherState::Launch) |
|
||||
Some(LauncherState::PredownloadAvailable { .. }) => "media-playback-start-symbolic",
|
||||
|
||||
Some(LauncherState::FolderMigrationRequired { .. }) |
|
||||
Some(LauncherState::WineNotInstalled) |
|
||||
Some(LauncherState::PrefixNotExists) => "document-save-symbolic",
|
||||
|
||||
Some(LauncherState::GameUpdateAvailable(_)) |
|
||||
Some(LauncherState::GameNotInstalled(_)) |
|
||||
Some(LauncherState::VoiceUpdateAvailable(_)) |
|
||||
Some(LauncherState::VoiceNotInstalled(_)) => "document-save-symbolic",
|
||||
|
||||
Some(LauncherState::UnityPlayerPatchAvailable(UnityPlayerPatch { status, .. })) |
|
||||
Some(LauncherState::XluaPatchAvailable(XluaPatch { status, .. })) => match status {
|
||||
PatchStatus::NotAvailable |
|
||||
PatchStatus::Outdated { .. } |
|
||||
PatchStatus::Preparation { .. } => "window-close-symbolic",
|
||||
|
||||
PatchStatus::Testing { .. } |
|
||||
PatchStatus::Available { .. } => "document-save-symbolic"
|
||||
}
|
||||
|
||||
Some(LauncherState::VoiceOutdated(_)) |
|
||||
Some(LauncherState::GameOutdated(_)) |
|
||||
None => "window-close-symbolic"
|
||||
},
|
||||
|
||||
#[watch]
|
||||
set_label: &match model.state {
|
||||
|
|
Loading…
Add table
Reference in a new issue