-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add position, inset, and gap style props
- Loading branch information
Showing
12 changed files
with
293 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
use iocraft::prelude::*; | ||
|
||
const LOREM_IPSUM: &str = "Lorem ipsum odor amet, consectetuer adipiscing elit. \ | ||
Lobortis hendrerit nec ipsum dapibus quam. Donec malesuada tincidunt elementum \ | ||
mollis vehicula quisque purus. Est volutpat integer, donec sagittis placerat \ | ||
fermentum phasellus ipsum sollicitudin. Tempus laoreet ad tempus aptent proin \ | ||
per donec lectus. Quisque auctor urna; phasellus urna tortor ligula. Class \ | ||
pharetra bibendum tristique, quisque consectetur placerat potenti. Imperdiet ut \ | ||
torquent vestibulum eleifend bibendum et. Dictumst vulputate interdum iaculis \ | ||
at conubia venenatis."; | ||
|
||
fn main() { | ||
element! { | ||
Box( | ||
border_style: BorderStyle::DoubleLeftRight, | ||
border_color: Color::Green, | ||
margin: 1, | ||
width: 78, | ||
flex_direction: FlexDirection::Column, | ||
) { | ||
Box(margin_top: -1) { | ||
Text(content: " Overlap Example ", wrap: TextWrap::NoWrap) | ||
} | ||
Box(padding: 1) { | ||
Text(content: format!("{} {}", LOREM_IPSUM, LOREM_IPSUM), color: Color::DarkGrey, weight: Weight::Light) | ||
} | ||
Box( | ||
border_color: Color::Red, | ||
border_style: BorderStyle::DoubleTopBottom, | ||
padding: 1, | ||
position: Position::Absolute, | ||
top: 2, | ||
left: 4, | ||
) { | ||
Text(content: "This element is overlapping the text!") | ||
} | ||
Box( | ||
background_color: Color::Reset, | ||
border_color: Color::Red, | ||
border_style: BorderStyle::DoubleTopBottom, | ||
padding: 1, | ||
position: Position::Absolute, | ||
top: 8, | ||
left: 4, | ||
) { | ||
Text(content: "We can cover it up by setting a background color.") | ||
} | ||
} | ||
} | ||
.print(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.