Change the option 'Scroll mode' to be 'Reverse mouse wheel'

Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
fufesou
2023-09-10 18:31:16 +08:00
parent 558567d399
commit f1d5afe72a
42 changed files with 116 additions and 265 deletions

View File

@@ -1195,14 +1195,14 @@ impl LoginConfigHandler {
self.save_config(config);
}
/// Save mouse scroll mode("default", "reverse") to the current config.
/// Save reverse mouse wheel ("", "Y") to the current config.
///
/// # Arguments
///
/// * `value` - The view style to be saved.
pub fn save_scroll_mode(&mut self, value: String) {
/// * `value` - The reverse mouse wheel ("", "Y").
pub fn save_reverse_mouse_wheel(&mut self, value: String) {
let mut config = self.load_config();
config.scroll_mode = value;
config.reverse_mouse_wheel = value;
self.save_config(config);
}

View File

@@ -300,17 +300,17 @@ pub fn session_set_keyboard_mode(session_id: SessionID, value: String) {
}
}
pub fn session_get_scroll_mode(session_id: SessionID) -> Option<String> {
pub fn session_get_reverse_mouse_wheel(session_id: SessionID) -> Option<String> {
if let Some(session) = SESSIONS.read().unwrap().get(&session_id) {
Some(session.get_scroll_mode())
Some(session.get_reverse_mouse_wheel())
} else {
None
}
}
pub fn session_set_scroll_mode(session_id: SessionID, value: String) {
pub fn session_set_reverse_mouse_wheel(session_id: SessionID, value: String) {
if let Some(session) = SESSIONS.write().unwrap().get_mut(&session_id) {
session.save_scroll_mode(value);
session.save_reverse_mouse_wheel(value);
}
}

View File

@@ -543,9 +543,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("HSV Color", ""),
("Installation Successful!", ""),
("Installation failed!", ""),
("Input", ""),
("Default Scroll Mode", ""),
("Default mode", ""),
("Reverse mode", ""),
("Reverse mouse wheel", ""),
].iter().cloned().collect();
}

View File

@@ -543,9 +543,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("HSV Color", ""),
("Installation Successful!", ""),
("Installation failed!", ""),
("Input", ""),
("Default Scroll Mode", ""),
("Default mode", ""),
("Reverse mode", ""),
("Reverse mouse wheel", ""),
].iter().cloned().collect();
}

View File

@@ -543,9 +543,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("HSV Color", "HSV 色"),
("Installation Successful!", "安装成功!"),
("Installation failed!", "安装失败!"),
("Input", "输入"),
("Default Scroll Mode", "默认滚动模式"),
("Default mode", "默认模式"),
("Reverse mode", "反向模式"),
("Reverse mouse wheel", "鼠标滚轮反向"),
].iter().cloned().collect();
}

View File

@@ -543,9 +543,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("HSV Color", ""),
("Installation Successful!", ""),
("Installation failed!", ""),
("Input", ""),
("Default Scroll Mode", ""),
("Default mode", ""),
("Reverse mode", ""),
("Reverse mouse wheel", ""),
].iter().cloned().collect();
}

View File

@@ -543,9 +543,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("HSV Color", ""),
("Installation Successful!", ""),
("Installation failed!", ""),
("Input", ""),
("Default Scroll Mode", ""),
("Default mode", ""),
("Reverse mode", ""),
("Reverse mouse wheel", ""),
].iter().cloned().collect();
}

View File

@@ -543,9 +543,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("HSV Color", "HSV-Farbe"),
("Installation Successful!", "Installation erfolgreich!"),
("Installation failed!", "Installation fehlgeschlagen!"),
("Input", ""),
("Default Scroll Mode", ""),
("Default mode", ""),
("Reverse mode", ""),
("Reverse mouse wheel", ""),
].iter().cloned().collect();
}

View File

@@ -543,9 +543,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("HSV Color", ""),
("Installation Successful!", ""),
("Installation failed!", ""),
("Input", ""),
("Default Scroll Mode", ""),
("Default mode", ""),
("Reverse mode", ""),
("Reverse mouse wheel", ""),
].iter().cloned().collect();
}

View File

@@ -77,5 +77,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("pull_ab_failed_tip", "Failed to refresh address book"),
("push_ab_failed_tip", "Failed to sync address book to server"),
("synced_peer_readded_tip", "The devices that were present in the recent sessions will be synchronized back to the address book."),
("View Mode", "View mode"),
].iter().cloned().collect();
}

View File

@@ -543,9 +543,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("HSV Color", ""),
("Installation Successful!", ""),
("Installation failed!", ""),
("Input", ""),
("Default Scroll Mode", ""),
("Default mode", ""),
("Reverse mode", ""),
("Reverse mouse wheel", ""),
].iter().cloned().collect();
}

View File

