Code cleaning

This commit is contained in:
Fabrizio Iannetti 2023-09-10 11:01:05 +02:00
parent 6bc32790a1
commit 5788a8fffa
6 changed files with 185 additions and 144 deletions

227
Cargo.lock generated
View File

@ -70,6 +70,12 @@ version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "250f629c0161ad8107cf89319e990051fae62832fd343083bea452d93e2205fd"
[[package]]
name = "allocator-api2"
version = "0.2.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5"
[[package]]
name = "android-activity"
version = "0.4.1"
@ -485,7 +491,7 @@ dependencies = [
"cocoa-foundation",
"core-foundation",
"core-graphics",
"foreign-types",
"foreign-types 0.3.2",
"libc",
"objc",
]
@ -500,7 +506,7 @@ dependencies = [
"block",
"core-foundation",
"core-graphics-types",
"foreign-types",
"foreign-types 0.3.2",
"libc",
"objc",
]
@ -552,7 +558,7 @@ dependencies = [
"bitflags 1.3.2",
"core-foundation",
"core-graphics-types",
"foreign-types",
"foreign-types 0.3.2",
"libc",
]
@ -564,14 +570,15 @@ checksum = "3a68b68b3446082644c91ac778bf50cd4104bfb002b5a6a7c44cca5a2c70788b"
dependencies = [
"bitflags 1.3.2",
"core-foundation",
"foreign-types",
"foreign-types 0.3.2",
"libc",
]
[[package]]
name = "cosmic-text"
version = "0.8.0"
source = "git+https://github.com/hecrj/cosmic-text.git?rev=c3cd24dc972bb8fd55d016c81ac9fa637e0a4ada#c3cd24dc972bb8fd55d016c81ac9fa637e0a4ada"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b0b68966c2543609f8d92f9d33ac3b719b2a67529b0c6c0b3e025637b477eef9"
dependencies = [
"aliasable",
"fontdb",
@ -604,12 +611,12 @@ checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7"
[[package]]
name = "d3d12"
version = "0.6.0"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d8f0de2f5a8e7bd4a9eec0e3c781992a4ce1724f68aec7d7a3715344de8b39da"
checksum = "e16e44ab292b1dddfdaf7be62cfd8877df52f2f3fde5858d95bab606be259f20"
dependencies = [
"bitflags 1.3.2",
"libloading 0.7.4",
"bitflags 2.3.3",
"libloading 0.8.0",
"winapi",
]
@ -694,9 +701,9 @@ dependencies = [
[[package]]
name = "etagere"
version = "0.2.7"
version = "0.2.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6301151a318f367f392c31395beb1cfba5ccd9abc44d1db0db3a4b27b9601c89"
checksum = "fcf22f748754352918e082e0039335ee92454a5d62bcaf69b5e8daf5907d9644"
dependencies = [
"euclid",
"svg_fmt",
@ -764,7 +771,28 @@ version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1"
dependencies = [
"foreign-types-shared",
"foreign-types-shared 0.1.1",
]
[[package]]
name = "foreign-types"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d737d9aa519fb7b749cbc3b962edcf310a8dd1f4b67c91c4f83975dbdd17d965"
dependencies = [
"foreign-types-macros",
"foreign-types-shared 0.3.1",
]
[[package]]
name = "foreign-types-macros"
version = "0.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.24",
]
[[package]]
@ -773,6 +801,12 @@ version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b"
[[package]]
name = "foreign-types-shared"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b"
[[package]]
name = "futures"
version = "0.3.28"
@ -904,9 +938,9 @@ checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b"
[[package]]
name = "glow"
version = "0.12.2"
version = "0.12.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "807edf58b70c0b5b2181dd39fe1839dbdb3ba02645630dc5f753e23da307f762"
checksum = "ca0fe580e4b60a8ab24a868bc08e2f03cbcb20d3d676601fa909386713333728"
dependencies = [
"js-sys",
"slotmap",
@ -916,8 +950,8 @@ dependencies = [
[[package]]
name = "glyphon"
version = "0.2.0"
source = "git+https://github.com/hecrj/glyphon.git?rev=8324f20158a62f8520bad4ed09f6aa5552f8f2a6#8324f20158a62f8520bad4ed09f6aa5552f8f2a6"
version = "0.3.0"
source = "git+https://github.com/grovesNL/glyphon.git?rev=20f0f8fa80e0d0df4c63634ce9176fa489546ca9#20f0f8fa80e0d0df4c63634ce9176fa489546ca9"
dependencies = [
"cosmic-text",
"etagere",
@ -927,21 +961,21 @@ dependencies = [
[[package]]
name = "gpu-alloc"
version = "0.5.4"
version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "22beaafc29b38204457ea030f6fb7a84c9e4dd1b86e311ba0542533453d87f62"
checksum = "fbcd2dba93594b227a1f57ee09b8b9da8892c34d55aa332e034a228d0fe6a171"
dependencies = [
"bitflags 1.3.2",
"bitflags 2.3.3",
"gpu-alloc-types",
]
[[package]]
name = "gpu-alloc-types"
version = "0.2.0"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "54804d0d6bc9d7f26db4eaec1ad10def69b599315f487d32c334a80d1efe67a5"
checksum = "98ff03b468aa837d70984d55f5d3f846f6ec31fe34bbb97c4f85219caeee1ca4"
dependencies = [
"bitflags 1.3.2",
"bitflags 2.3.3",
]
[[package]]
@ -1008,11 +1042,12 @@ dependencies = [
[[package]]
name = "hashbrown"
version = "0.13.2"
version = "0.14.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e"
checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a"
dependencies = [
"ahash 0.8.3",
"allocator-api2",
]
[[package]]
@ -1094,7 +1129,7 @@ dependencies = [
[[package]]
name = "iced"
version = "0.9.0"
version = "0.12.0"
dependencies = [
"iced_core",
"iced_futures",
@ -1106,11 +1141,12 @@ dependencies = [
[[package]]
name = "iced_core"
version = "0.9.0"
version = "0.12.0"
dependencies = [
"bitflags 1.3.2",
"instant",
"log",
"num-traits",
"palette",
"thiserror",
"twox-hash",
@ -1118,7 +1154,7 @@ dependencies = [
[[package]]
name = "iced_futures"
version = "0.6.0"
version = "0.12.0"
dependencies = [
"futures",
"iced_core",
@ -1129,7 +1165,7 @@ dependencies = [
[[package]]
name = "iced_graphics"
version = "0.8.0"
version = "0.12.0"
dependencies = [
"bitflags 1.3.2",
"bytemuck",
@ -1143,7 +1179,7 @@ dependencies = [
[[package]]
name = "iced_renderer"
version = "0.1.0"
version = "0.12.0"
dependencies = [
"iced_graphics",
"iced_tiny_skia",
@ -1155,7 +1191,7 @@ dependencies = [
[[package]]
name = "iced_runtime"
version = "0.1.0"
version = "0.12.0"
dependencies = [
"iced_core",
"iced_futures",
@ -1164,7 +1200,7 @@ dependencies = [
[[package]]
name = "iced_style"
version = "0.8.0"
version = "0.12.0"
dependencies = [
"iced_core",
"once_cell",
@ -1173,7 +1209,7 @@ dependencies = [
[[package]]
name = "iced_tiny_skia"
version = "0.1.0"
version = "0.12.0"
dependencies = [
"bytemuck",
"cosmic-text",
@ -1183,13 +1219,13 @@ dependencies = [
"raw-window-handle",
"rustc-hash",
"softbuffer",
"tiny-skia 0.9.1",
"tiny-skia 0.10.0",
"twox-hash",
]
[[package]]
name = "iced_wgpu"
version = "0.10.0"
version = "0.12.0"
dependencies = [
"bitflags 1.3.2",
"bytemuck",
@ -1208,7 +1244,7 @@ dependencies = [
[[package]]
name = "iced_widget"
version = "0.1.0"
version = "0.12.0"
dependencies = [
"iced_renderer",
"iced_runtime",
@ -1220,7 +1256,7 @@ dependencies = [
[[package]]
name = "iced_winit"
version = "0.9.1"
version = "0.12.0"
dependencies = [
"iced_graphics",
"iced_runtime",
@ -1228,6 +1264,7 @@ dependencies = [
"log",
"raw-window-handle",
"thiserror",
"tracing",
"web-sys",
"winapi",
"window_clipboard",
@ -1304,9 +1341,9 @@ dependencies = [
[[package]]
name = "js-sys"
version = "0.3.63"
version = "0.3.64"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2f37a4a5928311ac501dee68b3c7613a1037d0edb30c8e5427bd832d55d1b790"
checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a"
dependencies = [
"wasm-bindgen",
]
@ -1399,11 +1436,11 @@ checksum = "518ef76f2f87365916b142844c16d8fefd85039bc5699050210a7778ee1cd1de"
[[package]]
name = "lru"
version = "0.9.0"
version = "0.11.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "71e7d46de488603ffdd5f30afbc64fbba2378214a2c3a2fb83abf3d33126df17"
checksum = "a4a83fb7698b3643a0e34f9ae6f2e8f0178c0fd42f8b59d493aa271ff3a5bf21"
dependencies = [
"hashbrown 0.13.2",
"hashbrown 0.14.0",
]
[[package]]
@ -1473,16 +1510,17 @@ dependencies = [
[[package]]
name = "metal"
version = "0.24.0"
version = "0.26.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "de11355d1f6781482d027a3b4d4de7825dcedb197bf573e0596d00008402d060"
checksum = "623b5e6cefd76e58f774bd3cc0c6f5c7615c58c03a97815245a25c3c9bdee318"
dependencies = [
"bitflags 1.3.2",
"bitflags 2.3.3",
"block",
"core-graphics-types",
"foreign-types",
"foreign-types 0.5.0",
"log",
"objc",
"paste",
]
[[package]]
@ -1524,12 +1562,12 @@ dependencies = [
[[package]]
name = "naga"
version = "0.12.2"
version = "0.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "80cd00bd6180a8790f1c020ed258a46b8d73dd5bd6af104a238c9d71f806938e"
checksum = "c1ceaaa4eedaece7e4ec08c55c640ba03dbb73fb812a6570a59bcf1930d0f70e"
dependencies = [
"bit-set",
"bitflags 1.3.2",
"bitflags 2.3.3",
"codespan-reporting",
"hexf-parse",
"indexmap",
@ -1848,6 +1886,12 @@ dependencies = [
"windows-sys 0.45.0",
]
[[package]]
name = "paste"
version = "1.0.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c"
[[package]]
name = "peeking_take_while"
version = "0.1.2"
@ -2241,7 +2285,7 @@ dependencies = [
"cocoa",
"core-graphics",
"fastrand",
"foreign-types",
"foreign-types 0.3.2",
"log",
"nix 0.26.2",
"objc",
@ -2396,9 +2440,9 @@ dependencies = [
[[package]]
name = "tiny-skia"
version = "0.9.1"
version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ce2986c82f77818c7b9144c70818fdde98db15308e329ae2f7204d767808fd3c"
checksum = "7db11798945fa5c3e5490c794ccca7c6de86d3afdd54b4eb324109939c6f37bc"
dependencies = [
"arrayref",
"arrayvec",
@ -2406,7 +2450,7 @@ dependencies = [
"cfg-if",
"log",
"png",
"tiny-skia-path 0.9.0",
"tiny-skia-path 0.10.0",
]
[[package]]
@ -2422,9 +2466,9 @@ dependencies = [
[[package]]
name = "tiny-skia-path"
version = "0.9.0"
version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f7acb0ccda1ac91084353a56d0b69b0e29c311fd809d2088b1ed2f9ae1841c47"
checksum = "2f60aa35c89ac2687ace1a2556eaaea68e8c0d47408a2e3e7f5c98a489e7281c"
dependencies = [
"arrayref",
"bytemuck",
@ -2463,6 +2507,38 @@ dependencies = [
"winnow",
]
[[package]]
name = "tracing"
version = "0.1.37"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8"
dependencies = [
"cfg-if",
"pin-project-lite",
"tracing-attributes",
"tracing-core",
]
[[package]]
name = "tracing-attributes"
version = "0.1.26"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.24",
]
[[package]]
name = "tracing-core"
version = "0.1.31"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a"
dependencies = [
"once_cell",
]
[[package]]
name = "ttf-parser"
version = "0.19.0"
@ -2585,9 +2661,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
[[package]]
name = "wasm-bindgen"
version = "0.2.86"
version = "0.2.87"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5bba0e8cb82ba49ff4e229459ff22a191bbe9a1cb3a341610c9c33efc27ddf73"
checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342"
dependencies = [
"cfg-if",
"wasm-bindgen-macro",
@ -2595,9 +2671,9 @@ dependencies = [
[[package]]
name = "wasm-bindgen-backend"
version = "0.2.86"
version = "0.2.87"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "19b04bc93f9d6bdee709f6bd2118f57dd6679cf1176a1af464fca3ab0d66d8fb"
checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd"
dependencies = [
"bumpalo",
"log",
@ -2622,9 +2698,9 @@ dependencies = [
[[package]]
name = "wasm-bindgen-macro"
version = "0.2.86"
version = "0.2.87"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "14d6b024f1a526bb0234f52840389927257beb670610081360e5a03c5df9c258"
checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d"
dependencies = [
"quote",
"wasm-bindgen-macro-support",
@ -2632,9 +2708,9 @@ dependencies = [
[[package]]
name = "wasm-bindgen-macro-support"
version = "0.2.86"
version = "0.2.87"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e128beba882dd1eb6200e1dc92ae6c5dbaa4311aa7bb211ca035779e5efc39f8"
checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b"
dependencies = [
"proc-macro2",
"quote",
@ -2645,9 +2721,9 @@ dependencies = [
[[package]]
name = "wasm-bindgen-shared"
version = "0.2.86"
version = "0.2.87"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ed9d5b4305409d1fc9482fee2d7f9bcbf24b3972bf59817ef757e23982242a93"
checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1"
[[package]]
name = "wasm-timer"
@ -2789,9 +2865,9 @@ dependencies = [
[[package]]
name = "web-sys"
version = "0.3.63"
version = "0.3.64"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3bdd9ef4e984da1187bf8110c5cf5b845fbc87a23602cdf912386a76fcd3a7c2"
checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b"
dependencies = [
"js-sys",
"wasm-bindgen",
@ -2799,9 +2875,9 @@ dependencies = [
[[package]]
name = "wgpu"
version = "0.16.1"
version = "0.17.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3059ea4ddec41ca14f356833e2af65e7e38c0a8f91273867ed526fb9bafcca95"
checksum = "7472f3b69449a8ae073f6ec41d05b6f846902d92a6c45313c50cb25857b736ce"
dependencies = [
"arrayvec",
"cfg-if",
@ -2823,9 +2899,9 @@ dependencies = [
[[package]]
name = "wgpu-core"
version = "0.16.1"
version = "0.17.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8f478237b4bf0d5b70a39898a66fa67ca3a007d79f2520485b8b0c3dfc46f8c2"
checksum = "ecf7454d9386f602f7399225c92dd2fbdcde52c519bc8fb0bd6fbeb388075dc2"
dependencies = [
"arrayvec",
"bit-vec",
@ -2846,9 +2922,9 @@ dependencies = [
[[package]]
name = "wgpu-hal"
version = "0.16.1"
version = "0.17.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "74851c2c8e5d97652e74c241d41b0656b31c924a45dcdecde83975717362cfa4"
checksum = "6654a13885a17f475e8324efb46dc6986d7aaaa98353330f8de2077b153d0101"
dependencies = [
"android_system_properties",
"arrayvec",
@ -2858,7 +2934,6 @@ dependencies = [
"block",
"core-graphics-types",
"d3d12",
"foreign-types",
"glow",
"gpu-alloc",
"gpu-allocator",
@ -2888,9 +2963,9 @@ dependencies = [
[[package]]
name = "wgpu-types"
version = "0.16.0"
version = "0.17.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5bd33a976130f03dcdcd39b3810c0c3fc05daf86f0aaf867db14bfb7c4a9a32b"
checksum = "ee64d7398d0c2f9ca48922c902ef69c42d000c759f3db41e355f4a570b052b67"
dependencies = [
"bitflags 2.3.3",
"js-sys",

View File

@ -21,6 +21,15 @@ fn setup_tracepoints() {
// drawing events
draw_class.instantiate("draw_entry");
draw_class.instantiate("draw_exit");
draw_class.instantiate("draw_days_entry");
draw_class.instantiate("draw_days_exit");
// class for application events
let app_class = provider.create_class("app");
// application events
app_class.instantiate("view_entry");
app_class.instantiate("view_exit");
Generator::default()
.generated_lib_name("calendar_tracepoints")

View File

@ -28,6 +28,18 @@ use iced::widget::{
//use iced::button;
use iced::theme;
#[cfg(feature = "tracing")]
extern crate lttng_ust;
#[cfg(feature = "tracing")]
use lttng_ust::import_tracepoints;
#[cfg(feature = "tracing")]
import_tracepoints!(
concat!(env!("OUT_DIR"), "/tracepoints.rs"),
tracepoints
);
struct CalendarFlags {
calendar_paths: std::vec::Vec<path::PathBuf>,
}
@ -171,6 +183,8 @@ impl Application for CalendarApp {
}
fn view(&self) -> Element<Message> {
#[cfg(feature = "tracing")]
tracepoints::calendar::view_entry();
const MONTH_NAMES: [&str;12] = [
"gennaio",
"febbraio",
@ -195,11 +209,16 @@ impl Application for CalendarApp {
Some(ViewMode::Month) | None => content = content.push(CalendarMonthView::new(&CalendarParams::new(), self.month, &self.events)),
};
Container::new(content)
let container = Container::new(content)
.width(Length::Fill)
.height(Length::Fill)
.center_x()
.center_y()
.into()
.into();
#[cfg(feature = "tracing")]
tracepoints::calendar::view_exit();
container
}
}

View File

@ -1,3 +1,2 @@
pub mod calendar;
pub mod basics;
pub mod list;

View File

@ -98,6 +98,8 @@ fn render_events_in_row(
if num_days < 1 {
return
}
#[cfg(feature = "tracing")]
tracepoints::calendar::draw_days_entry(row_bounds.width as i32, row_bounds.height as i32);
#[derive(Debug)]
struct EventBar<'a> {
@ -175,6 +177,8 @@ fn render_events_in_row(
ev_y += ev_height
}
}
#[cfg(feature = "tracing")]
tracepoints::calendar::draw_days_exit(row_bounds.width as i32, row_bounds.height as i32);
}
//-------------------------------------------------------------------------

View File

@ -1,65 +0,0 @@
trait ListContentProvider<Item> {
/// Get the number of items provided
fn get_count(&self) -> i64;
fn get_item(&self, index: i64) -> Item;
}
trait ListLabelProvider<Item> {
fn get_label(&self, item: &Item) -> str;
}
trait CellRenderer {
fn new() -> Self;
/// Get the height of a single cell
fn height(&self) -> i64;
}
struct ListView<'a, Item, R: CellRenderer> {
content_provider: &'a dyn ListContentProvider<Item>,
label_provider: &'a dyn ListLabelProvider<Item>,
cell_renderer: R,
x: i64,
}
/// A ListView is responsible for:
/// - get number of objects from the content provider
/// - manage the range of visible objects
/// - retrieve objects to be rendered from the content provider
///
impl<'a, Item, R: CellRenderer> ListView<'a, Item, R> {
pub fn new(content_provider: &'a dyn ListContentProvider<Item>, label_provider: &'a dyn ListLabelProvider<Item>) -> Self {
ListView::<'a, Item, R> {
content_provider,
label_provider,
cell_renderer: CellRenderer::new(),
x: 0,
}
}
pub fn refresh(&mut self) {
let list_height = self.content_provider.get_count() * self.cell_renderer.height();
if self.x > list_height {
self.x = list_height;
}
}
pub fn top_item(&self) -> Item {
let index = self.x / self.cell_renderer.height();
self.content_provider.get_item(index)
}
/// move the viewport on the list by the given amount
pub fn move_by(&mut self, delta: i64) {
self.x += delta;
self.refresh();
}
}