aboutsummaryrefslogtreecommitdiff
path: root/helix-tui/src/widgets/mod.rs
diff options
context:
space:
mode:
authorIvan Tham2022-05-14 14:28:37 +0000
committerBlaž Hrastnik2022-05-22 01:26:32 +0000
commit1837b5e4a61f0230b3cd382ed487fa09be7b2b68 (patch)
tree1025a430cffa521be6f24cab7472769d94584e48 /helix-tui/src/widgets/mod.rs
parentbfc4ff4dcfd9135924d90bb822f2e23ae9cb2420 (diff)
Refactor Block with Default and bitflags
Specifying empty for bitflags is not recommended, it is now removed and added Default. For BorderType, it now defaults to plain.
Diffstat (limited to 'helix-tui/src/widgets/mod.rs')
-rw-r--r--helix-tui/src/widgets/mod.rs11
1 files changed, 5 insertions, 6 deletions
diff --git a/helix-tui/src/widgets/mod.rs b/helix-tui/src/widgets/mod.rs
index e5608a79..c0c3a994 100644
--- a/helix-tui/src/widgets/mod.rs
+++ b/helix-tui/src/widgets/mod.rs
@@ -27,17 +27,16 @@ use helix_view::graphics::Rect;
bitflags! {
/// Bitflags that can be composed to set the visible borders essentially on the block widget.
+ #[derive(Default)]
pub struct Borders: u32 {
- /// Show no border (default)
- const NONE = 0b0000_0001;
/// Show the top border
- const TOP = 0b0000_0010;
+ const TOP = 0b0000_0001;
/// Show the right border
- const RIGHT = 0b0000_0100;
+ const RIGHT = 0b0000_0010;
/// Show the bottom border
- const BOTTOM = 0b000_1000;
+ const BOTTOM = 0b000_0100;
/// Show the left border
- const LEFT = 0b0001_0000;
+ const LEFT = 0b0000_1000;
/// Show all borders
const ALL = Self::TOP.bits | Self::RIGHT.bits | Self::BOTTOM.bits | Self::LEFT.bits;
}