Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/dashboard/widgets/clipboard_recent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ impl Widget for ClipboardRecentWidget {
let row_height =
ui.text_style_height(&egui::TextStyle::Body) + ui.spacing().item_spacing.y + 6.0;
let scroll_id = ui.id().with("clipboard_recent_scroll");
egui::ScrollArea::vertical()
egui::ScrollArea::both()
.id_source(scroll_id)
.auto_shrink([false; 2])
.show_rows(ui, row_height, rows, |ui, range| {
Expand Down
2 changes: 1 addition & 1 deletion src/dashboard/widgets/clipboard_snippets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ impl Widget for ClipboardSnippetsWidget {
let row_height =
ui.text_style_height(&egui::TextStyle::Body) + ui.spacing().item_spacing.y + 6.0;
let scroll_id = ui.id().with("clipboard_snippets_scroll");
egui::ScrollArea::vertical()
egui::ScrollArea::both()
.id_source(scroll_id)
.auto_shrink([false; 2])
.show_rows(ui, row_height, rows, |ui, range| {
Expand Down
19 changes: 14 additions & 5 deletions src/dashboard/widgets/notes_recent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,20 +156,29 @@ impl Widget for NotesRecentWidget {
row_height += small_height + 2.0;
}
let scroll_id = ui.id().with("notes_recent_scroll");
egui::ScrollArea::vertical()
egui::ScrollArea::both()
.id_source(scroll_id)
.auto_shrink([false; 2])
.show_rows(ui, row_height, self.cached.len(), |ui, range| {
for note in &self.cached[range] {
let mut clicked_row = false;
ui.vertical(|ui| {
clicked_row |= ui.button(&note.title).clicked();
clicked_row |= ui
.add(egui::Button::new(&note.title).wrap(false))
.clicked();
if self.cfg.show_snippet {
ui.label(egui::RichText::new(&note.snippet).small());
ui.add(
egui::Label::new(egui::RichText::new(&note.snippet).small())
.wrap(false),
);
}
if self.cfg.show_tags && !note.tags.is_empty() {
ui.label(
egui::RichText::new(format!("#{}", note.tags.join(" #"))).small(),
ui.add(
egui::Label::new(
egui::RichText::new(format!("#{}", note.tags.join(" #")))
.small(),
)
.wrap(false),
);
}
ui.add_space(4.0);
Expand Down
6 changes: 3 additions & 3 deletions src/dashboard/widgets/process_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,14 +136,14 @@ impl Widget for ProcessesWidget {
let row_height =
ui.text_style_height(&egui::TextStyle::Body) + ui.spacing().item_spacing.y + 8.0;
let scroll_id = ui.id().with("process_list_scroll");
egui::ScrollArea::vertical()
egui::ScrollArea::both()
.id_source(scroll_id)
.auto_shrink([false; 2])
.show_rows(ui, row_height, grouped.len(), |ui, range| {
for (desc, switch, kill) in &grouped[range] {
ui.horizontal(|ui| {
if let Some(action) = switch {
if ui.button(&action.label).clicked() {
if ui.add(egui::Button::new(&action.label).wrap(false)).clicked() {
clicked = Some(action.clone());
}
}
Expand All @@ -152,7 +152,7 @@ impl Widget for ProcessesWidget {
clicked = Some(action.clone());
}
}
ui.label(egui::RichText::new(desc).small());
ui.add(egui::Label::new(egui::RichText::new(desc).small()).wrap(false));
});
}
});
Expand Down
9 changes: 6 additions & 3 deletions src/dashboard/widgets/query_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,17 +155,20 @@ impl Widget for QueryListWidget {
ui.text_style_height(&egui::TextStyle::Body) + ui.spacing().item_spacing.y + 8.0;
let max_rows = self.cache.data.len().min(self.cfg.count);
let scroll_id = ui.id().with("query_list_scroll");
egui::ScrollArea::vertical()
egui::ScrollArea::both()
.id_source(scroll_id)
.auto_shrink([false; 2])
.show_rows(ui, row_height, max_rows, |ui, range| {
for action in &self.cache.data[range] {
ui.horizontal(|ui| {
if ui.button(&action.label).clicked() {
if ui.add(egui::Button::new(&action.label).wrap(false)).clicked() {
clicked = Some(action.clone());
}
if self.cfg.show_desc {
ui.label(egui::RichText::new(&action.desc).small());
ui.add(
egui::Label::new(egui::RichText::new(&action.desc).small())
.wrap(false),
);
}
});
}
Expand Down
19 changes: 14 additions & 5 deletions src/dashboard/widgets/recent_notes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ impl Widget for RecentNotesWidget {
row_height += small_height + 2.0;

let scroll_id = ui.id().with("recent_notes_scroll");
egui::ScrollArea::vertical()
egui::ScrollArea::both()
.id_source(scroll_id)
.auto_shrink([false; 2])
.show_rows(ui, row_height, notes.len(), |ui, range| {
Expand All @@ -230,13 +230,22 @@ impl Widget for RecentNotesWidget {
let (action, query_override) = self.build_action(note);
let mut clicked_row = false;
ui.vertical(|ui| {
clicked_row |= ui.button(display).clicked();
clicked_row |= ui.add(egui::Button::new(display).wrap(false)).clicked();
if self.cfg.show_snippet {
ui.label(egui::RichText::new(Self::snippet(note)).small());
ui.add(
egui::Label::new(
egui::RichText::new(Self::snippet(note)).small(),
)
.wrap(false),
);
}
if !note.tags.is_empty() {
ui.label(
egui::RichText::new(format!("#{}", note.tags.join(" #"))).small(),
ui.add(
egui::Label::new(
egui::RichText::new(format!("#{}", note.tags.join(" #")))
.small(),
)
.wrap(false),
);
}
ui.add_space(4.0);
Expand Down
17 changes: 10 additions & 7 deletions src/dashboard/widgets/tempfiles.rs
Original file line number Diff line number Diff line change
Expand Up @@ -259,21 +259,24 @@ impl Widget for TempfilesWidget {
let row_height =
ui.text_style_height(&egui::TextStyle::Body) + ui.spacing().item_spacing.y + 8.0;
let scroll_id = ui.id().with("tempfiles_scroll");
egui::ScrollArea::vertical()
egui::ScrollArea::both()
.id_source(scroll_id)
.auto_shrink([false; 2])
.show_rows(ui, row_height, self.cache.data.len(), |ui, range| {
for entry in &self.cache.data[range] {
ui.horizontal(|ui| {
let display_name = entry.alias.as_deref().unwrap_or(&entry.file_name);
ui.label(display_name).on_hover_text(entry.path.to_string_lossy());
ui.add(egui::Label::new(display_name).wrap(false))
.on_hover_text(entry.path.to_string_lossy());
if let Some(alias) = &entry.alias {
if alias != &entry.file_name {
ui.label(egui::RichText::new(format!(
"({})",
entry.file_name
))
.small());
ui.add(
egui::Label::new(
egui::RichText::new(format!("({})", entry.file_name))
.small(),
)
.wrap(false),
);
}
}
if ui
Expand Down