Wrapping up bedrock implementation
This commit is contained in:
@@ -154,7 +154,9 @@ impl RenderableBlock for RenderableBrokenEmbedding {
|
||||
);
|
||||
}
|
||||
|
||||
ctx.paint.scene.start_layer(galaxyui::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();
|
||||
|
||||
@@ -1,16 +1,4 @@
|
||||
use float_cmp::ApproxEq;
|
||||
use instant::Instant;
|
||||
use parking_lot::Mutex;
|
||||
use std::{
|
||||
fmt,
|
||||
sync::{
|
||||
Arc,
|
||||
atomic::{AtomicBool, Ordering},
|
||||
},
|
||||
time::Duration,
|
||||
};
|
||||
use temporary_block::RenderableTemporaryBlock;
|
||||
use vim::vim::VimMode;
|
||||
use galaxy_core::ui::theme::Fill as ThemeFill;
|
||||
use galaxyui::{
|
||||
AfterLayoutContext, AppContext, Element, Event, EventContext, LayoutContext, ModelHandle,
|
||||
@@ -28,6 +16,18 @@ use galaxyui::{
|
||||
platform::Cursor,
|
||||
units::{IntoPixels, Pixels},
|
||||
};
|
||||
use instant::Instant;
|
||||
use parking_lot::Mutex;
|
||||
use std::{
|
||||
fmt,
|
||||
sync::{
|
||||
Arc,
|
||||
atomic::{AtomicBool, Ordering},
|
||||
},
|
||||
time::Duration,
|
||||
};
|
||||
use temporary_block::RenderableTemporaryBlock;
|
||||
use vim::vim::VimMode;
|
||||
|
||||
use super::model::{
|
||||
BlockItem, ElementUpdate, HitTestOptions, Location, RenderState, RichTextStyles, UNIT_MARGIN,
|
||||
|
||||
@@ -48,7 +48,12 @@ impl RenderableBlock for RenderableRunnableCommand {
|
||||
&self.viewport_item
|
||||
}
|
||||
|
||||
fn layout(&mut self, _model: &RenderState, ctx: &mut galaxyui::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 +92,9 @@ 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(galaxyui::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.
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
use std::ops::Range;
|
||||
use string_offset::CharOffset;
|
||||
use galaxyui::{
|
||||
AppContext, ClipBounds, Event, EventContext,
|
||||
elements::{
|
||||
@@ -14,6 +12,8 @@ use galaxyui::{
|
||||
},
|
||||
units::{IntoPixels, Pixels},
|
||||
};
|
||||
use std::ops::Range;
|
||||
use string_offset::CharOffset;
|
||||
|
||||
use crate::render::model::table_offset_map::CellAtOffset;
|
||||
use crate::{
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
use pathfinder_color::ColorU;
|
||||
use std::{cell::Cell, sync::Arc};
|
||||
use string_offset::CharOffset;
|
||||
use galaxyui::{
|
||||
elements::{Axis, scroll_delta_for_pointer_movement},
|
||||
fonts::FamilyId,
|
||||
@@ -8,6 +5,9 @@ use galaxyui::{
|
||||
text_layout::TextFrame,
|
||||
units::{IntoPixels, Pixels},
|
||||
};
|
||||
use pathfinder_color::ColorU;
|
||||
use std::{cell::Cell, sync::Arc};
|
||||
use string_offset::CharOffset;
|
||||
|
||||
use crate::{
|
||||
content::text::{FormattedTable, table_cell_offset_maps},
|
||||
|
||||
@@ -4,7 +4,6 @@ use crate::{
|
||||
extract_block,
|
||||
render::model::{BlockItem, RenderState, RichTextStyles, bounds, viewport::ViewportItem},
|
||||
};
|
||||
use pathfinder_color::ColorU;
|
||||
use galaxyui::elements::ListIndentLevel;
|
||||
use galaxyui::{
|
||||
AppContext, Element, SizeConstraint, WeakViewHandle,
|
||||
@@ -15,6 +14,7 @@ use galaxyui::{
|
||||
geometry::vector::vec2f,
|
||||
platform::Cursor,
|
||||
};
|
||||
use pathfinder_color::ColorU;
|
||||
|
||||
use super::{
|
||||
RenderableBlock, RichTextAction,
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
//! Hit-testing implementation for the rendering model.
|
||||
|
||||
use galaxyui::units::{IntoPixels, Pixels};
|
||||
use num_traits::SaturatingSub;
|
||||
use sum_tree::SeekBias;
|
||||
use galaxyui::units::{IntoPixels, Pixels};
|
||||
|
||||
use string_offset::CharOffset;
|
||||
|
||||
|
||||
@@ -15,11 +15,11 @@ use pathfinder_color::ColorU;
|
||||
use std::{cell::Cell, sync::Arc};
|
||||
use string_offset::CharOffset;
|
||||
|
||||
use sum_tree::SumTree;
|
||||
use galaxyui::assets::asset_cache::AssetSource;
|
||||
use galaxyui::fonts::FamilyId;
|
||||
use galaxyui::text_layout::{CaretPosition, TextFrame};
|
||||
use galaxyui::units::IntoPixels;
|
||||
use sum_tree::SumTree;
|
||||
|
||||
fn test_table_layout() -> LaidOutTable {
|
||||
let source = "aaa\tbbb\nccc\tddd\n";
|
||||
|
||||
@@ -12,15 +12,6 @@ use parking_lot::Mutex;
|
||||
use rangemap::RangeSet;
|
||||
|
||||
use float_cmp::ApproxEq;
|
||||
use itertools::Itertools;
|
||||
use markdown_parser::TableAlignment;
|
||||
use num_traits::SaturatingSub;
|
||||
use ordered_float::OrderedFloat;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use serde_yaml::Mapping;
|
||||
use sum_tree::{SeekBias, SumTree};
|
||||
use vec1::Vec1;
|
||||
use vim::vim::{MotionType, VimMode};
|
||||
use galaxy_core::{
|
||||
channel::ChannelState,
|
||||
ui::{Icon, theme::Fill as ThemeFill},
|
||||
@@ -44,6 +35,15 @@ use galaxyui::{
|
||||
},
|
||||
units::{IntoPixels, Pixels},
|
||||
};
|
||||
use itertools::Itertools;
|
||||
use markdown_parser::TableAlignment;
|
||||
use num_traits::SaturatingSub;
|
||||
use ordered_float::OrderedFloat;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use serde_yaml::Mapping;
|
||||
use sum_tree::{SeekBias, SumTree};
|
||||
use vec1::Vec1;
|
||||
use vim::vim::{MotionType, VimMode};
|
||||
|
||||
pub use self::location::{HitTestOptions, Location};
|
||||
pub use self::offset_map::{OffsetMap, SelectableTextRun};
|
||||
@@ -68,8 +68,8 @@ use crate::{
|
||||
editor::EmbeddedItemModel,
|
||||
render::model::debug::Describe,
|
||||
};
|
||||
use string_offset::{CharOffset, impl_offset};
|
||||
use galaxyui::elements::ListIndentLevel;
|
||||
use string_offset::{CharOffset, impl_offset};
|
||||
|
||||
use super::{
|
||||
BLOCK_FOOTER_HEIGHT,
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
use rangemap::RangeSet;
|
||||
use std::{cell::Cell, sync::Arc};
|
||||
use sum_tree::SumTree;
|
||||
use vec1::{Vec1, vec1};
|
||||
use galaxyui::assets::asset_cache::AssetSource;
|
||||
use galaxyui::{
|
||||
color::ColorU,
|
||||
@@ -10,6 +6,10 @@ use galaxyui::{
|
||||
text_layout::TextFrame,
|
||||
units::{IntoPixels, Pixels},
|
||||
};
|
||||
use rangemap::RangeSet;
|
||||
use std::{cell::Cell, sync::Arc};
|
||||
use sum_tree::SumTree;
|
||||
use vec1::{Vec1, vec1};
|
||||
|
||||
use super::{
|
||||
BlockItem, BlockLocation, COMMAND_SPACING, CellLayout, DEFAULT_BLOCK_SPACINGS,
|
||||
@@ -32,9 +32,9 @@ use crate::{
|
||||
test_utils::{TEST_STYLES, laid_out_paragraph, mock_paragraph},
|
||||
},
|
||||
};
|
||||
use galaxyui::elements::ListIndentLevel;
|
||||
use markdown_parser::{FormattedTextStyles, Hyperlink};
|
||||
use string_offset::CharOffset;
|
||||
use galaxyui::elements::ListIndentLevel;
|
||||
|
||||
#[test]
|
||||
fn test_height() {
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
|
||||
use std::sync::Arc;
|
||||
|
||||
use sum_tree::{Cursor, Dimension};
|
||||
use galaxyui::{
|
||||
geometry::vector::Vector2F,
|
||||
text_layout::Line,
|
||||
units::{IntoPixels, Pixels},
|
||||
};
|
||||
use sum_tree::{Cursor, Dimension};
|
||||
|
||||
use crate::render::layout::line_height;
|
||||
use string_offset::CharOffset;
|
||||
|
||||
@@ -5,7 +5,6 @@ use std::{mem, sync::Arc};
|
||||
use vec1::{Vec1, vec1};
|
||||
|
||||
use crate::content::text::BufferBlockStyle;
|
||||
use ordered_float::OrderedFloat;
|
||||
use galaxyui::elements::ListIndentLevel;
|
||||
use galaxyui::{
|
||||
color::ColorU,
|
||||
@@ -15,6 +14,7 @@ use galaxyui::{
|
||||
text_layout::{CaretPosition, Glyph, Line, Run, TextFrame},
|
||||
units::{IntoPixels, Pixels},
|
||||
};
|
||||
use ordered_float::OrderedFloat;
|
||||
|
||||
use super::{
|
||||
BlockItem, BrokenLinkStyle, CheckBoxStyle, DEFAULT_BLOCK_SPACINGS, HorizontalRuleStyle,
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
use float_cmp::ApproxEq;
|
||||
use sum_tree::{SeekBias, SumTree};
|
||||
use galaxyui::{
|
||||
SizeConstraint,
|
||||
geometry::{
|
||||
@@ -8,6 +7,7 @@ use galaxyui::{
|
||||
},
|
||||
units::{IntoPixels, Pixels},
|
||||
};
|
||||
use sum_tree::{SeekBias, SumTree};
|
||||
|
||||
use crate::render::element::RenderContext;
|
||||
use string_offset::CharOffset;
|
||||
|
||||
Reference in New Issue
Block a user