refactor: improve code quality and consistency
Comprehensive code audit addressing naming consistency, dead code removal, and documentation improvements across the entire codebase. - Rename panel_pages.rs → pages_panel.rs for consistent naming - Unify view functions: all panels now use view() convention - Rename header_start/end() → start/end() for brevity - Update all imports and references - Remove Rotation::from_degrees() (only 4 fixed states needed) - Remove TransformState::identity() and is_identity() (Default suffices) - Remove duplicate convenience methods from RasterDocument, VectorDocument, PortableDocument (rotate_cw/ccw, flip_horizontal/vertical) - Remove unused imports and constants (ROTATION_STEP, FULL_ROTATION) - Rename constants: PDF_RENDER_SCALE → PDF_RENDER_QUALITY, PDF_THUMBNAIL_SCALE → PDF_THUMBNAIL_SIZE - Add comprehensive trait documentation explaining type erasure pattern - Document why large enum variants are acceptable - Add #[allow(dead_code)] with explanations for trait API types - Improve all constant and config comments - Collapse nested if statements using Rust 2024 let-chains - Replace single-arm match with if-let - Introduce StateChangeCallback<Message> type alias - Apply clippy auto-fixes for better code style
This commit is contained in:
parent
0e31b146a3
commit
9399a008c4
19 changed files with 744 additions and 418 deletions
|
|
@ -10,19 +10,19 @@ use std::path::PathBuf;
|
|||
#[derive(Debug, Clone, CosmicConfigEntry, PartialEq)]
|
||||
#[version = 1]
|
||||
pub struct AppConfig {
|
||||
/// Optional default directory to open images from.
|
||||
/// Default directory to open when browsing for documents.
|
||||
pub default_image_dir: Option<PathBuf>,
|
||||
/// Whether the nav bar (left panel) is visible.
|
||||
/// Show page navigation panel (left sidebar for multi-page documents).
|
||||
pub nav_bar_visible: bool,
|
||||
/// Whether the context drawer (right panel) is visible.
|
||||
/// Show properties panel (right sidebar with metadata).
|
||||
pub context_drawer_visible: bool,
|
||||
/// Scale step factor for keyboard zoom (e.g., 1.1 = 10% per step).
|
||||
/// Zoom step multiplier for keyboard shortcuts (1.1 = 10% increase per step).
|
||||
pub scale_step: f32,
|
||||
/// Pan step size in pixels per key press.
|
||||
/// Pan distance in pixels per arrow key press.
|
||||
pub pan_step: f32,
|
||||
/// Minimum zoom scale (e.g., 0.1 = 10%).
|
||||
/// Minimum zoom level (0.1 = 10% of original size).
|
||||
pub min_scale: f32,
|
||||
/// Maximum zoom scale (e.g., 20.0 = 2000%).
|
||||
/// Maximum zoom level (8.0 = 800% of original size).
|
||||
pub max_scale: f32,
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue