Skip to content

Commit 5324382

Browse files
committed
Title alignment
1 parent 2cf1aa0 commit 5324382

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

src/helper.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
use rand::{seq::SliceRandom, Rng};
22
use ratatui::{
3-
layout::Alignment,
4-
widgets::block::{Position, Title},
3+
widgets::block::Title,
54
style::Color
65
};
76

87
pub struct Generator;
98

109
pub fn get_title(version: &String, layout_name: &str, window_name: &str) -> Title<'static> {
1110
Title::from(format!(" tukai v{} 》{} 》{} ", version, layout_name, window_name))
12-
.position(Position::Top)
13-
.alignment(Alignment::Left)
1411
}
1512

1613
impl Generator {

src/windows/stats_window.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use crate::{
66
};
77

88
use ratatui::{
9-
crossterm::event::KeyEvent, layout::{Alignment, Constraint, Direction, Layout, Rect}, style::{Style, Stylize}, symbols, widgets::{Axis, Block, BorderType, Borders, Cell, Chart, Dataset, GraphType, Padding, Row, Table, TableState}, Frame
9+
crossterm::event::KeyEvent, layout::{Alignment, Constraint, Direction, Layout, Rect}, style::{Style, Stylize}, symbols, widgets::{Axis, Block, BorderType, Borders, Cell, Chart, Dataset, GraphType, Padding, Row, Table}, Frame
1010
};
1111

1212
use crate::layout::Layout as TukaiLayout;

src/windows/typing_window.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ impl Window for TypingWindow {
159159

160160
let block = Block::new()
161161
.title(block_title)
162+
.title_alignment(Alignment::Left)
162163
.title_bottom(self.motto.as_ref())
163164
.title_style(Style::default().fg(layout.get_primary_color()))
164165
.title_alignment(Alignment::Center)

0 commit comments

Comments
 (0)