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
@@ -1,4 +1,4 @@
use warpui::{
use galaxyui::{
AppContext, Element, SizeConstraint,
elements::{
Align, ConstrainedBox, Container, CornerRadius, CrossAxisAlignment, Empty, Flex, Icon,
@@ -79,8 +79,8 @@ impl RenderableBlock for RenderableBrokenEmbedding {
fn layout(
&mut self,
model: &crate::render::model::RenderState,
ctx: &mut warpui::LayoutContext,
app: &warpui::AppContext,
ctx: &mut galaxyui::LayoutContext,
app: &galaxyui::AppContext,
) {
self.row.layout(
SizeConstraint::strict(vec2f(
@@ -104,7 +104,7 @@ impl RenderableBlock for RenderableBrokenEmbedding {
&mut self,
model: &crate::render::model::RenderState,
ctx: &mut super::RenderContext,
app: &warpui::AppContext,
app: &galaxyui::AppContext,
) {
let content = model.content();
let broken_link = extract_block!(self.viewport_item, content, (block, BlockItem::Embedded(item)) => block.embedded(item));
@@ -154,21 +154,21 @@ impl RenderableBlock for RenderableBrokenEmbedding {
);
}
ctx.paint.scene.start_layer(warpui::ClipBounds::ActiveLayer);
ctx.paint.scene.start_layer(galaxyui::ClipBounds::ActiveLayer);
self.row
.paint(ctx.content_to_screen(content_origin), ctx.paint, app);
ctx.paint.scene.stop_layer();
}
fn after_layout(&mut self, ctx: &mut warpui::AfterLayoutContext, app: &warpui::AppContext) {
fn after_layout(&mut self, ctx: &mut galaxyui::AfterLayoutContext, app: &galaxyui::AppContext) {
self.row.after_layout(ctx, app);
}
fn dispatch_event(
&mut self,
_model: &crate::render::model::RenderState,
event: &warpui::event::DispatchedEvent,
ctx: &mut warpui::EventContext,
event: &galaxyui::event::DispatchedEvent,
ctx: &mut galaxyui::EventContext,
app: &AppContext,
) -> bool {
self.row.dispatch_event(event, ctx, app)
+3 -3
View File
@@ -37,8 +37,8 @@ impl RenderableBlock for Empty {
fn layout(
&mut self,
model: &RenderState,
ctx: &mut warpui::LayoutContext,
app: &warpui::AppContext,
ctx: &mut galaxyui::LayoutContext,
app: &galaxyui::AppContext,
) {
self.placeholder
.layout(&self.viewport_item, model, ctx, app, |_| {
@@ -49,7 +49,7 @@ impl RenderableBlock for Empty {
});
}
fn paint(&mut self, model: &RenderState, ctx: &mut RenderContext, _app: &warpui::AppContext) {
fn paint(&mut self, model: &RenderState, ctx: &mut RenderContext, _app: &galaxyui::AppContext) {
let content = model.content();
let cursor = extract_block!(self.viewport_item, content, (block, BlockItem::TrailingNewLine(cursor)) => block.trailing_newline(cursor));
if self.placeholder.paint(cursor.content_origin(), model, ctx) {
+3 -3
View File
@@ -31,8 +31,8 @@ impl RenderableBlock for RenderableHeader {
fn layout(
&mut self,
model: &RenderState,
ctx: &mut warpui::LayoutContext,
app: &warpui::AppContext,
ctx: &mut galaxyui::LayoutContext,
app: &galaxyui::AppContext,
) {
self.placeholder
.layout(&self.viewport_item, model, ctx, app, |block| {
@@ -53,7 +53,7 @@ impl RenderableBlock for RenderableHeader {
});
}
fn paint(&mut self, model: &RenderState, ctx: &mut RenderContext, _app: &warpui::AppContext) {
fn paint(&mut self, model: &RenderState, ctx: &mut RenderContext, _app: &galaxyui::AppContext) {
let content = model.content();
let (paragraph, header_size) = extract_block!(
self.viewport_item, content,
@@ -3,10 +3,10 @@ use crate::render::model::BlockItem;
use super::super::model::{RenderState, viewport::ViewportItem};
use super::{RenderContext, RenderableBlock};
use warp_core::ui::appearance::Appearance;
use warp_core::ui::theme::color::internal_colors;
use warpui::elements::{CrossAxisAlignment, Empty, Flex, ParentElement};
use warpui::{
use galaxy_core::ui::appearance::Appearance;
use galaxy_core::ui::theme::color::internal_colors;
use galaxyui::elements::{CrossAxisAlignment, Empty, Flex, ParentElement};
use galaxyui::{
AfterLayoutContext, AppContext, Element, LayoutContext, SingletonEntity, SizeConstraint,
elements::Container, geometry::vector::vec2f,
};
@@ -71,8 +71,8 @@ impl RenderableBlock for RenderableHiddenSection {
fn dispatch_event(
&mut self,
_model: &RenderState,
event: &warpui::event::DispatchedEvent,
ctx: &mut warpui::EventContext,
event: &galaxyui::event::DispatchedEvent,
ctx: &mut galaxyui::EventContext,
app: &AppContext,
) -> bool {
self.element.dispatch_event(event, ctx, app)
@@ -1,4 +1,4 @@
use warpui::{
use galaxyui::{
elements::{CornerRadius, Radius},
geometry::{
rect::RectF,
@@ -77,12 +77,12 @@ impl RenderableBlock for HorizontalRule {
fn layout(
&mut self,
_model: &RenderState,
_ctx: &mut warpui::LayoutContext,
_app: &warpui::AppContext,
_ctx: &mut galaxyui::LayoutContext,
_app: &galaxyui::AppContext,
) {
}
fn paint(&mut self, model: &RenderState, ctx: &mut RenderContext, _app: &warpui::AppContext) {
fn paint(&mut self, model: &RenderState, ctx: &mut RenderContext, _app: &galaxyui::AppContext) {
let content = model.content();
let horizontal_rule = extract_block!(self.viewport_item, content, (block, BlockItem::HorizontalRule(rule)) => block.horizontal_rule(rule));
+5 -5
View File
@@ -1,4 +1,4 @@
use warpui::{
use galaxyui::{
Element, SizeConstraint,
elements::{CacheOption, Image},
geometry::vector::vec2f,
@@ -39,8 +39,8 @@ impl RenderableBlock for RenderableImage {
fn layout(
&mut self,
model: &RenderState,
ctx: &mut warpui::LayoutContext,
app: &warpui::AppContext,
ctx: &mut galaxyui::LayoutContext,
app: &galaxyui::AppContext,
) {
let content = model.content();
let (asset_source, config) = extract_block!(
@@ -60,7 +60,7 @@ impl RenderableBlock for RenderableImage {
self.image_element = Some(Box::new(image));
}
fn paint(&mut self, model: &RenderState, ctx: &mut RenderContext, app: &warpui::AppContext) {
fn paint(&mut self, model: &RenderState, ctx: &mut RenderContext, app: &galaxyui::AppContext) {
let content = model.content();
let positioned_image = extract_block!(
self.viewport_item,
@@ -83,7 +83,7 @@ impl RenderableBlock for RenderableImage {
}
if selected {
let rect_bounds = warpui::geometry::rect::RectF::new(screen_position, size);
let rect_bounds = galaxyui::geometry::rect::RectF::new(screen_position, size);
ctx.paint
.scene
.draw_rect_with_hit_recording(rect_bounds)
@@ -1,6 +1,6 @@
use std::ops::Range;
use warpui::{
use galaxyui::{
AfterLayoutContext, AppContext, Element, EventContext, LayoutContext, ModelHandle,
PaintContext, SizeConstraint, WeakViewHandle,
elements::Point,
+3 -3
View File
@@ -1,4 +1,4 @@
use warpui::{
use galaxyui::{
AppContext, Element, SizeConstraint,
elements::{Align, CacheOption, CornerRadius, Image, Radius, Text},
geometry::vector::vec2f,
@@ -33,7 +33,7 @@ impl RenderableBlock for RenderableMermaidDiagram {
&self.viewport_item
}
fn layout(&mut self, model: &RenderState, ctx: &mut warpui::LayoutContext, app: &AppContext) {
fn layout(&mut self, model: &RenderState, ctx: &mut galaxyui::LayoutContext, app: &AppContext) {
let content = model.content();
let (asset_source, config) = extract_block!(
self.viewport_item,
@@ -111,7 +111,7 @@ impl RenderableBlock for RenderableMermaidDiagram {
}
}
fn after_layout(&mut self, ctx: &mut warpui::AfterLayoutContext, app: &warpui::AppContext) {
fn after_layout(&mut self, ctx: &mut galaxyui::AfterLayoutContext, app: &galaxyui::AppContext) {
if let Some(ref mut image_element) = self.image_element {
image_element.after_layout(ctx, app);
}
+6 -6
View File
@@ -11,8 +11,8 @@ use std::{
};
use temporary_block::RenderableTemporaryBlock;
use vim::vim::VimMode;
use warp_core::ui::theme::Fill as ThemeFill;
use warpui::{
use galaxy_core::ui::theme::Fill as ThemeFill;
use galaxyui::{
AfterLayoutContext, AppContext, Element, Event, EventContext, LayoutContext, ModelHandle,
PaintContext, SizeConstraint, WeakViewHandle,
color::ColorU,
@@ -85,7 +85,7 @@ pub enum VerticalExpansionBehavior {
/// An element that renders rich text, with no additional UI or decorations.
///
/// This element caches the positions listed in [`super::model::saved_positions::SavedPositions`],
/// and the parent view can overlay UI controls on top of them using a [`warpui::elements::Stack`].
/// and the parent view can overlay UI controls on top of them using a [`galaxyui::elements::Stack`].
///
/// It additionally reserves horizontal gutters, which are considered in-bounds for content hit
/// testing.
@@ -1077,7 +1077,7 @@ impl<V: EditorView> Element for RichTextElement<V> {
return;
};
ctx.scene
.start_layer(warpui::ClipBounds::BoundedBy(clip_bounds));
.start_layer(galaxyui::ClipBounds::BoundedBy(clip_bounds));
// Save the clipped content layer z-index for hover detection.
self.content_z_index = Some(ctx.scene.z_index());
@@ -1236,7 +1236,7 @@ impl<V: EditorView> NewScrollableElement for RichTextElement<V> {
})
}
fn scroll(&mut self, delta: warpui::units::Pixels, axis: Axis, ctx: &mut EventContext) {
fn scroll(&mut self, delta: galaxyui::units::Pixels, axis: Axis, ctx: &mut EventContext) {
if let Some(action) = V::Action::scroll(delta, axis) {
ctx.dispatch_typed_action(action);
}
@@ -1257,7 +1257,7 @@ impl<V: EditorView> ScrollableElement for RichTextElement<V> {
Some(self.vertical_scroll_data(app))
}
fn scroll(&mut self, delta: warpui::units::Pixels, ctx: &mut EventContext) {
fn scroll(&mut self, delta: galaxyui::units::Pixels, ctx: &mut EventContext) {
if let Some(action) = V::Action::scroll(delta, Axis::Vertical) {
ctx.dispatch_typed_action(action);
}
@@ -8,8 +8,8 @@ use crate::{
model::{BlockItem, RenderState, viewport::ViewportItem},
},
};
use warpui::elements::ListIndentLevel;
use warpui::{geometry::vector::vec2f, text_layout::TextFrame};
use galaxyui::elements::ListIndentLevel;
use galaxyui::{geometry::vector::vec2f, text_layout::TextFrame};
use super::{
RenderableBlock,
@@ -44,8 +44,8 @@ impl RenderableBlock for RenderableOrderedListItem {
fn layout(
&mut self,
model: &RenderState,
ctx: &mut warpui::LayoutContext,
app: &warpui::AppContext,
ctx: &mut galaxyui::LayoutContext,
app: &galaxyui::AppContext,
) {
let text_layout = TextLayout::from_layout_context(ctx, app, model);
let block_style = BufferBlockStyle::OrderedList {
@@ -75,7 +75,7 @@ impl RenderableBlock for RenderableOrderedListItem {
});
}
fn paint(&mut self, model: &RenderState, ctx: &mut RenderContext, _app: &warpui::AppContext) {
fn paint(&mut self, model: &RenderState, ctx: &mut RenderContext, _app: &galaxyui::AppContext) {
let content = model.content();
let paragraph = extract_block!(self.viewport_item, content, (block, BlockItem::OrderedList{ paragraph: inner, ..}) => block.ordered_list(inner));
+2 -2
View File
@@ -2,8 +2,8 @@
use std::ops::Range;
use warp_core::ui::appearance::DEFAULT_UI_FONT_SIZE;
use warpui::{
use galaxy_core::ui::appearance::DEFAULT_UI_FONT_SIZE;
use galaxyui::{
PaintContext,
elements::{CornerRadius, Point, Radius},
geometry::{
@@ -47,8 +47,8 @@ impl RenderableBlock for RenderableParagraph {
fn layout(
&mut self,
model: &RenderState,
ctx: &mut warpui::LayoutContext,
app: &warpui::AppContext,
ctx: &mut galaxyui::LayoutContext,
app: &galaxyui::AppContext,
) {
self.placeholder
.layout(&self.viewport_item, model, ctx, app, |_| {
@@ -59,7 +59,7 @@ impl RenderableBlock for RenderableParagraph {
});
}
fn paint(&mut self, model: &RenderState, ctx: &mut RenderContext, _app: &warpui::AppContext) {
fn paint(&mut self, model: &RenderState, ctx: &mut RenderContext, _app: &galaxyui::AppContext) {
let content = model.content();
let paragraph = extract_block!(self.viewport_item, content, (block, BlockItem::Paragraph(inner)) => block.paragraph(inner));
@@ -1,6 +1,6 @@
use std::sync::Arc;
use warpui::{
use galaxyui::{
AppContext, LayoutContext,
geometry::vector::{Vector2F, vec2f},
text_layout::Line,
@@ -1,4 +1,4 @@
use warpui::{
use galaxyui::{
AppContext, Element, SizeConstraint,
elements::{Border, CornerRadius, Empty, Radius},
geometry::vector::vec2f,
@@ -48,7 +48,7 @@ impl RenderableBlock for RenderableRunnableCommand {
&self.viewport_item
}
fn layout(&mut self, _model: &RenderState, ctx: &mut warpui::LayoutContext, app: &AppContext) {
fn layout(&mut self, _model: &RenderState, ctx: &mut galaxyui::LayoutContext, app: &AppContext) {
self.footer.layout(
SizeConstraint::strict(vec2f(
self.viewport_item.content_size.x(),
@@ -87,7 +87,7 @@ impl RenderableBlock for RenderableRunnableCommand {
// Place the button at a higher z-index for event handling. See the comment on
// `RichTextElement::content_z_index` for context.
ctx.paint.scene.start_layer(warpui::ClipBounds::ActiveLayer);
ctx.paint.scene.start_layer(galaxyui::ClipBounds::ActiveLayer);
// Position the block footer right below the content area, flush with its right-hand edge.
// This gives the footer some padding relative to the visible area with a background.
@@ -102,15 +102,15 @@ impl RenderableBlock for RenderableRunnableCommand {
ctx.paint.scene.stop_layer();
}
fn after_layout(&mut self, ctx: &mut warpui::AfterLayoutContext, app: &warpui::AppContext) {
fn after_layout(&mut self, ctx: &mut galaxyui::AfterLayoutContext, app: &galaxyui::AppContext) {
self.footer.after_layout(ctx, app);
}
fn dispatch_event(
&mut self,
_model: &crate::render::model::RenderState,
event: &warpui::event::DispatchedEvent,
ctx: &mut warpui::EventContext,
event: &galaxyui::event::DispatchedEvent,
ctx: &mut galaxyui::EventContext,
app: &AppContext,
) -> bool {
self.footer.dispatch_event(event, ctx, app)
+2 -2
View File
@@ -1,6 +1,6 @@
use std::ops::Range;
use string_offset::CharOffset;
use warpui::{
use galaxyui::{
AppContext, ClipBounds, Event, EventContext,
elements::{
Axis, CornerRadius, DEFAULT_SCROLL_WHEEL_PIXELS_PER_LINE, Radius, ScrollData,
@@ -121,7 +121,7 @@ impl RenderableBlock for RenderableTable {
&self.viewport_item
}
fn layout(&mut self, _: &RenderState, _: &mut warpui::LayoutContext, _: &AppContext) {}
fn layout(&mut self, _: &RenderState, _: &mut galaxyui::LayoutContext, _: &AppContext) {}
fn paint(&mut self, model: &RenderState, ctx: &mut RenderContext, _app: &AppContext) {
let content = model.content();
@@ -1,7 +1,7 @@
use pathfinder_color::ColorU;
use std::{cell::Cell, sync::Arc};
use string_offset::CharOffset;
use warpui::{
use galaxyui::{
elements::{Axis, scroll_delta_for_pointer_movement},
fonts::FamilyId,
geometry::{rect::RectF, vector::vec2f},
@@ -214,7 +214,7 @@ fn cells_in_range_entire_table() {
}
fn single_line_cell_layout(char_count: usize, line_height: f32, line_width: f32) -> CellLayout {
use warpui::text_layout::CaretPosition;
use galaxyui::text_layout::CaretPosition;
let mut carets = Vec::with_capacity(char_count);
let char_width = if char_count > 0 {
line_width / char_count as f32
@@ -5,8 +5,8 @@ use crate::{
render::model::{BlockItem, RenderState, RichTextStyles, bounds, viewport::ViewportItem},
};
use pathfinder_color::ColorU;
use warpui::elements::ListIndentLevel;
use warpui::{
use galaxyui::elements::ListIndentLevel;
use galaxyui::{
AppContext, Element, SizeConstraint, WeakViewHandle,
elements::{
Align, Border, ConstrainedBox, Container, CornerRadius, Hoverable, Icon, MouseStateHandle,
@@ -112,8 +112,8 @@ impl RenderableBlock for RenderableTaskList {
fn layout(
&mut self,
model: &RenderState,
ctx: &mut warpui::LayoutContext,
app: &warpui::AppContext,
ctx: &mut galaxyui::LayoutContext,
app: &galaxyui::AppContext,
) {
self.task_list_icon.layout(
SizeConstraint::strict(vec2f(self.icon_size, self.icon_size)),
@@ -142,7 +142,7 @@ impl RenderableBlock for RenderableTaskList {
})
}
fn paint(&mut self, model: &RenderState, ctx: &mut RenderContext, app: &warpui::AppContext) {
fn paint(&mut self, model: &RenderState, ctx: &mut RenderContext, app: &galaxyui::AppContext) {
let content = model.content();
let task_list = extract_block!(self.viewport_item, content, (block, BlockItem::TaskList{ paragraph: inner, ..}) => block.task_list(inner));
let text_styling = &model.styles().base_text;
@@ -174,8 +174,8 @@ impl RenderableBlock for RenderableTaskList {
fn dispatch_event(
&mut self,
_model: &crate::render::model::RenderState,
event: &warpui::event::DispatchedEvent,
ctx: &mut warpui::EventContext,
event: &galaxyui::event::DispatchedEvent,
ctx: &mut galaxyui::EventContext,
app: &AppContext,
) -> bool {
self.task_list_icon.dispatch_event(event, ctx, app)
@@ -1,4 +1,4 @@
use warp_core::ui::theme::Fill;
use galaxy_core::ui::theme::Fill;
use crate::render::model::{BlockItem, Decoration, RenderState, viewport::ViewportItem};
@@ -36,12 +36,12 @@ impl RenderableBlock for RenderableTemporaryBlock {
fn layout(
&mut self,
_model: &RenderState,
_ctx: &mut warpui::LayoutContext,
_app: &warpui::AppContext,
_ctx: &mut galaxyui::LayoutContext,
_app: &galaxyui::AppContext,
) {
}
fn paint(&mut self, model: &RenderState, ctx: &mut RenderContext, _app: &warpui::AppContext) {
fn paint(&mut self, model: &RenderState, ctx: &mut RenderContext, _app: &galaxyui::AppContext) {
// We cannot use `extract_block` macro here since we need to locate the viewport item by content height instead of charoffset
// (temporary block has an offset of zero).
let content = model.content();
@@ -23,12 +23,12 @@ impl RenderableBlock for RenderableTextBlock {
fn layout(
&mut self,
_model: &RenderState,
_ctx: &mut warpui::LayoutContext,
_app: &warpui::AppContext,
_ctx: &mut galaxyui::LayoutContext,
_app: &galaxyui::AppContext,
) {
}
fn paint(&mut self, model: &RenderState, ctx: &mut RenderContext, _app: &warpui::AppContext) {
fn paint(&mut self, model: &RenderState, ctx: &mut RenderContext, _app: &galaxyui::AppContext) {
let content = model.content();
let text_block = extract_block!(
self.viewport_item,
@@ -3,8 +3,8 @@ use crate::{
extract_block,
render::model::{BlockItem, RenderState, RichTextStyles, bounds, viewport::ViewportItem},
};
use warpui::elements::ListIndentLevel;
use warpui::{
use galaxyui::elements::ListIndentLevel;
use galaxyui::{
Element, SizeConstraint,
elements::{Border, CornerRadius, Radius, Rect},
geometry::vector::vec2f,
@@ -67,8 +67,8 @@ impl RenderableBlock for RenderableBulletList {
fn layout(
&mut self,
model: &RenderState,
ctx: &mut warpui::LayoutContext,
app: &warpui::AppContext,
ctx: &mut galaxyui::LayoutContext,
app: &galaxyui::AppContext,
) {
self.bullet_point.layout(
SizeConstraint::strict(vec2f(self.bullet_size, self.bullet_size)),
@@ -88,7 +88,7 @@ impl RenderableBlock for RenderableBulletList {
})
}
fn paint(&mut self, model: &RenderState, ctx: &mut RenderContext, app: &warpui::AppContext) {
fn paint(&mut self, model: &RenderState, ctx: &mut RenderContext, app: &galaxyui::AppContext) {
let content = model.content();
let unordered_list = extract_block!(self.viewport_item, content, (block, BlockItem::UnorderedList{ paragraph: inner, ..}) => block.unordered_list(inner));
+6 -6
View File
@@ -6,15 +6,15 @@ use std::ops::Range;
use std::sync::Arc;
use crate::content::text::{BufferBlockStyle, TextStylesWithMetadata};
use warpui::fonts::TextLayoutSystem;
use galaxyui::fonts::TextLayoutSystem;
#[cfg(test)]
use warpui::fonts::{Style, Weight};
use warpui::text_layout::{
use galaxyui::fonts::{Style, Weight};
use galaxyui::text_layout::{
ClipConfig, LayoutCache, Line, StyleAndFont, TextAlignment, TextBorder, TextStyle,
};
use warpui::units::{IntoPixels, Pixels};
use warpui::{AppContext, LayoutContext};
use warpui::{color::ColorU, text_layout::TextFrame};
use galaxyui::units::{IntoPixels, Pixels};
use galaxyui::{AppContext, LayoutContext};
use galaxyui::{color::ColorU, text_layout::TextFrame};
use super::model::{BlockSpacing, ParagraphStyles, RenderState, RichTextStyles};
+2 -2
View File
@@ -1,7 +1,7 @@
//! End-to-end editor tests.
use warp_core::features::FeatureFlag;
use warpui::{App, ModelHandle, ReadModel};
use galaxy_core::features::FeatureFlag;
use galaxyui::{App, ModelHandle, ReadModel};
use crate::content::{
buffer::{
+1 -1
View File
@@ -9,7 +9,7 @@
//! * The **reserved box** is the rectangle containing a block's content, padding, borders, and
//! margin - all space reserved for the block.
use warpui::{
use galaxyui::{
geometry::{
rect::RectF,
vector::{Vector2F, vec2f},
+1 -1
View File
@@ -2,7 +2,7 @@
use num_traits::SaturatingSub;
use sum_tree::SeekBias;
use warpui::units::{IntoPixels, Pixels};
use galaxyui::units::{IntoPixels, Pixels};
use string_offset::CharOffset;
@@ -16,10 +16,10 @@ use std::{cell::Cell, sync::Arc};
use string_offset::CharOffset;
use sum_tree::SumTree;
use warpui::assets::asset_cache::AssetSource;
use warpui::fonts::FamilyId;
use warpui::text_layout::{CaretPosition, TextFrame};
use warpui::units::IntoPixels;
use galaxyui::assets::asset_cache::AssetSource;
use galaxyui::fonts::FamilyId;
use galaxyui::text_layout::{CaretPosition, TextFrame};
use galaxyui::units::IntoPixels;
fn test_table_layout() -> LaidOutTable {
let source = "aaa\tbbb\nccc\tddd\n";
+6 -6
View File
@@ -21,11 +21,11 @@ use serde_yaml::Mapping;
use sum_tree::{SeekBias, SumTree};
use vec1::Vec1;
use vim::vim::{MotionType, VimMode};
use warp_core::{
use galaxy_core::{
channel::ChannelState,
ui::{Icon, theme::Fill as ThemeFill},
};
use warpui::{
use galaxyui::{
AppContext, Entity, EntityId, ModelContext, ModelHandle,
assets::asset_cache::AssetSource,
color::ColorU,
@@ -69,7 +69,7 @@ use crate::{
render::model::debug::Describe,
};
use string_offset::{CharOffset, impl_offset};
use warpui::elements::ListIndentLevel;
use galaxyui::elements::ListIndentLevel;
use super::{
BLOCK_FOOTER_HEIGHT,
@@ -664,7 +664,7 @@ impl LineCount {
}
/// A character offset within a [`TextFrame`]. These offsets count characters in the Rust string
/// passed to [`warpui::text_layout::LayoutCache::layout_text()`].
/// passed to [`galaxyui::text_layout::LayoutCache::layout_text()`].
///
/// Frame offsets often, but not always, correspond to glyph indices and caret positions. However,
/// they do not line up 1:1 if a glyph or grapheme contains multiple characters
@@ -4305,7 +4305,7 @@ impl<'a> Positioned<'a, Paragraph> {
vec2f(underline_width, UNDERLINE_THICKNESS),
);
let dash = warpui::scene::Dash {
let dash = galaxyui::scene::Dash {
dash_length: DASHED_UNDERLINE_DASH_LENGTH,
gap_length: DASHED_UNDERLINE_GAP_LENGTH,
force_consistent_gap_length: true,
@@ -4314,7 +4314,7 @@ impl<'a> Positioned<'a, Paragraph> {
.scene
.draw_rect_without_hit_recording(underline_rect)
.with_border(
warpui::scene::Border::bottom(UNDERLINE_THICKNESS)
galaxyui::scene::Border::bottom(UNDERLINE_THICKNESS)
.with_dashed_border(dash)
.with_border_color(color),
);
+8 -8
View File
@@ -2,8 +2,8 @@ use rangemap::RangeSet;
use std::{cell::Cell, sync::Arc};
use sum_tree::SumTree;
use vec1::{Vec1, vec1};
use warpui::assets::asset_cache::AssetSource;
use warpui::{
use galaxyui::assets::asset_cache::AssetSource;
use galaxyui::{
color::ColorU,
fonts::FamilyId,
geometry::{rect::RectF, vector::vec2f},
@@ -34,7 +34,7 @@ use crate::{
};
use markdown_parser::{FormattedTextStyles, Hyperlink};
use string_offset::CharOffset;
use warpui::elements::ListIndentLevel;
use galaxyui::elements::ListIndentLevel;
#[test]
fn test_height() {
@@ -930,7 +930,7 @@ fn test_multiselect_autoscroll_bounding_box() {
);
}
// 18:09:15 [INFO] [warp_editor::render::model] Initial tree:
// 18:09:15 [INFO] [galaxy_editor::render::model] Initial tree:
// -------- 0.00px / 0 characters --------
// Hidden (3067 characters, 87 lines, 20.00px tall)
// -------- 20.00px / 3067 characters --------
@@ -1033,7 +1033,7 @@ fn test_dedupe_hidden_ranges_logged_tree_is_unchanged() {
assert_eq!(initial, resulting);
}
// 18:09:14 [INFO] [warp_editor::render::model] Initial tree:
// 18:09:14 [INFO] [galaxy_editor::render::model] Initial tree:
// -------- 0.00px / 0 characters --------
// Hidden (3066 characters, 87 lines, 20.00px tall)
// -------- 20.00px / 3067 characters --------
@@ -1158,17 +1158,17 @@ fn make_test_cell_layout() -> CellLayout {
line_char_ranges: vec![CharOffset::from(0)..CharOffset::from(3)],
line_widths: vec![30.0],
line_caret_positions: vec![vec![
warpui::text_layout::CaretPosition {
galaxyui::text_layout::CaretPosition {
position_in_line: 0.0,
start_offset: 0,
last_offset: 0,
},
warpui::text_layout::CaretPosition {
galaxyui::text_layout::CaretPosition {
position_in_line: 10.0,
start_offset: 1,
last_offset: 1,
},
warpui::text_layout::CaretPosition {
galaxyui::text_layout::CaretPosition {
position_in_line: 20.0,
start_offset: 2,
last_offset: 2,
+1 -1
View File
@@ -19,7 +19,7 @@ mod tests;
/// certain character runs are interactive. Within those runs, there's a 1:1 mapping between
/// `char`s in the content model and `char`s in the text frame. It translates in two directions:
/// * From a [`CharOffset`] relative to the start of the content model block (a [`super::Paragraph`])
/// to the character index in the [`warpui::text_layout::TextFrame`].
/// to the character index in the [`galaxyui::text_layout::TextFrame`].
/// * From a [`FrameOffset`] in the `TextFrame` to the closest `CharOffset` in the content model
/// block (for example, clicking within a placeholder should snap the cursor to a regular content
/// character).
@@ -76,7 +76,7 @@ fn test_offset_map_placeholders() {
fn test_end_to_end() {
// Group imports here so they don't cause "unused import" warnings on other targets.
use warpui::{
use galaxyui::{
App, color::ColorU, elements::Fill, fonts::Cache as FontCache, text_layout::LayoutCache,
};
@@ -97,7 +97,7 @@ fn test_end_to_end() {
};
App::test((), |mut app| async move {
let mut font_cache = FontCache::new(Box::new(warpui::platform::current::FontDB::new()));
let mut font_cache = FontCache::new(Box::new(galaxyui::platform::current::FontDB::new()));
let layout_cache = LayoutCache::new();
let paragraph_styles = ParagraphStyles {
font_family: font_cache
+1 -1
View File
@@ -4,7 +4,7 @@
use std::sync::Arc;
use sum_tree::{Cursor, Dimension};
use warpui::{
use galaxyui::{
geometry::vector::Vector2F,
text_layout::Line,
units::{IntoPixels, Pixels},
@@ -1,4 +1,4 @@
use warpui::EntityId;
use galaxyui::EntityId;
/// Utility for consistently creating and referencing saved position IDs for
/// rich text.
@@ -17,16 +17,16 @@ impl SavedPositions {
/// Saved position ID for the cursor location.
pub fn cursor_id(&self) -> String {
format!("warp_editor:cursor_{}", self.model_id)
format!("galaxy_editor:cursor_{}", self.model_id)
}
/// The bounding box for the text selection.
pub fn text_selection_id(&self) -> String {
format!("warp_editor:text_selection_{}", self.model_id)
format!("galaxy_editor:text_selection_{}", self.model_id)
}
/// The first line of the block that the mouse is currently hovered over.
pub fn hovered_block_start(&self) -> String {
format!("warp_editor:hovered_block_start_{}", self.model_id)
format!("galaxy_editor:hovered_block_start_{}", self.model_id)
}
}
+5 -5
View File
@@ -6,8 +6,8 @@ use vec1::{Vec1, vec1};
use crate::content::text::BufferBlockStyle;
use ordered_float::OrderedFloat;
use warpui::elements::ListIndentLevel;
use warpui::{
use galaxyui::elements::ListIndentLevel;
use galaxyui::{
color::ColorU,
elements::{Border, Fill},
fonts::{FamilyId, Weight},
@@ -241,7 +241,7 @@ pub fn layout(text: &str, styles: &RichTextStyles, max_width: impl IntoPixels) -
width: line_width.as_f32(),
trailing_whitespace_width: 0.,
runs: vec![Run {
font_id: warpui::fonts::FontId(0),
font_id: galaxyui::fonts::FontId(0),
styles: Default::default(),
glyphs: mem::take(&mut glyphs_acc),
width: line_width.as_f32(),
@@ -280,7 +280,7 @@ pub fn layout(text: &str, styles: &RichTextStyles, max_width: impl IntoPixels) -
width: line_width.as_f32(),
trailing_whitespace_width: 0.,
runs: vec![Run {
font_id: warpui::fonts::FontId(0),
font_id: galaxyui::fonts::FontId(0),
styles: Default::default(),
glyphs: glyphs_acc,
width: line_width.as_f32(),
@@ -316,7 +316,7 @@ pub fn init_logging() {
static INIT: Once = Once::new();
INIT.call_once(|| {
env_logger::builder()
.parse_filters("warp_editor=trace")
.parse_filters("galaxy_editor=trace")
.is_test(true)
.init();
});
+1 -1
View File
@@ -1,6 +1,6 @@
use float_cmp::ApproxEq;
use sum_tree::{SeekBias, SumTree};
use warpui::{
use galaxyui::{
SizeConstraint,
geometry::{
rect::RectF,
@@ -1,7 +1,7 @@
use itertools::Itertools;
use sum_tree::SumTree;
use warpui::{
use galaxyui::{
SizeConstraint,
geometry::vector::vec2f,
units::{IntoPixels, Pixels},