Skip to content

Commit

Permalink
Export Link type
Browse files Browse the repository at this point in the history
This type is part of public API and is linked in some doc comments
so it makes sense that the type be accessible.
  • Loading branch information
cmyr committed Mar 17, 2021
1 parent 31c3974 commit 3e763f4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
6 changes: 4 additions & 2 deletions druid/src/text/attribute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ use crate::{Command, Env, FontDescriptor, KeyOrValue};
/// A clickable range of text with an associated [`Command`].
#[derive(Debug, Clone)]
pub struct Link {
pub(crate) range: Range<usize>,
pub(crate) command: Command,
/// The range of text for the link.
pub range: Range<usize>,
/// A [`Command`] representing the link's payload.
pub command: Command,
}

/// A collection of spans of attributes of various kinds.
Expand Down
3 changes: 1 addition & 2 deletions druid/src/text/layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
use std::ops::Range;
use std::rc::Rc;

use super::attribute::Link;
use super::TextStorage;
use super::{Link, TextStorage};
use crate::kurbo::{Line, Point, Rect, Size};
use crate::piet::{
Color, PietText, PietTextLayout, Text as _, TextAlignment, TextAttribute, TextLayout as _,
Expand Down
2 changes: 1 addition & 1 deletion druid/src/text/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ mod rich_text;
pub mod selection;
mod storage;

pub use self::attribute::{Attribute, AttributeSpans};
pub use self::attribute::{Attribute, AttributeSpans, Link};
pub use self::backspace::offset_for_delete_backwards;
pub use self::editable_text::{EditableText, EditableTextCursor, StringCursor};
pub use self::font_descriptor::FontDescriptor;
Expand Down

0 comments on commit 3e763f4

Please sign in to comment.