[niepce] thumbstripview: set an item height



commit a8f75321900d6051cd6b12ef14aadf98ec4567b5
Author: Hubert Figuière <hub figuiere net>
Date:   Mon May 23 22:08:29 2022 -0400

    thumbstripview: set an item height

 niepce-main/src/niepce/ui/thumb_strip_view.rs | 10 ++++++++++
 src/niepce/ui/filmstripcontroller.cpp         |  2 ++
 2 files changed, 12 insertions(+)
---
diff --git a/niepce-main/src/niepce/ui/thumb_strip_view.rs b/niepce-main/src/niepce/ui/thumb_strip_view.rs
index 4e65941..6e2360f 100644
--- a/niepce-main/src/niepce/ui/thumb_strip_view.rs
+++ b/niepce-main/src/niepce/ui/thumb_strip_view.rs
@@ -205,6 +205,16 @@ pub unsafe extern "C" fn npc_thumb_strip_view_new(
     )))
 }
 
+/// # Safety
+/// Use raw pointers
+#[no_mangle]
+pub unsafe extern "C" fn npc_thumb_strip_view_set_item_height(
+    stripview: &ThumbStripView,
+    height: i32,
+) {
+    stripview.set_item_height(height);
+}
+
 /// # Safety
 /// Use raw pointers
 #[no_mangle]
diff --git a/src/niepce/ui/filmstripcontroller.cpp b/src/niepce/ui/filmstripcontroller.cpp
index 7b5b9f9..3b12c70 100644
--- a/src/niepce/ui/filmstripcontroller.cpp
+++ b/src/niepce/ui/filmstripcontroller.cpp
@@ -43,6 +43,8 @@ Gtk::Widget * FilmStripController::buildWidget()
         ffi::npc_thumb_strip_view_new(
             GTK_TREE_MODEL(g_object_ref(m_store->gobjmm()->gobj()))),
         ffi::npc_thumb_strip_view_release);
+    // XXX this should be maybe automatically computed
+    ffi::npc_thumb_strip_view_set_item_height(m_thumb_strip_view.get(), 120);
     // We need to ref m_store since it's held by the RefPtr<>
     // and the ThumbStripView in Rust gets full ownership.
     m_thumbview = Gtk::manage(


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]