aboutsummaryrefslogtreecommitdiff
path: root/helix-tui/src/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'helix-tui/src/widgets')
-rw-r--r--helix-tui/src/widgets/block.rs6
-rw-r--r--helix-tui/src/widgets/mod.rs4
-rw-r--r--helix-tui/src/widgets/paragraph.rs6
-rw-r--r--helix-tui/src/widgets/table.rs10
4 files changed, 13 insertions, 13 deletions
diff --git a/helix-tui/src/widgets/block.rs b/helix-tui/src/widgets/block.rs
index 2569c17d..648c2d7e 100644
--- a/helix-tui/src/widgets/block.rs
+++ b/helix-tui/src/widgets/block.rs
@@ -1,11 +1,10 @@
use crate::{
buffer::Buffer,
- layout::Rect,
- style::Style,
symbols::line,
text::{Span, Spans},
widgets::{Borders, Widget},
};
+use helix_view::graphics::{Rect, Style};
#[derive(Debug, Clone, Copy, PartialEq)]
pub enum BorderType {
@@ -33,7 +32,7 @@ impl BorderType {
///
/// ```
/// # use helix_tui::widgets::{Block, BorderType, Borders};
-/// # use helix_tui::style::{Style, Color};
+/// # use helix_view::graphics::{Style, Color};
/// Block::default()
/// .title("Block")
/// .borders(Borders::LEFT | Borders::RIGHT)
@@ -212,7 +211,6 @@ impl<'a> Widget for Block<'a> {
#[cfg(test)]
mod tests {
use super::*;
- use crate::layout::Rect;
#[test]
fn inner_takes_into_account_the_borders() {
diff --git a/helix-tui/src/widgets/mod.rs b/helix-tui/src/widgets/mod.rs
index 484ad50e..e5608a79 100644
--- a/helix-tui/src/widgets/mod.rs
+++ b/helix-tui/src/widgets/mod.rs
@@ -20,9 +20,11 @@ pub use self::block::{Block, BorderType};
pub use self::paragraph::{Paragraph, Wrap};
pub use self::table::{Cell, Row, Table, TableState};
-use crate::{buffer::Buffer, layout::Rect};
+use crate::buffer::Buffer;
use bitflags::bitflags;
+use helix_view::graphics::Rect;
+
bitflags! {
/// Bitflags that can be composed to set the visible borders essentially on the block widget.
pub struct Borders: u32 {
diff --git a/helix-tui/src/widgets/paragraph.rs b/helix-tui/src/widgets/paragraph.rs
index ecce8581..bdfb5b9a 100644
--- a/helix-tui/src/widgets/paragraph.rs
+++ b/helix-tui/src/widgets/paragraph.rs
@@ -1,13 +1,13 @@
use crate::{
buffer::Buffer,
- layout::{Alignment, Rect},
- style::Style,
+ layout::Alignment,
text::{StyledGrapheme, Text},
widgets::{
reflow::{LineComposer, LineTruncator, WordWrapper},
Block, Widget,
},
};
+use helix_view::graphics::{Rect, Style};
use std::iter;
use unicode_width::UnicodeWidthStr;
@@ -26,8 +26,8 @@ fn get_line_offset(line_width: u16, text_area_width: u16, alignment: Alignment)
/// ```
/// # use helix_tui::text::{Text, Spans, Span};
/// # use helix_tui::widgets::{Block, Borders, Paragraph, Wrap};
-/// # use helix_tui::style::{Style, Color, Modifier};
/// # use helix_tui::layout::{Alignment};
+/// # use helix_view::graphics::{Style, Color, Modifier};
/// let text = vec![
/// Spans::from(vec![
/// Span::raw("First"),
diff --git a/helix-tui/src/widgets/table.rs b/helix-tui/src/widgets/table.rs
index d42d7d30..44f6c58f 100644
--- a/helix-tui/src/widgets/table.rs
+++ b/helix-tui/src/widgets/table.rs
@@ -1,7 +1,6 @@
use crate::{
buffer::Buffer,
- layout::{Constraint, Rect},
- style::Style,
+ layout::Constraint,
text::Text,
widgets::{Block, Widget},
};
@@ -10,6 +9,7 @@ use cassowary::{
WeightedRelation::*,
{Expression, Solver},
};
+use helix_view::graphics::{Rect, Style};
use std::{
collections::HashMap,
iter::{self, Iterator},
@@ -21,8 +21,8 @@ use unicode_width::UnicodeWidthStr;
/// It can be created from anything that can be converted to a [`Text`].
/// ```rust
/// # use helix_tui::widgets::Cell;
-/// # use helix_tui::style::{Style, Modifier};
/// # use helix_tui::text::{Span, Spans, Text};
+/// # use helix_view::graphics::{Style, Modifier};
/// Cell::from("simple string");
///
/// Cell::from(Span::from("span"));
@@ -74,7 +74,7 @@ where
/// But if you need a bit more control over individual cells, you can explicity create [`Cell`]s:
/// ```rust
/// # use helix_tui::widgets::{Row, Cell};
-/// # use helix_tui::style::{Style, Color};
+/// # use helix_view::graphics::{Style, Color};
/// Row::new(vec![
/// Cell::from("Cell1"),
/// Cell::from("Cell2").style(Style::default().fg(Color::Yellow)),
@@ -137,7 +137,7 @@ impl<'a> Row<'a> {
/// ```rust
/// # use helix_tui::widgets::{Block, Borders, Table, Row, Cell};
/// # use helix_tui::layout::Constraint;
-/// # use helix_tui::style::{Style, Color, Modifier};
+/// # use helix_view::graphics::{Style, Color, Modifier};
/// # use helix_tui::text::{Text, Spans, Span};
/// Table::new(vec![
/// // Row can be created from simple strings.