Rebrand to Galaxy, major improvements to Bedrock support, still needs some TLC though
This commit is contained in:
@@ -8,12 +8,12 @@ license.workspace = true
|
||||
[dependencies]
|
||||
pathfinder_color.workspace = true
|
||||
pathfinder_geometry.workspace = true
|
||||
warpui.workspace = true
|
||||
warp_core.workspace = true
|
||||
galaxyui.workspace = true
|
||||
galaxy_core.workspace = true
|
||||
|
||||
[dev-dependencies]
|
||||
anyhow.workspace = true
|
||||
asset_cache.workspace = true
|
||||
rust-embed.workspace = true
|
||||
rustls.workspace = true
|
||||
warp_core = { workspace = true, features = ["test-util"] }
|
||||
galaxy_core = { workspace = true, features = ["test-util"] }
|
||||
|
||||
@@ -8,8 +8,8 @@ use ui_components::{
|
||||
lightbox::{self, LightboxImage, LightboxImageSource, NavigationDirection},
|
||||
switch, tooltip,
|
||||
};
|
||||
use warp_core::ui::{Icon, appearance::Appearance, theme::color::internal_colors};
|
||||
use warpui::{
|
||||
use galaxy_core::ui::{Icon, appearance::Appearance, theme::color::internal_colors};
|
||||
use galaxyui::{
|
||||
AssetProvider, SingletonEntity, Tracked,
|
||||
assets::asset_cache::{AssetCache, AssetSource, AssetState},
|
||||
r#async::Timer,
|
||||
@@ -37,7 +37,7 @@ impl AssetProvider for Assets {
|
||||
}
|
||||
}
|
||||
|
||||
fn main() -> warpui::platform::app::TerminationResult {
|
||||
fn main() -> galaxyui::platform::app::TerminationResult {
|
||||
// Initialize the TLS provider so reqwest can make HTTPS requests.
|
||||
rustls::crypto::aws_lc_rs::default_provider()
|
||||
.install_default()
|
||||
@@ -54,7 +54,7 @@ fn main() -> warpui::platform::app::TerminationResult {
|
||||
"Noto Sans".to_string()
|
||||
};
|
||||
|
||||
let font_family = warpui::fonts::Cache::handle(ctx).update(ctx, |cache, _ctx| {
|
||||
let font_family = galaxyui::fonts::Cache::handle(ctx).update(ctx, |cache, _ctx| {
|
||||
cache.load_system_font(&font_name).unwrap()
|
||||
});
|
||||
ctx.add_singleton_model(|ctx| {
|
||||
@@ -64,7 +64,7 @@ fn main() -> warpui::platform::app::TerminationResult {
|
||||
});
|
||||
|
||||
{
|
||||
use warpui::keymap::macros::*;
|
||||
use galaxyui::keymap::macros::*;
|
||||
let lightbox_open = id!("RootView") & id!("RootView_LightboxOpen");
|
||||
ctx.register_fixed_bindings([
|
||||
FixedBinding::new(
|
||||
@@ -82,7 +82,7 @@ fn main() -> warpui::platform::app::TerminationResult {
|
||||
]);
|
||||
}
|
||||
|
||||
ctx.add_window(warpui::AddWindowOptions::default(), RootView::new);
|
||||
ctx.add_window(galaxyui::AddWindowOptions::default(), RootView::new);
|
||||
})
|
||||
}
|
||||
|
||||
@@ -174,7 +174,7 @@ impl View for RootView {
|
||||
"RootView"
|
||||
}
|
||||
|
||||
fn keymap_context(&self, _: &AppContext) -> warpui::keymap::Context {
|
||||
fn keymap_context(&self, _: &AppContext) -> galaxyui::keymap::Context {
|
||||
let mut context = Self::default_keymap_context();
|
||||
if *self.dialog_open {
|
||||
context.set.insert("RootView_DialogOpen");
|
||||
@@ -240,7 +240,7 @@ impl RootView {
|
||||
options: switch::Options {
|
||||
hover_border_size: Some(10.),
|
||||
label: Some(Box::new(move |appearance: &Appearance| {
|
||||
warpui::elements::Text::new(
|
||||
galaxyui::elements::Text::new(
|
||||
"Switch",
|
||||
appearance.ui_font_family(),
|
||||
appearance.ui_font_size(),
|
||||
@@ -260,7 +260,7 @@ impl RootView {
|
||||
tooltip::Params {
|
||||
label: "Tooltip label".into(),
|
||||
options: tooltip::Options {
|
||||
keyboard_shortcut: Some(warpui::keymap::Keystroke {
|
||||
keyboard_shortcut: Some(galaxyui::keymap::Keystroke {
|
||||
ctrl: true,
|
||||
key: "k".to_string(),
|
||||
..Default::default()
|
||||
@@ -282,7 +282,7 @@ impl RootView {
|
||||
content: button::Content::Label("Primary".into()),
|
||||
theme: &button::themes::Primary,
|
||||
options: button::Options {
|
||||
keystroke: Some(warpui::keymap::Keystroke {
|
||||
keystroke: Some(galaxyui::keymap::Keystroke {
|
||||
ctrl: true,
|
||||
key: "k".to_string(),
|
||||
..Default::default()
|
||||
@@ -304,7 +304,7 @@ impl RootView {
|
||||
content: button::Content::Label("Secondary".into()),
|
||||
theme: &button::themes::Secondary,
|
||||
options: button::Options {
|
||||
keystroke: Some(warpui::keymap::Keystroke {
|
||||
keystroke: Some(galaxyui::keymap::Keystroke {
|
||||
cmd: true,
|
||||
key: "enter".to_string(),
|
||||
..Default::default()
|
||||
@@ -327,7 +327,7 @@ impl RootView {
|
||||
theme: &button::themes::Primary,
|
||||
options: button::Options {
|
||||
disabled: true,
|
||||
keystroke: Some(warpui::keymap::Keystroke {
|
||||
keystroke: Some(galaxyui::keymap::Keystroke {
|
||||
shift: true,
|
||||
key: "d".to_string(),
|
||||
..Default::default()
|
||||
@@ -368,7 +368,7 @@ impl RootView {
|
||||
theme: &button::themes::Primary,
|
||||
options: button::Options {
|
||||
size: button::Size::Small,
|
||||
keystroke: Some(warpui::keymap::Keystroke {
|
||||
keystroke: Some(galaxyui::keymap::Keystroke {
|
||||
ctrl: true,
|
||||
key: "k".to_string(),
|
||||
..Default::default()
|
||||
@@ -391,7 +391,7 @@ impl RootView {
|
||||
theme: &button::themes::Secondary,
|
||||
options: button::Options {
|
||||
size: button::Size::Small,
|
||||
keystroke: Some(warpui::keymap::Keystroke {
|
||||
keystroke: Some(galaxyui::keymap::Keystroke {
|
||||
cmd: true,
|
||||
key: "enter".to_string(),
|
||||
..Default::default()
|
||||
@@ -415,7 +415,7 @@ impl RootView {
|
||||
options: button::Options {
|
||||
disabled: true,
|
||||
size: button::Size::Small,
|
||||
keystroke: Some(warpui::keymap::Keystroke {
|
||||
keystroke: Some(galaxyui::keymap::Keystroke {
|
||||
shift: true,
|
||||
key: "d".to_string(),
|
||||
..Default::default()
|
||||
@@ -438,7 +438,7 @@ impl RootView {
|
||||
theme: &button::themes::Secondary,
|
||||
options: button::Options {
|
||||
size: button::Size::Small,
|
||||
keystroke: Some(warpui::keymap::Keystroke {
|
||||
keystroke: Some(galaxyui::keymap::Keystroke {
|
||||
key: "escape".to_string(),
|
||||
..Default::default()
|
||||
}),
|
||||
@@ -498,7 +498,7 @@ impl RootView {
|
||||
on_dismiss: Some(Arc::new(|ctx, _app| {
|
||||
ctx.dispatch_typed_action(Action::CloseDialog);
|
||||
})),
|
||||
dismiss_keystroke: Some(warpui::keymap::Keystroke {
|
||||
dismiss_keystroke: Some(galaxyui::keymap::Keystroke {
|
||||
key: "escape".to_string(),
|
||||
..Default::default()
|
||||
}),
|
||||
@@ -564,7 +564,7 @@ impl RootView {
|
||||
}),
|
||||
current_image_native_size,
|
||||
options: lightbox::Options {
|
||||
dismiss_keystroke: Some(warpui::keymap::Keystroke {
|
||||
dismiss_keystroke: Some(galaxyui::keymap::Keystroke {
|
||||
key: "escape".to_string(),
|
||||
..Default::default()
|
||||
}),
|
||||
@@ -597,7 +597,7 @@ impl RootView {
|
||||
}),
|
||||
current_image_native_size,
|
||||
options: lightbox::Options {
|
||||
dismiss_keystroke: Some(warpui::keymap::Keystroke {
|
||||
dismiss_keystroke: Some(galaxyui::keymap::Keystroke {
|
||||
key: "escape".to_string(),
|
||||
..Default::default()
|
||||
}),
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
mod params;
|
||||
pub mod themes;
|
||||
|
||||
use warp_core::ui::{
|
||||
use galaxy_core::ui::{
|
||||
appearance::Appearance,
|
||||
color::{ContrastingColor as _, contrast::MinimumAllowedContrast},
|
||||
};
|
||||
use warpui::{
|
||||
use galaxyui::{
|
||||
elements::{MouseState, MouseStateHandle},
|
||||
prelude::*,
|
||||
};
|
||||
@@ -55,7 +55,7 @@ impl crate::Component for Button {
|
||||
Content::Icon(icon) | Content::IconAndLabel(icon, _) => {
|
||||
let icon_size = size.icon_size();
|
||||
row.add_child(
|
||||
ConstrainedBox::new(icon.to_warpui_icon(text_color.into()).finish())
|
||||
ConstrainedBox::new(icon.to_galaxyui_icon(text_color.into()).finish())
|
||||
.with_width(icon_size)
|
||||
.with_height(icon_size)
|
||||
.finish(),
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
use std::borrow::Cow;
|
||||
|
||||
use warp_core::ui::Icon;
|
||||
use warp_core::ui::appearance::Appearance;
|
||||
use warpui::{fonts, keymap::Keystroke, prelude::stack};
|
||||
use galaxy_core::ui::Icon;
|
||||
use galaxy_core::ui::appearance::Appearance;
|
||||
use galaxyui::{fonts, keymap::Keystroke, prelude::stack};
|
||||
|
||||
use crate::{keyboard_shortcut, tooltip};
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use pathfinder_color::ColorU;
|
||||
use warp_core::ui::{
|
||||
use galaxy_core::ui::{
|
||||
appearance::Appearance, color::coloru_with_opacity, theme::Fill, theme::color::internal_colors,
|
||||
};
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use std::{borrow::Cow, sync::Arc};
|
||||
|
||||
use warp_core::ui::{Icon, appearance::Appearance, theme::color::internal_colors};
|
||||
use warpui::{
|
||||
use galaxy_core::ui::{Icon, appearance::Appearance, theme::color::internal_colors};
|
||||
use galaxyui::{
|
||||
AppContext, EventContext,
|
||||
elements::{
|
||||
Border, ConstrainedBox, Container, CornerRadius, CrossAxisAlignment, Dismiss, Element,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use std::borrow::Cow;
|
||||
|
||||
use warp_core::ui::{appearance::Appearance, icons::Icon};
|
||||
use warpui::{keymap::Keystroke, platform::OperatingSystem, prelude::*};
|
||||
use galaxy_core::ui::{appearance::Appearance, icons::Icon};
|
||||
use galaxyui::{keymap::Keystroke, platform::OperatingSystem, prelude::*};
|
||||
|
||||
use crate::Component;
|
||||
|
||||
|
||||
@@ -7,8 +7,8 @@ pub mod tooltip;
|
||||
|
||||
pub use keyboard_shortcut::KeyboardShortcut;
|
||||
|
||||
use warp_core::ui::appearance::Appearance;
|
||||
use warpui::Element;
|
||||
use galaxy_core::ui::appearance::Appearance;
|
||||
use galaxyui::Element;
|
||||
|
||||
/// A reusable UI component that can be rendered with configurable parameters.
|
||||
///
|
||||
@@ -31,8 +31,8 @@ use warpui::Element;
|
||||
///
|
||||
/// ```rust
|
||||
/// use ui_components::{Component, Options, button};
|
||||
/// use warp_core::ui::appearance::Appearance;
|
||||
/// use warpui::prelude::*;
|
||||
/// use galaxy_core::ui::appearance::Appearance;
|
||||
/// use galaxyui::prelude::*;
|
||||
///
|
||||
/// // Store component as a field in your view.
|
||||
/// struct MyView {
|
||||
@@ -40,7 +40,7 @@ use warpui::Element;
|
||||
/// }
|
||||
///
|
||||
/// impl MyView {
|
||||
/// fn render_button(&self, appearance: &Appearance) -> Box<dyn warpui::Element> {
|
||||
/// fn render_button(&self, appearance: &Appearance) -> Box<dyn galaxyui::Element> {
|
||||
/// self.my_button.render(
|
||||
/// appearance,
|
||||
/// button::Params {
|
||||
@@ -62,8 +62,8 @@ use warpui::Element;
|
||||
///
|
||||
/// ```rust
|
||||
/// use ui_components::Component;
|
||||
/// use warp_core::ui::appearance::Appearance;
|
||||
/// use warpui::prelude::*;
|
||||
/// use galaxy_core::ui::appearance::Appearance;
|
||||
/// use galaxyui::prelude::*;
|
||||
///
|
||||
/// // 1. Define the component struct with any persistent state.
|
||||
/// #[derive(Default)]
|
||||
@@ -136,7 +136,7 @@ pub trait Component: Default {
|
||||
///
|
||||
/// ```rust
|
||||
/// use ui_components::{Params, Options};
|
||||
/// use warp_core::ui::appearance::Appearance;
|
||||
/// use galaxy_core::ui::appearance::Appearance;
|
||||
///
|
||||
/// pub struct MyParams {
|
||||
/// pub content: String, // Required.
|
||||
@@ -177,7 +177,7 @@ pub trait Params {
|
||||
///
|
||||
/// ```rust
|
||||
/// use ui_components::{Options, MouseEventHandler};
|
||||
/// use warp_core::ui::appearance::Appearance;
|
||||
/// use galaxy_core::ui::appearance::Appearance;
|
||||
///
|
||||
/// pub struct MyOptions {
|
||||
/// pub disabled: bool,
|
||||
@@ -232,8 +232,8 @@ pub trait Options {
|
||||
///
|
||||
/// ```rust
|
||||
/// use ui_components::{Renderable, Options};
|
||||
/// use warp_core::ui::appearance::Appearance;
|
||||
/// use warpui::prelude::*;
|
||||
/// use galaxy_core::ui::appearance::Appearance;
|
||||
/// use galaxyui::prelude::*;
|
||||
///
|
||||
/// pub struct SwitchOptions<'a> {
|
||||
/// pub disabled: bool,
|
||||
@@ -283,8 +283,8 @@ where
|
||||
/// A function that handles mouse events.
|
||||
pub type MouseEventHandler = Box<
|
||||
dyn FnMut(
|
||||
&mut warpui::EventContext,
|
||||
&warpui::AppContext,
|
||||
&mut galaxyui::EventContext,
|
||||
&galaxyui::AppContext,
|
||||
pathfinder_geometry::vector::Vector2F,
|
||||
),
|
||||
>;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use pathfinder_geometry::vector::{Vector2F, vec2f};
|
||||
use warp_core::ui::{Icon, appearance::Appearance};
|
||||
use warpui::{
|
||||
use galaxy_core::ui::{Icon, appearance::Appearance};
|
||||
use galaxyui::{
|
||||
assets::asset_cache::AssetSource,
|
||||
elements::{CacheOption, Dismiss, DispatchEventResult, EventHandler, Image, Shrinkable},
|
||||
keymap::Keystroke,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use std::sync::LazyLock;
|
||||
|
||||
use warp_core::ui::appearance::Appearance;
|
||||
use warpui::{
|
||||
use galaxy_core::ui::appearance::Appearance;
|
||||
use galaxyui::{
|
||||
elements::{MouseStateHandle, Rect},
|
||||
prelude::{stack::*, *},
|
||||
};
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use std::borrow::Cow;
|
||||
|
||||
use warp_core::ui::{appearance::Appearance, theme::color::internal_colors};
|
||||
use warpui::{keymap::Keystroke, prelude::*};
|
||||
use galaxy_core::ui::{appearance::Appearance, theme::color::internal_colors};
|
||||
use galaxyui::{keymap::Keystroke, prelude::*};
|
||||
|
||||
use crate::{Component, keyboard_shortcut};
|
||||
|
||||
@@ -39,7 +39,7 @@ impl Component for Tooltip {
|
||||
&self,
|
||||
appearance: &Appearance,
|
||||
params: Self::Params<'a>,
|
||||
) -> Box<dyn warpui::Element> {
|
||||
) -> Box<dyn galaxyui::Element> {
|
||||
let font_family = appearance.ui_font_family();
|
||||
let font_size = appearance.ui_font_size() + UI_FONT_SIZE_ADJUSTMENT;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user