Rebrand to Galaxy, major improvements to Bedrock support, still needs some TLC though

This commit is contained in:
Ryan Ward
2026-05-07 11:29:34 -05:00
parent f4e2475c60
commit a41cbd8cc7
2433 changed files with 14208 additions and 9409 deletions
+40
View File
@@ -0,0 +1,40 @@
use anyhow::{anyhow, Result};
use std::borrow::Cow;
pub mod root_view;
extern crate galaxyui;
use rust_embed::RustEmbed;
use galaxyui::{platform, AssetProvider};
#[derive(Clone, Copy, RustEmbed)]
#[folder = "examples/assets"]
pub struct Assets;
// The static assets we need to load in app.
pub static ASSETS: Assets = Assets;
// Implement the AssetProvider trait here (required by App::new).
impl AssetProvider for Assets {
fn get(&self, path: &str) -> Result<Cow<'_, [u8]>> {
<Assets as RustEmbed>::get(path)
.map(|f| f.data)
.ok_or_else(|| anyhow!("no asset exists at path {}", path))
}
}
fn main() -> Result<()> {
let app_builder =
platform::AppBuilder::new(platform::AppCallbacks::default(), Box::new(ASSETS), None);
let _ = app_builder.run(move |ctx| {
ctx.add_window(
galaxyui::AddWindowOptions {
// Set the window background blur radius to 18 pixels.
background_blur_radius_pixels: Some(18),
..Default::default()
},
|_| root_view::BlurredView {},
);
});
Ok(())
}
@@ -0,0 +1,25 @@
use pathfinder_color::ColorU;
use galaxyui::{elements::Rect, AppContext, Element, Entity, TypedActionView, View};
pub struct BlurredView {}
impl Entity for BlurredView {
type Event = ();
}
impl View for BlurredView {
fn ui_name() -> &'static str {
"RootView"
}
/// Renders a transparent red rectangle. The blur effect is applied on the window (see
/// `open_new()`.
fn render(&self, _: &AppContext) -> Box<dyn Element> {
Rect::new()
.with_background_color(ColorU::new(255, 0, 0, 50))
.finish()
}
}
impl TypedActionView for BlurredView {
type Action = ();
}