Compare commits

..

3 Commits

Author SHA1 Message Date
itsjunetime 69fd8ec7e8 Add instructions for zooming and such to help page 2025-08-09 15:58:56 -06:00
itsjunetime ebd902e864 Mark v0.4.0 on changelog 2025-08-06 09:35:38 -06:00
June b6bc76edbb New kitty image backend (#74)
* Initial attempt at supporting new backend for kitty images

* it's almost working !!

* it almost basically works

* yaaayyyy it works

* Use github kittage

* Uhhhh various improvements from kittage and psx-shm

* Remove logging

* incorporate recovering from deleted images

* Make it work correctly with ghostty image eviction too

* fall back to stdout if shms don't work

* Make help page work again

* zooming basically does what you'd expect now

* yay zooming woohoo

* clean up top and bottom rendering

* Only allow zooming in kitty

* Add debug logging and fix cursor placement after image display

* yaaaay zooming out once you're already zoomed in and respecting kitty's limits for how big of an image to display

* mmmm maybe it's finally ready to merge...

* Update deps

* Switch around list of items on changelog

* fmt

* Small fixes to avoid panic and allow zooming back in after zooming out
2025-08-06 09:34:55 -06:00
2 changed files with 25 additions and 13 deletions
+6
View File
@@ -1,5 +1,11 @@
# Unreleased
# v0.4.1
- Add instructions for using new zoom/pan features to help page
# v0.4.0
- Update to new `kittage` backend for kitty-protocol-supporting terminals (fixes many issues and improves performance significantly, see [the PR](https://github.com/itsjunetime/tdf/pull/74))
- Use new mupdf search API for slightly better performance
- Update ratatui(-image) dependencies
+19 -13
View File
@@ -18,8 +18,8 @@ use ratatui::{
layout::{Constraint, Flex, Layout, Position, Rect},
style::{Color, Style},
symbols::border,
text::{Span, Text},
widgets::{Block, Borders, Clear, Padding}
text::Span,
widgets::{Block, Borders, Clear, Padding, Paragraph, Wrap}
};
use ratatui_image::{FontSize, Image};
@@ -830,7 +830,7 @@ impl Tui {
.border_set(border::ROUNDED)
.border_style(Color::Blue);
let help_span = Text::raw(HELP_PAGE);
let help_span = Paragraph::new(HELP_PAGE).wrap(Wrap { trim: false });
let max_w: u16 = HELP_PAGE
.lines()
@@ -863,25 +863,31 @@ impl Tui {
static HELP_PAGE: &str = "\
l, h, left, right:
Go forward/backwards a single page
Go forward/backwards a single page
j, k, down, up:
Go forwards/backwards a screen's worth of pages
Go forwards/backwards a screen's worth of pages
q, esc:
Quit
Quit
g:
Go to specific page (type numbers after 'g')
Go to specific page (type numbers after 'g')
/:
Search
Search
n, N:
Next/Previous search result
Next/Previous search result
i:
Invert colors
Invert colors
f:
Remove borders/fullscreen
Remove borders/fullscreen
z (when using kitty protocol):
Toggle between fill-screen and fit-screen
o/O (when on fill-screen):
zoom in and out, respectively
H, J, K, L (when zoomed in):
pan direction around page
?:
Show this page
Show this page
ctrl+z:
Suspend & background tdf \
Suspend & background tdf \
";
pub enum InputAction {