SAO UI uses MusicPlayerPanel when the protocol is selected

This commit is contained in:
mars 2022-11-16 19:37:28 -07:00
parent 317541486c
commit 3ddda5f0c1
1 changed files with 9 additions and 2 deletions

View File

@ -12,12 +12,19 @@ pub mod widgets;
use api::*;
use canary_script::*;
use main_menu::MainMenuPanel;
use music_player::MusicPlayerPanel;
use widgets::Widget;
export_abi!(bind_panel_impl);
fn bind_panel_impl(panel: Panel, _protocol: Message, msg: Message) -> Box<dyn PanelImpl> {
MainMenuPanel::bind(panel, msg)
fn bind_panel_impl(panel: Panel, protocol: Message, msg: Message) -> Box<dyn PanelImpl> {
let protocol = protocol.to_vec();
let protocol = String::from_utf8(protocol).unwrap();
match protocol.as_str() {
"tebibyte-media.desktop.music-player-controller" => MusicPlayerPanel::bind(panel, msg),
_ => MainMenuPanel::bind(panel, msg),
}
}
pub const ICON_FONT: &str = "Iosevka Nerd Font";