mirror of
https://codeberg.org/unspeaker/tengri.git
synced 2026-08-07 22:17:07 +02:00
fix warns
This commit is contained in:
parent
81bc0c67a3
commit
5ca329292f
11 changed files with 16 additions and 21 deletions
2
dizzle
2
dizzle
|
|
@ -1 +1 @@
|
||||||
Subproject commit 39eab8d0db2fcadcd7d5e661141a8791d780a876
|
Subproject commit 0f06571f7fc7e5f87aadb82d531726d24bf769e8
|
||||||
|
|
@ -150,7 +150,6 @@ features! {
|
||||||
layout,
|
layout,
|
||||||
lrtb,
|
lrtb,
|
||||||
sizer,
|
sizer,
|
||||||
space,
|
|
||||||
split,
|
split,
|
||||||
thunk,
|
thunk,
|
||||||
xywh
|
xywh
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
#![allow(unused)]
|
||||||
|
|
||||||
use crate::*;
|
use crate::*;
|
||||||
|
|
||||||
impl<S: Screen, T: Draw<S>> Layout<S> for T {}
|
impl<S: Screen, T: Draw<S>> Layout<S> for T {}
|
||||||
|
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
use crate::*;
|
|
||||||
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
use crate::*;
|
use crate::lang::*;
|
||||||
use crate::{*, lang::*, draw::*, task::*, exit::*};
|
|
||||||
use ::ratatui::buffer::Cell;
|
use ::ratatui::buffer::Cell;
|
||||||
|
|
||||||
/// TUI buffer sized by `usize` instead of `u16`.
|
/// TUI buffer sized by `usize` instead of `u16`.
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
use crate::*;
|
use crate::*;
|
||||||
use ratatui::prelude::Color;
|
use ratatui::prelude::Color;
|
||||||
use dizzle::{Ostensibly, Expression, LanguageError::*};
|
use dizzle::{Expression, LanguageError::*};
|
||||||
|
|
||||||
pub trait ColorDsl<T>: Sized {
|
pub trait ColorDsl<T>: Sized {
|
||||||
fn new_g (expr: T, try_to_u8: impl Fn(Perhaps<&str>)->Perhaps<u8>) -> Usually<Self>;
|
fn new_g (expr: T, try_to_u8: impl Fn(Perhaps<&str>)->Perhaps<u8>) -> Usually<Self>;
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,5 @@
|
||||||
use crate::{task::Task, term::TuiEvent};
|
use ::dizzle::{Language, Symbol, Usually};
|
||||||
use ::std::sync::{Arc, RwLock, atomic::{AtomicBool, Ordering::*}};
|
use ::crossterm::event::{Event, KeyEvent, KeyCode, KeyModifiers, KeyEventKind, KeyEventState};
|
||||||
use ::std::time::Duration;
|
|
||||||
use ::dizzle::{Language, Symbol, Usually, Apply};
|
|
||||||
use ::crossterm::event::{
|
|
||||||
read, Event, KeyEvent, KeyCode, KeyModifiers, KeyEventKind, KeyEventState
|
|
||||||
};
|
|
||||||
|
|
||||||
/// TUI key spec.
|
/// TUI key spec.
|
||||||
#[derive(Debug, Clone, Eq, PartialEq, PartialOrd)]
|
#[derive(Debug, Clone, Eq, PartialEq, PartialOrd)]
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,3 @@
|
||||||
use crate::*;
|
|
||||||
|
|
||||||
/// Stackably padded.
|
/// Stackably padded.
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
use crate::*;
|
use crate::*;
|
||||||
use ratatui::{prelude::{Style, Position, Backend, Color}};
|
use ratatui::{prelude::{Position}};
|
||||||
|
|
||||||
pub const fn x_repeat (c: &str) -> impl Draw<Tui> {
|
pub const fn x_repeat (c: &str) -> impl Draw<Tui> {
|
||||||
thunk(move|to: &mut Tui|{
|
thunk(move|to: &mut Tui|{
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
use crate::*;
|
use crate::*;
|
||||||
use ratatui::{prelude::{Style, Position, Backend, Color}};
|
use ratatui::{prelude::{Position}};
|
||||||
|
|
||||||
pub const ICON_DEC_V: &[char] = &['▲'];
|
pub const ICON_DEC_V: &[char] = &['▲'];
|
||||||
pub const ICON_INC_V: &[char] = &['▼'];
|
pub const ICON_INC_V: &[char] = &['▼'];
|
||||||
|
|
@ -7,7 +7,7 @@ pub const ICON_DEC_H: &[char] = &[' ', '🞀', ' '];
|
||||||
pub const ICON_INC_H: &[char] = &[' ', '🞂', ' '];
|
pub const ICON_INC_H: &[char] = &[' ', '🞂', ' '];
|
||||||
|
|
||||||
pub fn x_scroll () -> impl Draw<Tui> {
|
pub fn x_scroll () -> impl Draw<Tui> {
|
||||||
thunk(|Tui(buf, XYWH(x1, y1, w, h)): &mut Tui|{
|
thunk(|Tui(buf, XYWH(x1, y1, w, _h)): &mut Tui|{
|
||||||
let x2 = *x1 + *w;
|
let x2 = *x1 + *w;
|
||||||
for (i, x) in (*x1..=x2).enumerate() {
|
for (i, x) in (*x1..=x2).enumerate() {
|
||||||
if let Some(cell) = buf.cell_mut(Position::from((x, *y1))) {
|
if let Some(cell) = buf.cell_mut(Position::from((x, *y1))) {
|
||||||
|
|
@ -35,7 +35,7 @@ pub fn x_scroll () -> impl Draw<Tui> {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn y_scroll () -> impl Draw<Tui> {
|
pub fn y_scroll () -> impl Draw<Tui> {
|
||||||
thunk(|Tui(buf, XYWH(x1, y1, w, h)): &mut Tui|{
|
thunk(|Tui(buf, XYWH(x1, y1, _w, h)): &mut Tui|{
|
||||||
let y2 = *y1 + *h;
|
let y2 = *y1 + *h;
|
||||||
for (i, y) in (*y1..=y2).enumerate() {
|
for (i, y) in (*y1..=y2).enumerate() {
|
||||||
if let Some(cell) = buf.cell_mut(Position::from((*x1, y))) {
|
if let Some(cell) = buf.cell_mut(Position::from((*x1, y))) {
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
#![allow(unused)]
|
||||||
|
|
||||||
use crate::*;
|
use crate::*;
|
||||||
pub(crate) use ::unicode_width::*;
|
pub(crate) use ::unicode_width::*;
|
||||||
|
|
||||||
|
|
@ -96,7 +98,9 @@ pub fn trim_string (max_width: usize, input: impl AsRef<str>) -> String {
|
||||||
pub struct TrimString<T: AsRef<str>>(pub u16, pub T);
|
pub struct TrimString<T: AsRef<str>>(pub u16, pub T);
|
||||||
impl<T: AsRef<str>> AsRef<str> for TrimString<T> { fn as_ref (&self) -> &str { self.1.as_ref() } }
|
impl<T: AsRef<str>> AsRef<str> for TrimString<T> { fn as_ref (&self) -> &str { self.1.as_ref() } }
|
||||||
impl<'a, T: AsRef<str>> TrimString<T> {
|
impl<'a, T: AsRef<str>> TrimString<T> {
|
||||||
fn to_ref (&self) -> TrimStringRef<'_, T> { TrimStringRef(self.0, &self.1) }
|
fn to_ref (&self) -> TrimStringRef<'_, T> {
|
||||||
|
TrimStringRef(self.0, &self.1)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Displays a borrowed [str]-like with fixed maximum width
|
/// Displays a borrowed [str]-like with fixed maximum width
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue