Skip to content
Snippets Groups Projects
Commit 7d524f1a authored by Jeremy Soller's avatar Jeremy Soller
Browse files

Update ui submodule, fix launcher on linux

parent ba6eb065
No related branches found
No related tags found
No related merge requests found
...@@ -5,6 +5,12 @@ extern crate orbclient; ...@@ -5,6 +5,12 @@ extern crate orbclient;
extern crate orbimage; extern crate orbimage;
extern crate orbfont; extern crate orbfont;
#[cfg(target_os = "redox")]
static UI_PATH: &'static str = "/ui";
#[cfg(not(target_os = "redox"))]
static UI_PATH: &'static str = "ui";
#[cfg(not(target_os = "redox"))] #[cfg(not(target_os = "redox"))]
fn wait(status: &mut i32) -> usize { fn wait(status: &mut i32) -> usize {
extern crate libc; extern crate libc;
...@@ -44,7 +50,7 @@ const TEXT_COLOR: Color = Color::rgb(204, 210, 224); ...@@ -44,7 +50,7 @@ const TEXT_COLOR: Color = Color::rgb(204, 210, 224);
const TEXT_HIGHLIGHT_COLOR: Color = Color::rgb(235, 241, 255); const TEXT_HIGHLIGHT_COLOR: Color = Color::rgb(235, 241, 255);
fn get_packages() -> Vec<Package> { fn get_packages() -> Vec<Package> {
let read_dir = Path::new("/ui/apps/").read_dir().expect("failed to read_dir on /ui/apps/"); let read_dir = Path::new(&format!("{}/apps/", UI_PATH)).read_dir().expect("failed to read apps directory");
let mut entries = vec![]; let mut entries = vec![];
for dir in read_dir { for dir in read_dir {
...@@ -62,7 +68,7 @@ fn get_packages() -> Vec<Package> { ...@@ -62,7 +68,7 @@ fn get_packages() -> Vec<Package> {
let mut packages: Vec<Package> = Vec::new(); let mut packages: Vec<Package> = Vec::new();
for entry in entries.iter() { for entry in entries.iter() {
packages.push(Package::from_path(&format!("/ui/apps/{}", entry))); packages.push(Package::from_path(&format!("{}/apps/{}", UI_PATH, entry)));
} }
packages packages
...@@ -152,9 +158,9 @@ fn bar_main() { ...@@ -152,9 +158,9 @@ fn bar_main() {
let packages = get_packages(); let packages = get_packages();
let start = Image::from_path("/ui/icons/start.png").unwrap_or(Image::default()); let start = Image::from_path(format!("{}/icons/start.png", UI_PATH)).unwrap_or(Image::default());
let shutdown = Image::from_path("/ui/icons/actions/system-log-out.png").unwrap_or(Image::default()); let shutdown = Image::from_path(format!("{}/icons/actions/system-log-out.png", UI_PATH)).unwrap_or(Image::default());
let (width, height) = orbclient::get_display_size().expect("launcher: failed to get display size"); let (width, height) = orbclient::get_display_size().expect("launcher: failed to get display size");
let mut window = Window::new(0, height as i32 - 32, width, 32, "").expect("launcher: failed to open window"); let mut window = Window::new(0, height as i32 - 32, width, 32, "").expect("launcher: failed to open window");
......
Subproject commit 0192262071d97ff8eb0c61824560797e7a5f3e5e Subproject commit 4a1f87b219b3db104f3e9ff21d974118357ff2e1
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment