mirror of
https://github.com/aljazceru/notedeck.git
synced 2025-12-18 09:04:21 +01:00
search: improve search column header
Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
@@ -6,7 +6,7 @@ use tokenator::{ParseError, TokenParser, TokenSerializable, TokenWriter};
|
||||
#[derive(Debug, Eq, PartialEq, Clone, Hash)]
|
||||
pub struct SearchQuery {
|
||||
author: Option<Pubkey>,
|
||||
search: String,
|
||||
pub search: String,
|
||||
}
|
||||
|
||||
impl TokenSerializable for SearchQuery {
|
||||
|
||||
@@ -588,7 +588,9 @@ impl TimelineKind {
|
||||
|
||||
pub fn to_title(&self) -> ColumnTitle<'_> {
|
||||
match self {
|
||||
TimelineKind::Search(_query) => ColumnTitle::simple("Search"),
|
||||
TimelineKind::Search(query) => {
|
||||
ColumnTitle::formatted(format!("Search \"{}\"", query.search))
|
||||
}
|
||||
TimelineKind::List(list_kind) => match list_kind {
|
||||
ListKind::Contact(_pubkey_source) => ColumnTitle::simple("Contacts"),
|
||||
},
|
||||
|
||||
@@ -434,9 +434,14 @@ impl<'a> NavTitle<'a> {
|
||||
// no pfp for threads
|
||||
}
|
||||
|
||||
TimelineKind::Search(_sq) => {
|
||||
// TODO: show author pfp if author field set?
|
||||
|
||||
ui.add(ui::side_panel::search_button());
|
||||
}
|
||||
|
||||
TimelineKind::Universe
|
||||
| TimelineKind::Algo(_)
|
||||
| TimelineKind::Search(_)
|
||||
| TimelineKind::Notifications(_)
|
||||
| TimelineKind::Generic(_)
|
||||
| TimelineKind::List(_) => {
|
||||
|
||||
@@ -487,8 +487,7 @@ fn compose_note_button(interactive: bool, dark_mode: bool) -> impl Widget {
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unused)]
|
||||
fn search_button() -> impl Widget {
|
||||
pub fn search_button() -> impl Widget {
|
||||
|ui: &mut egui::Ui| -> egui::Response {
|
||||
let max_size = ICON_WIDTH * ICON_EXPANSION_MULTIPLE; // max size of the widget
|
||||
let min_line_width_circle = 1.5; // width of the magnifying glass
|
||||
|
||||
Reference in New Issue
Block a user