A fork of pulp-os for the xteink4 adding custom apps
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

whoops: cargo fmt

hansmrtn 445755fe 6f325258

+24 -26
+2 -2
kernel/src/drivers/strip.rs
··· 3 3 // widgets draw to logical coords, clipped here 4 4 5 5 use embedded_graphics_core::{ 6 + Pixel, 6 7 draw_target::DrawTarget, 7 8 geometry::{OriginDimensions, Size}, 8 9 pixelcolor::BinaryColor, 9 10 primitives::Rectangle, 10 - Pixel, 11 11 }; 12 12 13 - use super::ssd1677::{Rotation, HEIGHT, WIDTH}; 13 + use super::ssd1677::{HEIGHT, Rotation, WIDTH}; 14 14 use crate::ui::Region; 15 15 16 16 pub const STRIP_ROWS: u16 = 40;
+1 -1
kernel/src/kernel/dir_cache.rs
··· 3 3 4 4 use crate::drivers::sdcard::SdStorage; 5 5 use crate::drivers::storage::{ 6 - list_root_files, read_file_start_in_dir, DirEntry, DirPage, PULP_DIR, TITLES_FILE, 6 + DirEntry, DirPage, PULP_DIR, TITLES_FILE, list_root_files, read_file_start_in_dir, 7 7 }; 8 8 use crate::error::Result; 9 9
+2 -3
src/apps/home.rs
··· 510 510 .unwrap(); 511 511 512 512 if self.bm_count > 0 { 513 - let mut status = 514 - BitmapDynLabel::<20>::new(self.bm_status_region(), self.ui_fonts.body) 515 - .alignment(Alignment::CenterRight); 513 + let mut status = BitmapDynLabel::<20>::new(self.bm_status_region(), self.ui_fonts.body) 514 + .alignment(Alignment::CenterRight); 516 515 let _ = write!(status, "{}/{}", self.bm_selected + 1, self.bm_count); 517 516 status.draw(strip).unwrap(); 518 517 }
+10 -7
src/apps/reader/epubs.rs
··· 111 111 self.archive_size, 112 112 self.name_hash, 113 113 self.spine.len(), 114 - ).is_ok() && hdr.chapters_complete() { 114 + ) 115 + .is_ok() 116 + && hdr.chapters_complete() 117 + { 115 118 // read chapter table 116 119 let count = hdr.chapter_count as usize; 117 120 let tbl_bytes = count * cache::CHAPTER_ENTRY_SIZE; 118 121 let tbl_offset = hdr.table_offset(); 119 122 if tbl_bytes <= scratch.len() { 120 - if let Ok(tn) = k.read_cache_chunk( 121 - cf_str, 122 - tbl_offset, 123 - &mut scratch[..tbl_bytes], 124 - ) && tn >= tbl_bytes 123 + if let Ok(tn) = 124 + k.read_cache_chunk(cf_str, tbl_offset, &mut scratch[..tbl_bytes]) 125 + && tn >= tbl_bytes 125 126 { 126 127 if cache::parse_chapter_table( 127 128 &scratch[..tbl_bytes], 128 129 count, 129 130 &mut self.chapter_table, 130 - ).is_ok() { 131 + ) 132 + .is_ok() 133 + { 131 134 self.chapters_cached = true; 132 135 for i in 0..count { 133 136 self.ch_cached[i] = true;
+2 -2
src/apps/reader/images.rs
··· 16 16 use smol_epub::zip::{self, ZipIndex}; 17 17 18 18 use crate::error::{Error, ErrorKind}; 19 - use crate::kernel::work_queue; 20 19 use crate::kernel::KernelHandle; 20 + use crate::kernel::work_queue; 21 21 22 22 use super::{ 23 - ReaderApp, DEFAULT_IMG_H, MAX_IMAGES_PER_PAGE, NO_PREFETCH, PAGE_BUF, PRECACHE_IMG_MAX, 23 + DEFAULT_IMG_H, MAX_IMAGES_PER_PAGE, NO_PREFETCH, PAGE_BUF, PRECACHE_IMG_MAX, ReaderApp, 24 24 }; 25 25 26 26 fn from_smol_image(img: smol_epub::DecodedImage) -> DecodedImage {
+5 -9
src/apps/reader/mod.rs
··· 481 481 } else { 482 482 // image phase: 80% to 100% 483 483 if img_found > 0 { 484 - let _ = write!( 485 - lbuf, 486 - "Caching images {}/{}", 487 - img_cached, img_found 488 - ); 484 + let _ = write!(lbuf, "Caching images {}/{}", img_cached, img_found); 489 485 (80 + (img_cached * 20) / img_found).min(100) as u8 490 486 } else { 491 487 let _ = write!(lbuf, "Caching images"); ··· 582 578 // apply line spacing: scale native line height by theme percentage 583 579 self.font_line_h = ((native_h as u32 * spacing_pct as u32) / 100).max(1) as u16; 584 580 self.font_ascent = fs.ascent(fonts::Style::Regular); 585 - self.max_lines = ((self.text_area_h / self.font_line_h) as usize).min(LINES_PER_PAGE) as u8; 581 + self.max_lines = 582 + ((self.text_area_h / self.font_line_h) as usize).min(LINES_PER_PAGE) as u8; 586 583 log::info!( 587 584 "font: size_idx={} line_h={} (native {} x {}%) ascent={} max_lines={} margin={}", 588 585 self.book_font_size_idx, ··· 1345 1342 } 1346 1343 } 1347 1344 QA_TOC => { 1348 - if self.is_epub && self.epub.toc.as_ref().map_or(false, |t| !t.is_empty()) { 1345 + if self.is_epub && self.epub.toc.as_ref().map_or(false, |t| !t.is_empty()) { 1349 1346 let toc = self.epub.toc.as_ref().unwrap(); 1350 1347 log::info!("toc: opening ({} entries)", toc.len()); 1351 1348 self.epub.toc_selected = 0; ··· 1447 1444 let _ = write!( 1448 1445 sbuf, 1449 1446 " [img {}/{}]", 1450 - self.epub.img_cached_count, 1451 - self.epub.img_found_count, 1447 + self.epub.img_cached_count, self.epub.img_found_count, 1452 1448 ); 1453 1449 } else { 1454 1450 let _ = write!(sbuf, " [img]");
+2 -2
src/apps/reader/paging.rs
··· 10 10 use crate::kernel::KernelHandle; 11 11 12 12 use super::{ 13 - decode_utf8_char, LineSpan, ReaderApp, State, DEFAULT_IMG_H, INDENT_PX, LINES_PER_PAGE, 14 - MAX_PAGES, NO_PREFETCH, PAGE_BUF, 13 + DEFAULT_IMG_H, INDENT_PX, LINES_PER_PAGE, LineSpan, MAX_PAGES, NO_PREFETCH, PAGE_BUF, 14 + ReaderApp, State, decode_utf8_char, 15 15 }; 16 16 17 17 impl ReaderApp {