@@ -6,6 +6,7 @@ use crate::{
7use helix_view::graphics::{Rect, Style};
7use helix_view::graphics::{Rect, Style};
9+/// Border render type. Defaults to [`BorderType::Plain`].
9#[derive(Debug, Clone, Copy, PartialEq)]
10#[derive(Debug, Clone, Copy, PartialEq)]
10pub enum BorderType {
11pub enum BorderType {
@@ -25,6 +26,12 @@ impl BorderType {
29+impl Default for BorderType {
30+ fn default() -> BorderType {
28/// Base widget to be used with all upper level ones. It may be used to display a box border around
35/// Base widget to be used with all upper level ones. It may be used to display a box border around
29/// the widget and/or add a title.
36/// the widget and/or add a title.
@@ -40,7 +47,7 @@ impl BorderType {
40/// .border_type(BorderType::Rounded)
47/// .border_type(BorderType::Rounded)
41/// .style(Style::default().bg(Color::Black));
48/// .style(Style::default().bg(Color::Black));
43−#[derive(Debug, Clone, PartialEq)]
50+#[derive(Debug, Default, Clone, PartialEq)]
44pub struct Block<'a> {
51pub struct Block<'a> {
45 /// Optional title place on the upper left of the block
52 /// Optional title place on the upper left of the block
46 title: Option<Spans<'a>>,
53 title: Option<Spans<'a>>,
@@ -55,18 +62,6 @@ pub struct Block<'a> {
55 style: Style,
62 style: Style,
58−impl<'a> Default for Block<'a> {
59− fn default() -> Block<'a> {
62− borders: Borders::NONE,
63− border_style: Default::default(),
64− border_type: BorderType::Plain,
65− style: Default::default(),
70impl<'a> Block<'a> {
65impl<'a> Block<'a> {
71 pub fn title<T>(mut self, title: T) -> Block<'a>
66 pub fn title<T>(mut self, title: T) -> Block<'a>