- Fork cosmic::iced viewer widget to enable external state control - Add bidirectional state synchronization between viewer and AppModel - Implement ViewerStateChanged message for mouse interaction feedback - Fix pixel-perfect rendering at 100% zoom (ActualSize mode) - Ensure smooth interaction between mouse, keyboard, and button controls This allows zoom/pan to work via: - Keyboard shortcuts (+/-, Ctrl+arrows) - Future toolbar buttons - Mouse wheel and drag (existing functionality preserved) The viewer state now properly syncs in both directions: - External controls (keyboard/buttons) → update viewer state via diff() - Mouse interactions → update AppModel via ViewerStateChanged message Closes: Zoom/pan via keyboard and buttons now functional
19 lines
392 B
Rust
19 lines
392 B
Rust
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
// src/app/view/mod.rs
|
|
//
|
|
// View module root, combining all view components.
|
|
|
|
mod canvas;
|
|
pub mod footer;
|
|
pub mod header;
|
|
mod image_viewer;
|
|
pub mod panels;
|
|
|
|
use cosmic::Element;
|
|
|
|
use crate::app::{AppMessage, AppModel};
|
|
|
|
/// Main application view (canvas area).
|
|
pub fn view(model: &AppModel) -> Element<'_, AppMessage> {
|
|
canvas::view(model)
|
|
}
|