feat: keep track of window size and position
This commit is contained in:
@@ -229,6 +229,8 @@ impl Default for EndpointConfig {
|
||||
pub struct InterfaceConfig {
|
||||
pub sidebar_collapsed: bool,
|
||||
pub sidebar_width: i32,
|
||||
pub window_size: [u32; 2],
|
||||
pub window_position: Option<[i32; 2]>,
|
||||
/// Project the app reopens on. Cleared when that project goes away.
|
||||
pub last_project_id: Option<i32>,
|
||||
}
|
||||
@@ -238,6 +240,8 @@ impl Default for InterfaceConfig {
|
||||
Self {
|
||||
sidebar_collapsed: false,
|
||||
sidebar_width: 276,
|
||||
window_size: [1120, 720],
|
||||
window_position: None,
|
||||
last_project_id: None,
|
||||
}
|
||||
}
|
||||
@@ -348,6 +352,11 @@ mod tests {
|
||||
whitespace: GitDiffWhitespace::IgnoreEndOfLine,
|
||||
..GitConfig::default()
|
||||
},
|
||||
interface: InterfaceConfig {
|
||||
window_size: [1280, 800],
|
||||
window_position: Some([120, -40]),
|
||||
..InterfaceConfig::default()
|
||||
},
|
||||
..Config::default()
|
||||
};
|
||||
config.save(&path).unwrap();
|
||||
@@ -358,7 +367,8 @@ mod tests {
|
||||
"model: glm-5.2\ndefault_permission_mode: ai\na2ui_enabled: false\n\
|
||||
generation:\n context_tokens: 65536\n reasoning_mode: none\n\
|
||||
runtime:\n ssd:\n enabled: true\n cache: 64GB\n\
|
||||
git:\n diff_layout: split\n diff_algorithm: patience\n context_lines: 5\n whitespace: ignore-end-of-line\n"
|
||||
git:\n diff_layout: split\n diff_algorithm: patience\n context_lines: 5\n whitespace: ignore-end-of-line\n\
|
||||
interface:\n window_size:\n - 1280\n - 800\n window_position:\n - 120\n - -40\n"
|
||||
);
|
||||
assert_eq!(Config::load(&path).unwrap(), config);
|
||||
fs::remove_dir_all(&directory).unwrap();
|
||||
|
||||
Reference in New Issue
Block a user