Move chat to ui module
This commit is contained in:
parent
603876738f
commit
446e3e885a
11 changed files with 7 additions and 12 deletions
|
|
@ -2,7 +2,6 @@
|
||||||
|
|
||||||
// TODO Clean up use and manipulation of toss Pos and Size
|
// TODO Clean up use and manipulation of toss Pos and Size
|
||||||
|
|
||||||
mod chat;
|
|
||||||
mod euph;
|
mod euph;
|
||||||
mod logger;
|
mod logger;
|
||||||
mod replies;
|
mod replies;
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
mod chat;
|
||||||
mod room;
|
mod room;
|
||||||
mod rooms;
|
mod rooms;
|
||||||
mod util;
|
mod util;
|
||||||
|
|
@ -14,10 +15,10 @@ use tokio::task;
|
||||||
use toss::frame::{Frame, Pos, Size};
|
use toss::frame::{Frame, Pos, Size};
|
||||||
use toss::terminal::Terminal;
|
use toss::terminal::Terminal;
|
||||||
|
|
||||||
use crate::chat::Chat;
|
|
||||||
use crate::logger::{LogMsg, Logger};
|
use crate::logger::{LogMsg, Logger};
|
||||||
use crate::vault::Vault;
|
use crate::vault::Vault;
|
||||||
|
|
||||||
|
use self::chat::Chat;
|
||||||
use self::rooms::Rooms;
|
use self::rooms::Rooms;
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
|
|
|
||||||
|
|
@ -3,10 +3,9 @@ use std::sync::Arc;
|
||||||
use parking_lot::FairMutex;
|
use parking_lot::FairMutex;
|
||||||
use toss::terminal::Terminal;
|
use toss::terminal::Terminal;
|
||||||
|
|
||||||
use crate::chat::Cursor;
|
|
||||||
use crate::store::{Msg, MsgStore};
|
use crate::store::{Msg, MsgStore};
|
||||||
|
|
||||||
use super::TreeView;
|
use super::{Cursor, TreeView};
|
||||||
|
|
||||||
impl<M: Msg> TreeView<M> {
|
impl<M: Msg> TreeView<M> {
|
||||||
fn prompt_msg(crossterm_lock: &Arc<FairMutex<()>>, terminal: &mut Terminal) -> Option<String> {
|
fn prompt_msg(crossterm_lock: &Arc<FairMutex<()>>, terminal: &mut Terminal) -> Option<String> {
|
||||||
|
|
@ -5,9 +5,7 @@ use std::collections::VecDeque;
|
||||||
use chrono::{DateTime, Utc};
|
use chrono::{DateTime, Utc};
|
||||||
use toss::styled::Styled;
|
use toss::styled::Styled;
|
||||||
|
|
||||||
use crate::chat::Cursor;
|
use super::{util, Cursor};
|
||||||
|
|
||||||
use super::util;
|
|
||||||
|
|
||||||
pub struct Block<I> {
|
pub struct Block<I> {
|
||||||
pub id: I,
|
pub id: I,
|
||||||
|
|
@ -2,11 +2,10 @@
|
||||||
|
|
||||||
use toss::frame::{Frame, Size};
|
use toss::frame::{Frame, Size};
|
||||||
|
|
||||||
use crate::chat::Cursor;
|
|
||||||
use crate::store::{Msg, MsgStore, Tree};
|
use crate::store::{Msg, MsgStore, Tree};
|
||||||
|
|
||||||
use super::blocks::Blocks;
|
use super::blocks::Blocks;
|
||||||
use super::{util, TreeView};
|
use super::{util, Cursor, TreeView};
|
||||||
|
|
||||||
impl<M: Msg> TreeView<M> {
|
impl<M: Msg> TreeView<M> {
|
||||||
#[allow(clippy::too_many_arguments)]
|
#[allow(clippy::too_many_arguments)]
|
||||||
|
|
@ -2,12 +2,11 @@
|
||||||
|
|
||||||
use toss::frame::{Frame, Size};
|
use toss::frame::{Frame, Size};
|
||||||
|
|
||||||
use crate::chat::Cursor;
|
|
||||||
use crate::store::{Msg, MsgStore, Tree};
|
use crate::store::{Msg, MsgStore, Tree};
|
||||||
|
|
||||||
use super::blocks::{Block, Blocks};
|
use super::blocks::{Block, Blocks};
|
||||||
use super::util::{self, MIN_CONTENT_WIDTH};
|
use super::util::{self, MIN_CONTENT_WIDTH};
|
||||||
use super::TreeView;
|
use super::{Cursor, TreeView};
|
||||||
|
|
||||||
fn msg_to_block<M: Msg>(frame: &mut Frame, size: Size, msg: &M, indent: usize) -> Block<M::Id> {
|
fn msg_to_block<M: Msg>(frame: &mut Frame, size: Size, msg: &M, indent: usize) -> Block<M::Id> {
|
||||||
let nick = msg.nick();
|
let nick = msg.nick();
|
||||||
|
|
@ -6,10 +6,10 @@ use tokio::sync::mpsc;
|
||||||
use toss::frame::{Frame, Pos, Size};
|
use toss::frame::{Frame, Pos, Size};
|
||||||
use toss::terminal::Terminal;
|
use toss::terminal::Terminal;
|
||||||
|
|
||||||
use crate::chat::Chat;
|
|
||||||
use crate::euph::{self, Status};
|
use crate::euph::{self, Status};
|
||||||
use crate::vault::{EuphMsg, EuphVault};
|
use crate::vault::{EuphMsg, EuphVault};
|
||||||
|
|
||||||
|
use super::chat::Chat;
|
||||||
use super::{util, UiEvent};
|
use super::{util, UiEvent};
|
||||||
|
|
||||||
pub struct EuphRoom {
|
pub struct EuphRoom {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue