document and image viewer
git clone https://git.lucas.co/cce-preview.git
refactor: build the app with Application::create
Application::new(qh, sender) took the session's Wayland queue handle,
which no client ever used, and calloop's sender; cce-ui is retiring it
for create(sender: AppSender<_>), which names no window system. The
body is unchanged: an app that keeps calloop's sender converts the
AppSender into it on the first line, and the now-unused QueueHandle and
EngineState imports go.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
src/main.rs | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/main.rs b/src/main.rs
index dd0c7ca..6a2baa2 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -14,9 +14,8 @@ mod doc;
use std::path::{Path, PathBuf};
-use wayland_client::QueueHandle;
-use cce_ui::engine::{Application, EngineState, LogicalPosition, LogicalSize, WindowSettings};
+use cce_ui::engine::{Application, LogicalPosition, LogicalSize, WindowSettings};
use cce_ui::scene::layout::Rect;
use cce_ui::scene::paint::{DisplayList, PaintCtx};
use cce_ui::widget::scroll_motion::{Bounds, ScrollMotion};
@@ -294,7 +293,9 @@ fn collection_for(path: &Path) -> (Vec<PathBuf>, usize) {
impl Application for PreviewApp {
type Message = Message;
- fn new(_qh: &QueueHandle<EngineState<Self>>, sender: calloop::channel::Sender<Self::Message>) -> Self {
+ fn create(sender: cce_ui::engine::AppSender<Self::Message>) -> Self {
+ // The app keeps calloop's sender; `AppSender` converts into it.
+ let sender: calloop::channel::Sender<Self::Message> = sender.into();
let mut app = Self {
store: PageStore::new(sender),
doc: None,