Skip to content

Commit c68edf8

Browse files
committed
Show row count in all dialog views via TableView title
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>"
1 parent 1e7e1ac commit c68edf8

File tree

6 files changed

+28
-56
lines changed

6 files changed

+28
-56
lines changed

src/view/providers/asynchronous_inserts.rs

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use crate::{
55
use cursive::{
66
Cursive,
77
view::{Nameable, Resizable},
8-
views::{Dialog, DummyView, LinearLayout, TextView},
8+
views::Dialog,
99
};
1010
use std::collections::HashMap;
1111

@@ -189,16 +189,12 @@ pub fn show_asynchronous_inserts_dialog(
189189
.unwrap_or_else(|_| panic!("Cannot create {}", view_name));
190190

191191
sql_view.get_inner_mut().set_on_submit(show_insert_details);
192-
193-
let title = filters.build_title(true);
192+
sql_view
193+
.get_inner_mut()
194+
.set_title(filters.build_title(true));
194195

195196
siv.add_layer(
196-
Dialog::around(
197-
LinearLayout::vertical()
198-
.child(TextView::new(title).center())
199-
.child(DummyView.fixed_height(1))
200-
.child(sql_view.with_name(view_name).min_size((140, 30))),
201-
)
202-
.title("Asynchronous Inserts"),
197+
Dialog::around(sql_view.with_name(view_name).min_size((140, 30)))
198+
.title("Asynchronous Inserts"),
203199
);
204200
}

src/view/providers/background_schedule_pool_log.rs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -274,16 +274,12 @@ pub fn show_background_schedule_pool_log_dialog(
274274
.unwrap_or_else(|_| panic!("Cannot create {}", view_name));
275275

276276
sql_view.get_inner_mut().set_on_submit(show_task_logs);
277-
278-
let title = filters.build_title(true);
277+
sql_view
278+
.get_inner_mut()
279+
.set_title(filters.build_title(true));
279280

280281
siv.add_layer(
281-
Dialog::around(
282-
LinearLayout::vertical()
283-
.child(TextView::new(title).center())
284-
.child(DummyView.fixed_height(1))
285-
.child(sql_view.with_name(view_name).min_size((140, 30))),
286-
)
287-
.title("Background Schedule Pool Logs"),
282+
Dialog::around(sql_view.with_name(view_name).min_size((140, 30)))
283+
.title("Background Schedule Pool Logs"),
288284
);
289285
}

src/view/providers/merges.rs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -199,16 +199,11 @@ pub fn show_merges_dialog(
199199
sql_view
200200
.get_inner_mut()
201201
.set_on_submit(get_merges_logs_callback());
202-
203-
let title = filters.build_title(true);
202+
sql_view
203+
.get_inner_mut()
204+
.set_title(filters.build_title(true));
204205

205206
siv.add_layer(
206-
Dialog::around(
207-
LinearLayout::vertical()
208-
.child(TextView::new(title).center())
209-
.child(DummyView.fixed_height(1))
210-
.child(sql_view.with_name(view_name).min_size((140, 30))),
211-
)
212-
.title("Merges"),
207+
Dialog::around(sql_view.with_name(view_name).min_size((140, 30))).title("Merges"),
213208
);
214209
}

src/view/providers/mutations.rs

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use crate::{
55
use cursive::{
66
Cursive,
77
view::{Nameable, Resizable},
8-
views::{Dialog, DummyView, LinearLayout, TextView},
8+
views::Dialog,
99
};
1010

1111
pub struct MutationsViewProvider;
@@ -145,16 +145,11 @@ pub fn show_mutations_dialog(
145145
sql_view
146146
.get_inner_mut()
147147
.set_on_submit(super::query_result_show_row);
148-
149-
let title = filters.build_title(true);
148+
sql_view
149+
.get_inner_mut()
150+
.set_title(filters.build_title(true));
150151

151152
siv.add_layer(
152-
Dialog::around(
153-
LinearLayout::vertical()
154-
.child(TextView::new(title).center())
155-
.child(DummyView.fixed_height(1))
156-
.child(sql_view.with_name(view_name).min_size((140, 30))),
157-
)
158-
.title("Mutations"),
153+
Dialog::around(sql_view.with_name(view_name).min_size((140, 30))).title("Mutations"),
159154
);
160155
}

src/view/providers/part_log.rs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -361,16 +361,11 @@ pub fn show_part_log_dialog(
361361
sql_view
362362
.get_inner_mut()
363363
.set_on_submit(part_log_action_callback);
364-
365-
let title = filters.build_title(true);
364+
sql_view
365+
.get_inner_mut()
366+
.set_title(filters.build_title(true));
366367

367368
siv.add_layer(
368-
Dialog::around(
369-
LinearLayout::vertical()
370-
.child(TextView::new(title).center())
371-
.child(DummyView.fixed_height(1))
372-
.child(sql_view.with_name(view_name).min_size((140, 30))),
373-
)
374-
.title("Part Log"),
369+
Dialog::around(sql_view.with_name(view_name).min_size((140, 30))).title("Part Log"),
375370
);
376371
}

src/view/providers/table_parts.rs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -280,16 +280,11 @@ pub fn show_table_parts_dialog(
280280
sql_view
281281
.get_inner_mut()
282282
.set_on_submit(table_parts_action_callback);
283-
284-
let title = filters.build_title(true);
283+
sql_view
284+
.get_inner_mut()
285+
.set_title(filters.build_title(true));
285286

286287
siv.add_layer(
287-
Dialog::around(
288-
LinearLayout::vertical()
289-
.child(TextView::new(title).center())
290-
.child(DummyView.fixed_height(1))
291-
.child(sql_view.with_name(view_name).min_size((140, 30))),
292-
)
293-
.title("Table Parts"),
288+
Dialog::around(sql_view.with_name(view_name).min_size((140, 30))).title("Table Parts"),
294289
);
295290
}

0 commit comments

Comments
 (0)