Skip to content

Commit 319b1c3

Browse files
committed
Move reverse_fn_order into ViewConfig
1 parent 634e007 commit 319b1c3

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

src/app.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ pub struct ViewConfig {
6767
pub ui_font: FontId,
6868
pub code_font: FontId,
6969
pub diff_colors: Vec<Color32>,
70+
pub reverse_fn_order: bool,
7071
}
7172

7273
impl Default for ViewConfig {
@@ -75,6 +76,7 @@ impl Default for ViewConfig {
7576
ui_font: FontId { size: 12.0, family: FontFamily::Proportional },
7677
code_font: FontId { size: 14.0, family: FontFamily::Monospace },
7778
diff_colors: DEFAULT_COLOR_ROTATION.to_vec(),
79+
reverse_fn_order: false,
7880
}
7981
}
8082
}
@@ -113,7 +115,6 @@ pub struct ViewState {
113115
pub check_update: Option<Box<CheckUpdateResult>>,
114116
// Config
115117
pub diff_kind: DiffKind,
116-
pub reverse_fn_order: bool,
117118
pub view_config: ViewConfig,
118119
}
119120

@@ -133,7 +134,6 @@ impl Default for ViewState {
133134
utc_offset: UtcOffset::UTC,
134135
check_update: None,
135136
diff_kind: Default::default(),
136-
reverse_fn_order: false,
137137
view_config: Default::default(),
138138
}
139139
}

src/views/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,6 @@ pub fn config_ui(ui: &mut egui::Ui, config: &Arc<RwLock<AppConfig>>, view_state:
247247
}
248248
}
249249

250-
ui.checkbox(&mut view_state.reverse_fn_order, "Reverse function order (deferred)");
250+
ui.checkbox(&mut view_state.view_config.reverse_fn_order, "Reverse function order (deferred)");
251251
ui.separator();
252252
}

src/views/symbol_diff.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,6 @@ fn symbol_list_ui(
135135
highlighted_symbol: &mut Option<String>,
136136
selected_symbol: &mut Option<SymbolReference>,
137137
current_view: &mut View,
138-
reverse_function_order: bool,
139138
lower_search: &str,
140139
config: &ViewConfig,
141140
) {
@@ -164,7 +163,7 @@ fn symbol_list_ui(
164163
CollapsingHeader::new(format!("{} ({:x})", section.name, section.size))
165164
.default_open(true)
166165
.show(ui, |ui| {
167-
if section.kind == ObjSectionKind::Code && reverse_function_order {
166+
if section.kind == ObjSectionKind::Code && config.reverse_fn_order {
168167
for symbol in section.symbols.iter().rev() {
169168
if !symbol_matches_search(symbol, lower_search) {
170169
continue;
@@ -292,7 +291,6 @@ pub fn symbol_diff_ui(ui: &mut Ui, view_state: &mut ViewState) {
292291
highlighted_symbol,
293292
selected_symbol,
294293
current_view,
295-
view_state.reverse_fn_order,
296294
&lower_search,
297295
&view_state.view_config,
298296
);
@@ -312,7 +310,6 @@ pub fn symbol_diff_ui(ui: &mut Ui, view_state: &mut ViewState) {
312310
highlighted_symbol,
313311
selected_symbol,
314312
current_view,
315-
view_state.reverse_fn_order,
316313
&lower_search,
317314
&view_state.view_config,
318315
);

0 commit comments

Comments
 (0)