Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use hashtag icon #590

Merged
merged 2 commits into from
Dec 25, 2024
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
Binary file added assets/icons/hashtag_icon_4x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion crates/notedeck_columns/src/timeline/kind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ impl TimelineKind {
TimelineKind::Profile(_pubkey_source) => ColumnTitle::needs_db(self),
TimelineKind::Universe => ColumnTitle::simple("Universe"),
TimelineKind::Generic => ColumnTitle::simple("Custom"),
TimelineKind::Hashtag(hashtag) => ColumnTitle::formatted(format!("#{}", hashtag)),
TimelineKind::Hashtag(hashtag) => ColumnTitle::formatted(hashtag.to_string()),
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion crates/notedeck_columns/src/ui/add_column.rs
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ impl<'a> AddColumnView<'a> {
vec.push(ColumnOptionData {
title: "Hashtag",
description: "Stay up to date with a certain hashtag",
icon: egui::include_image!("../../../../assets/icons/notifications_icon_dark_4x.png"),
icon: egui::include_image!("../../../../assets/icons/hashtag_icon_4x.png"),
option: AddColumnOption::UndecidedHashtag,
});
vec.push(ColumnOptionData {
Expand Down
18 changes: 16 additions & 2 deletions crates/notedeck_columns/src/ui/column/header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use crate::{
column::Columns,
nav::RenderNavAction,
route::Route,
timeline::{ColumnTitle, TimelineId, TimelineRoute},
timeline::{ColumnTitle, TimelineId, TimelineKind, TimelineRoute},
ui::{
self,
anim::{AnimationHelper, ICON_EXPANSION_MULTIPLE},
Expand Down Expand Up @@ -195,7 +195,21 @@ impl<'a> NavTitle<'a> {
match top {
Route::Timeline(tlr) => match tlr {
TimelineRoute::Timeline(tlid) => {
self.timeline_pfp(ui, *tlid, pfp_size);
let is_hashtag = self
.columns
.find_timeline(*tlid)
.map_or(false, |tl| matches!(tl.kind, TimelineKind::Hashtag(_)));

if is_hashtag {
ui.add(
egui::Image::new(egui::include_image!(
"../../../../../assets/icons/hashtag_icon_4x.png"
))
.fit_to_exact_size(egui::vec2(pfp_size, pfp_size)),
);
} else {
self.timeline_pfp(ui, *tlid, pfp_size);
}
}

TimelineRoute::Thread(_note_id) => {}
Expand Down
Loading