@@ -543,9 +543,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("HSV Color", "Color HSV"),
("Installation Successful!", ""),
("Installation failed!", ""),
("Input", ""),
("Default Scroll Mode", ""),
("Default mode", ""),
("Reverse mode", ""),
("Reverse mouse wheel", ""),
].iter().cloned().collect();
}

View File

@@ -543,9 +543,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("HSV Color", ""),
("Installation Successful!", ""),
("Installation failed!", ""),
("Input", ""),
("Default Scroll Mode", ""),
("Default mode", ""),
("Reverse mode", ""),
("Reverse mouse wheel", ""),
].iter().cloned().collect();
}

View File

@@ -543,9 +543,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("HSV Color", "Couleur TSL"),
("Installation Successful!", ""),
("Installation failed!", ""),
("Input", ""),
("Default Scroll Mode", ""),
("Default mode", ""),
("Reverse mode", ""),
("Reverse mouse wheel", ""),
].iter().cloned().collect();
}

View File

@@ -543,9 +543,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("HSV Color", ""),
("Installation Successful!", ""),
("Installation failed!", ""),
("Input", ""),
("Default Scroll Mode", ""),
("Default mode", ""),
("Reverse mode", ""),
("Reverse mouse wheel", ""),
].iter().cloned().collect();
}

View File

@@ -543,9 +543,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("HSV Color", "Warna HSV"),
("Installation Successful!", ""),
("Installation failed!", ""),
("Input", ""),
("Default Scroll Mode", ""),
("Default mode", ""),
("Reverse mode", ""),
("Reverse mouse wheel", ""),
].iter().cloned().collect();
}

View File

@@ -543,9 +543,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("HSV Color", "Colore HSV"),
("Installation Successful!", "Installazione completata"),
("Installation failed!", "Installazione fallita"),
("Input", ""),
("Default Scroll Mode", ""),
("Default mode", ""),
("Reverse mode", ""),
("Reverse mouse wheel", ""),
].iter().cloned().collect();
}

View File

@@ -543,9 +543,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("HSV Color", ""),
("Installation Successful!", ""),
("Installation failed!", ""),
("Input", ""),
("Default Scroll Mode", ""),
("Default mode", ""),
("Reverse mode", ""),
("Reverse mouse wheel", ""),
].iter().cloned().collect();
}

View File

@@ -543,9 +543,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("HSV Color", ""),
("Installation Successful!", ""),
("Installation failed!", ""),
("Input", ""),
("Default Scroll Mode", ""),
("Default mode", ""),
("Reverse mode", ""),
("Reverse mouse wheel", ""),
].iter().cloned().collect();
}

View File

@@ -543,9 +543,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("HSV Color", ""),
("Installation Successful!", ""),
("Installation failed!", ""),
("Input", ""),
("Default Scroll Mode", ""),
("Default mode", ""),
("Reverse mode", ""),
("Reverse mouse wheel", ""),
].iter().cloned().collect();
}

View File

@@ -543,9 +543,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("HSV Color", ""),
("Installation Successful!", ""),
("Installation failed!", ""),
("Input", ""),
("Default Scroll Mode", ""),
("Default mode", ""),
("Reverse mode", ""),
("Reverse mouse wheel", ""),
].iter().cloned().collect();
}

View File

@@ -543,9 +543,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("HSV Color", "HSV Kleur"),
("Installation Successful!", ""),
("Installation failed!", ""),
("Input", ""),
("Default Scroll Mode", ""),
("Default mode", ""),
("Reverse mode", ""),
("Reverse mouse wheel", ""),
].iter().cloned().collect();
}

View File

@@ -543,9 +543,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("HSV Color", ""),
("Installation Successful!", ""),
("Installation failed!", ""),
("Input", ""),
("Default Scroll Mode", ""),
("Default mode", ""),
("Reverse mode", ""),
("Reverse mouse wheel", ""),
].iter().cloned().collect();
}

View File

@@ -543,9 +543,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("HSV Color", ""),
("Installation Successful!", ""),
("Installation failed!", ""),
("Input", ""),
("Default Scroll Mode", ""),
("Default mode", ""),
("Reverse mode", ""),
("Reverse mouse wheel", ""),
].iter().cloned().collect();
}

View File

@@ -543,9 +543,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("HSV Color", ""),
("Installation Successful!", ""),
("Installation failed!", ""),
("Input", ""),
("Default Scroll Mode", ""),
("Default mode", ""),
("Reverse mode", ""),
("Reverse mouse wheel", ""),
].iter().cloned().collect();
}

View File

@@ -543,9 +543,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("HSV Color", ""),
("Installation Successful!", ""),
("Installation failed!", ""),
("Input", ""),
("Default Scroll Mode", ""),
("Default mode", ""),
("Reverse mode", ""),
("Reverse mouse wheel", ""),
].iter().cloned().collect();
}

View File

