Commit graph

80 commits

Author SHA1 Message Date
a8d34b8118 Merge forgejo: keep local README 2026-05-21 20:03:22 +02:00
1546d7feb4 Initial commit 2026-05-21 20:02:33 +00:00
496614f790 feat(pdf): improve PDF rendering quality and zoom sharpness
- Change PDF_RENDER_QUALITY from 2.0 to 3.0 for higher resolution rendering
- Replace PNG round-trip with direct Cairo surface → DynamicImage conversion
- Convert ARgb32 to RGBA directly, avoiding PNG encoding/decoding artifacts
- Switch image filter from Nearest to Linear for smoother zoom display
- Remove unused Cursor and ImageReader imports
- Strip release binary to reduce size from 612MB to 36MB
2026-05-21 19:59:07 +02:00
Wolfgang Morawetz
fc6e8c8056
Merge pull request #2 from bittin/main
Create Swedish localization for Noctua by bittin
thx a lot.
2026-02-24 17:45:57 +01:00
Wolfgang Morawetz
ee51827262
Merge pull request #1 from lorduskordus/czech-translation
i18n(cs): Add Czech translation by lorduskordus
thx a lot.
2026-02-24 17:43:23 +01:00
lorduskordus
3be3203fe4
i18n(cs): Add Czech translation 2026-02-24 16:50:48 +01:00
Luna Jernberg
3292cd4cf5
Create Swedish localization for Noctua
Added localization strings for Noctua in Swedish.
2026-02-19 08:17:30 +01:00
mow
6bd5426b51 chore: update README and screenshot 2026-02-05 18:03:59 +01:00
mow
7c7cf41183 chore: remove development artifacts from repository 2026-02-05 17:51:07 +01:00
mow
44ed10ba42 chore: remove development artifacts from repository 2026-02-05 17:49:29 +01:00
mow
ea4acf9fdd Auto-open nav bar with thumbnails for multi-page documents
- Automatically show nav bar and thumbnail panel when loading PDF files
- Hide nav bar when switching to single-page documents
- Apply auto-toggle on initial load and document navigation
- Thumbnails are already generated via DocumentManager.open_document()
2026-02-05 17:30:14 +01:00
mow
a8344f77a1 Fix initial document display and set Fit mode as default
- Cache rendered image handle on startup to fix 'No document loaded' issue
- Set ViewMode::Fit as default for initial load and navigation
- Disable tooltips in header (too ugly)
- Temporarily disable main menu button (needs proper implementation)
2026-02-05 17:27:44 +01:00
wfx
9624eec699 chore: ignore for .zed 2026-02-05 14:59:43 +01:00
wfx
6748a25e19 chore: remove .zed/settings.json from repository 2026-02-05 14:54:00 +01:00
wfx
6002b37406 feat: UI rewrite - TEA architecture, eliminate sync pattern
Complete UI layer refactoring to achieve Clean Architecture + TEA principles.

Major Changes:
- Eliminated sync.rs (76 LOC of manual synchronization)
- Restructured AppModel: pure UI state only
  - Introduced AppMode enum (View, Crop, Transform, Fullscreen)
  - Added Viewport struct (scale, pan, canvas, cached_image_handle)
  - Added PanelState struct (left, right panels)
- Removed all cached document data from UI layer
- Views now access DocumentManager directly (no caching)
- Update functions work on both model and manager directly

Architecture:
- TEA-compliant: Single source of truth, unidirectional flow
- Clean separation: UI state vs Document state
- No manual synchronization required

Benefits:
- Simplified codebase: -1,986 LOC net (-75.6%)
- Better maintainability: Clear responsibilities
- Type-safe state: Enums instead of flags
- Performance: Cached rendering where needed

