Rename constants module to util

This commit is contained in:
Joscha 2022-06-14 10:48:18 +02:00
parent b918f0f31f
commit 1dbc95bb81
3 changed files with 5 additions and 5 deletions

View file

@ -1,18 +1,18 @@
mod blocks;
mod constants;
mod layout;
mod util;
use std::marker::PhantomData;
use chrono::{DateTime, Utc};
use crossterm::event::{KeyCode, KeyEvent};
use crossterm::style::{ContentStyle, Stylize};
use crossterm::style::ContentStyle;
use toss::frame::{Frame, Pos, Size};
use crate::store::{Msg, MsgStore};
use self::blocks::{BlockBody, Blocks};
use self::constants::{
use self::util::{
after_indent, style_indent, style_indent_inverted, style_placeholder, style_time,
style_time_inverted, INDENT, INDENT_WIDTH, PLACEHOLDER, TIME_EMPTY, TIME_FORMAT, TIME_WIDTH,
};

View file

@ -4,7 +4,7 @@ use crate::chat::Cursor;
use crate::store::{Msg, MsgStore, Tree};
use super::blocks::{Block, Blocks};
use super::constants::{self, MIN_CONTENT_WIDTH};
use super::util::{self, MIN_CONTENT_WIDTH};
use super::TreeView;
impl<M: Msg> TreeView<M> {
@ -18,7 +18,7 @@ impl<M: Msg> TreeView<M> {
let nick = msg.nick();
let content = msg.content();
let content_width = size.width as i32 - constants::after_nick(frame, indent, &nick);
let content_width = size.width as i32 - util::after_nick(frame, indent, &nick);
if content_width < MIN_CONTENT_WIDTH as i32 {
Block::placeholder(msg.id(), indent).time(msg.time())
} else {