settings: define 'inertial_scrolling' setting (default true)

This commit is contained in:
Mike Dilger 2023-09-24 20:10:38 +13:00
parent 15c4e572d4
commit e5463a1d72
3 changed files with 8 additions and 0 deletions

View File

@ -86,6 +86,7 @@ pub struct Settings {
pub posting_area_at_top: bool,
pub status_bar: bool,
pub image_resize_algorithm: String,
pub inertial_scrolling: bool,
// Staletime settings
pub relay_list_becomes_stale_hours: u64,
@ -157,6 +158,7 @@ impl Default for Settings {
posting_area_at_top: default_setting!(posting_area_at_top),
status_bar: default_setting!(status_bar),
image_resize_algorithm: default_setting!(image_resize_algorithm),
inertial_scrolling: default_setting!(inertial_scrolling),
relay_list_becomes_stale_hours: default_setting!(relay_list_becomes_stale_hours),
metadata_becomes_stale_hours: default_setting!(metadata_becomes_stale_hours),
nip05_becomes_stale_if_valid_hours: default_setting!(
@ -232,6 +234,7 @@ impl Settings {
posting_area_at_top: load_setting!(posting_area_at_top),
status_bar: load_setting!(status_bar),
image_resize_algorithm: load_setting!(image_resize_algorithm),
inertial_scrolling: load_setting!(inertial_scrolling),
relay_list_becomes_stale_hours: load_setting!(relay_list_becomes_stale_hours),
metadata_becomes_stale_hours: load_setting!(metadata_becomes_stale_hours),
nip05_becomes_stale_if_valid_hours: load_setting!(nip05_becomes_stale_if_valid_hours),
@ -303,6 +306,7 @@ impl Settings {
save_setting!(posting_area_at_top, self, txn);
save_setting!(status_bar, self, txn);
save_setting!(image_resize_algorithm, self, txn);
save_setting!(inertial_scrolling, self, txn);
save_setting!(relay_list_becomes_stale_hours, self, txn);
save_setting!(metadata_becomes_stale_hours, self, txn);
save_setting!(nip05_becomes_stale_if_valid_hours, self, txn);

View File

@ -671,6 +671,7 @@ impl Storage {
String,
"CatmullRom".to_owned()
);
def_setting!(inertial_scrolling, b"inertial_scrolling", bool, true);
def_setting!(
relay_list_becomes_stale_hours,
b"relay_list_becomes_stale_hours",

View File

@ -75,4 +75,7 @@ pub(super) fn update(app: &mut GossipUi, ctx: &Context, _frame: &mut eframe::Fra
&mut app.settings.status_bar,
"Show DEBUG statistics in sidebar",
);
ui.add_space(20.0);
ui.checkbox(&mut app.settings.inertial_scrolling, "Inertial Scrolling");
}