Refactored Files:
- src/ui/model.rs: Complete rewrite
- src/ui/update.rs: Complete rewrite
- src/ui/views/*: Updated to use new architecture
- src/ui/views/meta_panel.rs: Extracted from panels.rs

Testing:
- All 24 unit tests passing
- Compiles successfully (cargo check, cargo build)
- 32 warnings (non-critical, future features)

BREAKING CHANGES: None (internal refactoring only)

Co-authored-by: Clean Architecture principles
Co-authored-by: TEA (The Elm Architecture) pattern
2026-02-05 10:41:51 +01:00
wfx
5126b24cb2 fix: Add bounds offset when drawing crop overlay
The fix: cursor.position_in(bounds) returns RELATIVE coordinates,
but we were drawing at those relative positions directly.

Solution: Add bounds.x and bounds.y offset when drawing.
- selection.region stores relative coords (from cursor)
- when drawing: absolute = relative + bounds offset

This fixes the Y-position being too far up.
2026-02-04 18:32:10 +01:00
wfx
d05c459e92 fix: Simplify crop_overlay - NO coordinate transformation
KISS principle: Widget is in stack over canvas, uses SAME coordinates!
- Mouse position = exact position to draw
- selection.region = canvas pixel coordinates
- NO relative/absolute conversion needed
- NO bounds offset calculations

Removed all the over-engineered coordinate math.
2026-02-04 18:25:39 +01:00
wfx
22bf19ddd3 refactor: Remove redundant keyboard handlers from crop_overlay widget
Keyboard events (Enter/Escape) are already handled globally in app.rs
subscription and work correctly with Crop mode detection.

Widget-level keyboard events don't work without focus anyway.
Only mouse events (click, drag, double-click) stay in the widget.
2026-02-04 18:19:44 +01:00
wfx
32468c2758 fix: Crop overlay coordinate system and add Enter/Double-click support
B1: Fixed handle positions - now uses relative coordinates correctly
    - Handles are drawn at correct positions (relative to bounds)
    - Conversion between screen and relative coords

B2: Added Enter and Double-click for Apply
    - Enter key applies crop when selection exists
    - Escape key cancels crop
    - Double-click on selection center applies crop (400ms window)
2026-02-04 18:16:48 +01:00
wfx
531cfef715 refactor: Clean Architecture - Separate domain (CropRegion) from UI (crop_model)
- CropRegion moved to domain/document/operations/crop.rs (pure model)
- crop_types.rs renamed to crop_model.rs (honest UI model name)
- DragHandle and CropSelection stay in UI layer (where they belong)
- Clean separation: Domain has no UI concerns, UI imports from Domain
2026-02-04 16:46:41 +01:00
wfx
be956f701b feat: Implement clean crop overlay (395 lines, simple stack-based approach) 2026-02-04 16:36:35 +01:00
wfx
f60907b51c refactor: Move image_viewer to widgets/ (it's a widget, not a view) 2026-02-04 16:33:52 +01:00
wfx
a9284bc22b REVERT: Back to working viewer - Keep what works (Mouse Zoom/Pan), Remove over-engineering 2026-02-04 16:29:09 +01:00
wfx
49bff3dd89 Step 4 complete: Add CropWidget (444 lines) and crop dialog - Crop feature restored! 2026-02-04 16:20:08 +01:00
wfx
5d729c7495 Step 3 complete: Replace custom image_viewer (559 lines) with standard widgets (~120 lines) 2026-02-04 16:10:14 +01:00
wfx
387afdf4f2 Step 3 prep: Domain renders at 1.0, add scroll_id to model 2026-02-04 16:05:58 +01:00
wfx
35ff783f25 Step 2: Remove old complex crop components (~500 lines deleted) 2026-02-04 16:00:53 +01:00
wfx
34d0045e0d Step 1: Add simplified crop types in ui/widgets, update imports 2026-02-04 16:00:26 +01:00
wfx
6a4629bb47 Before UI simplification - Clean Architecture complete 2026-02-04 15:56:44 +01:00
wfx
fc73e4b76b Complete Clean Architecture migration
Phase 1-7: Full migration from src/app/ to Clean Architecture

BREAKING CHANGES:
- Removed src/app/ (old TEA-style implementation)
- Removed src/constant.rs (constants now local to modules)
- Removed deprecated canvas_to_image_coords functions

NEW STRUCTURE:
- src/ui/           - UI Layer (COSMIC interface)
- src/application/  - Application Layer (DocumentManager, Commands)
- src/domain/       - Domain Layer (Document types, Operations)
- src/infrastructure/ - Infrastructure Layer (Loaders, Cache, System)

FEATURES:
- DocumentManager as Single Source of Truth
- Command Pattern for all operations
- Model caching for render data (performance)
- Sync mechanism between DocumentManager and UI Model
- Wallpaper support (COSMIC, KDE, GNOME, feh)
- Thumbnail cache with disk persistence

IMPROVEMENTS:
- Warnings: 62 → 43 (-31%)
- Deprecated warnings: 2 → 0 (-100%)
- Code removed: src/app/ (~2000 lines), constant.rs, deprecated functions
- Better Locality of Reference (constants local to modules)
- Clean separation of concerns
- No circular dependencies

DOCUMENTATION:
- Updated AGENTS.md (100% migration status)
- Updated README.md (architecture section)
- Updated Workflow.md
- Added Migration-Plan.md with full completion summary

TESTS:
- All 41 tests passing
- Build successful (0 errors, 43 warnings)
- Release build verified

Migration Status:  100% Complete
2026-02-03 08:43:21 +01:00
wfx
f8087a3c6a docs: Traits & Enums comparison - Domain is complete
- All app/ traits present in domain/
- Domain has additional features (fine rotation, interpolation)
- RotationMode is more flexible than plain Rotation
- Better error handling in MultiPageThumbnails
- No changes needed - domain version is superior

Refs: Migration Step 1.7
2026-02-02 22:00:37 +01:00
wfx
beab03ccf7 docs: Metadata comparison - no changes needed
- Verified BasicMeta, ExifMeta, DocumentMeta are identical
- Domain version is better organized (extract_meta in types)
- from_bytes() is public in domain (vs private in app)
- No consolidation needed

Refs: Migration Step 1.6
2026-02-02 21:59:01 +01:00
wfx
252ccdd95b feat(domain): Add crop() and extract_meta() to DocumentContent
- crop(): Universal crop for all document types (delegates to type impl)
- extract_meta(): Extract metadata from any document type
- Both methods work via type erasure pattern

Refs: Migration Step 1.5
2026-02-02 21:51:15 +01:00
wfx
c8545627fa feat(domain): Add extract_meta() and crop() to PortableDocument
- extract_meta(): Extract PDF metadata (page count, dimensions)
- crop(): Render-based crop on current page
- Completes PortableDocument feature parity with app/

Refs: Migration Step 1.4
2026-02-02 21:48:54 +01:00
wfx
5c830d5504 feat(domain): Add extract_meta() and crop() to VectorDocument
- extract_meta(): Extract basic metadata (SVG format, native dimensions)
- crop(): Render-based crop on rasterized output
- Completes VectorDocument feature parity with app/

Refs: Migration Step 1.3
2026-02-02 21:46:37 +01:00
wfx
8ff43ea5d7 feat(domain): Add crop_to_image() and extract_meta() to RasterDocument
- crop_to_image(): Non-destructive crop returning DynamicImage
- extract_meta(): Extract BasicMeta and EXIF metadata
- Completes migration of RasterDocument features from app/ to domain/

Refs: Migration Step 1.2
2026-02-02 21:45:11 +01:00
wfx
3cf99ad19d feat: implement crop functionality with self-contained widget
- Inspired by cosmic-viewer's crop implementation (https://codeberg.org/bhh32/cosmic-viewer)
- Add crop support for all document types (Raster, Vector, Portable)
2026-01-22 20:40:36 +01:00
wfx
9399a008c4 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
2026-01-19 19:42:54 +01:00
wfx
0e31b146a3 docs: update 2026-01-18 20:42:46 +01:00
wfx
1182b7b55d feature: PDF and PDF thumbnails and refresh UI
- Implement PDF and PDF thumbnail generation with incremental loading
- Add UI refresh mechanism (tick counter + RefreshView message)
- Improve fl! macro with named parameters
- Clean up code organization (mod.rs: wiring, model.rs: state only)
2026-01-18 20:35:12 +01:00
wfx
220a886acc feat: add set as wallpaper functionality
Add ability to set current image as desktop wallpaper with keyboard
shortcut 'W' and icon button in Properties panel.

Supports COSMIC, GNOME, KDE, XFCE, and tiling window managers via
automatic detection and fallback mechanism.

Implementation uses wallpaper crate with custom COSMIC config file
integration and gsettings/feh fallbacks.
2026-01-15 20:40:53 +01:00
mow
ca7661fa3e docs: rename link from 'Keyboard Shortcuts' to 'Usage'
The usage.md now contains comprehensive user guide beyond
just keyboard shortcuts.
2026-01-15 19:06:32 +01:00
mow
a4bba8d4f1 chore: remove unused panel icon resources
Remove panel-left-symbolic.svg and panel-right-symbolic.svg
as they are no longer needed.
2026-01-15 19:04:58 +01:00
mow
31fd194d44 docs: update configuration path to correct COSMIC location 2026-01-15 18:52:03 +01:00
mow
4cfb56de61 docs: clarify zoom in/out mathematics
Explain that zoom out is the mathematical inverse of zoom in
(divide by 1.1 instead of multiply), making the operations
reversible.
2026-01-15 18:44:29 +01:00
mow
3726ea16de docs: update usage guide to current implementation status
- Mark all zoom and pan controls as fully working
- Remove status column (all shortcuts are implemented)
- Add detailed descriptions for each feature
- Include mouse controls and toolbar usage
- Add tips for keyboard-driven workflow
- Document bidirectional control synchronization
- Remove or mark planned features accurately
2026-01-15 18:42:30 +01:00
mow
47f2c7020c docs: add (Implemented) markers to all current features
Ensures consistent labeling throughout the Current Features section.
2026-01-15 18:39:56 +01:00
mow
6115e25fed docs: add (Implemented) markers consistently
Mark all current features with (Implemented) for consistency
with the Raster Images section.
2026-01-15 18:37:44 +01:00
mow
3ca9315e7f docs: remove reference to non-existent CONTRIBUTING.md 2026-01-15 18:34:31 +01:00
mow
b7d024bde2 docs: correct feature status for SVG and PDF
Both SVG and PDF support are prepared in code structure but
not yet functionally implemented. They currently show 1x1
placeholder images. Moved to 'Planned Features' section with
proper status documentation.
2026-01-15 18:32:18 +01:00