@@ -543,9 +543,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("HSV Color", "Цвет HSV"),
("Installation Successful!", "Установка выполнена успешно!"),
("Installation failed!", "Установка не выполнена!"),
("Input", ""),
("Default Scroll Mode", ""),
("Default mode", ""),
("Reverse mode", ""),
("Reverse mouse wheel", ""),
].iter().cloned().collect();
}

View File

@@ -543,9 +543,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("HSV Color", ""),
("Installation Successful!", ""),
("Installation failed!", ""),
("Input", ""),
("Default Scroll Mode", ""),
("Default mode", ""),
("Reverse mode", ""),
("Reverse mouse wheel", ""),
].iter().cloned().collect();
}

View File

@@ -543,9 +543,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("HSV Color", ""),
("Installation Successful!", ""),
("Installation failed!", ""),
("Input", ""),
("Default Scroll Mode", ""),
("Default mode", ""),
("Reverse mode", ""),
("Reverse mouse wheel", ""),
].iter().cloned().collect();
}

View File

@@ -543,9 +543,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("HSV Color", ""),
("Installation Successful!", ""),
("Installation failed!", ""),
("Input", ""),
("Default Scroll Mode", ""),
("Default mode", ""),
("Reverse mode", ""),
("Reverse mouse wheel", ""),
].iter().cloned().collect();
}

View File

@@ -543,9 +543,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("HSV Color", ""),
("Installation Successful!", ""),
("Installation failed!", ""),
("Input", ""),
("Default Scroll Mode", ""),
("Default mode", ""),
("Reverse mode", ""),
("Reverse mouse wheel", ""),
].iter().cloned().collect();
}

View File

@@ -543,9 +543,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("HSV Color", ""),
("Installation Successful!", ""),
("Installation failed!", ""),
("Input", ""),
("Default Scroll Mode", ""),
("Default mode", ""),
("Reverse mode", ""),
("Reverse mouse wheel", ""),
].iter().cloned().collect();
}

View File

@@ -543,9 +543,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("HSV Color", ""),
("Installation Successful!", ""),
("Installation failed!", ""),
("Input", ""),
("Default Scroll Mode", ""),
("Default mode", ""),
("Reverse mode", ""),
("Reverse mouse wheel", ""),
].iter().cloned().collect();
}

View File

@@ -543,9 +543,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("HSV Color", ""),
("Installation Successful!", ""),
("Installation failed!", ""),
("Input", ""),
("Default Scroll Mode", ""),
("Default mode", ""),
("Reverse mode", ""),
("Reverse mouse wheel", ""),
].iter().cloned().collect();
}

View File

@@ -543,9 +543,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("HSV Color", "HSV Rengi"),
("Installation Successful!", ""),
("Installation failed!", ""),
("Input", ""),
("Default Scroll Mode", ""),
("Default mode", ""),
("Reverse mode", ""),
("Reverse mouse wheel", ""),
].iter().cloned().collect();
}

View File

@@ -543,9 +543,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("HSV Color", "HSV 色"),
("Installation Successful!", ""),
("Installation failed!", ""),
("Input", ""),
("Default Scroll Mode", ""),
("Default mode", ""),
("Reverse mode", ""),
("Reverse mouse wheel", ""),
].iter().cloned().collect();
}

View File

@@ -543,9 +543,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("HSV Color", ""),
("Installation Successful!", ""),
("Installation failed!", ""),
("Input", ""),
("Default Scroll Mode", ""),
("Default mode", ""),
("Reverse mode", ""),
("Reverse mouse wheel", ""),
].iter().cloned().collect();
}

View File

@@ -543,9 +543,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("HSV Color", ""),
("Installation Successful!", ""),
("Installation failed!", ""),
("Input", ""),
("Default Scroll Mode", ""),
("Default mode", ""),
("Reverse mode", ""),
("Reverse mouse wheel", ""),
].iter().cloned().collect();
}

View File

@@ -175,12 +175,12 @@ impl<T: InvokeUiSession> Session<T> {
self.lc.write().unwrap().save_keyboard_mode(value);
}
pub fn get_scroll_mode(&self) -> String {
self.lc.read().unwrap().scroll_mode.clone()
pub fn get_reverse_mouse_wheel(&self) -> String {
self.lc.read().unwrap().reverse_mouse_wheel.clone()
}
pub fn save_scroll_mode(&mut self, value: String) {
self.lc.write().unwrap().save_scroll_mode(value);
pub fn save_reverse_mouse_wheel(&mut self, value: String) {
self.lc.write().unwrap().save_reverse_mouse_wheel(value);
}
pub fn save_view_style(&mut self, value: String) {
@@ -765,7 +765,7 @@ impl<T: InvokeUiSession> Session<T> {
#[inline]
#[cfg(not(any(target_os = "android", target_os = "ios")))]
fn is_scroll_reverse_mode(&self) -> bool {
self.lc.read().unwrap().scroll_mode.eq("reverse")
self.lc.read().unwrap().reverse_mouse_wheel.eq("Y")
}
#[inline]