Remove FeedProperties in theme - was dead code

This commit is contained in:
Mike Dilger 2024-07-01 10:14:36 +12:00
parent 3be3ee5951
commit 5cf729fe28
3 changed files with 16 additions and 26 deletions

View File

@ -1,4 +1,3 @@
use super::theme::FeedProperties;
use super::{widgets, GossipUi, Page}; use super::{widgets, GossipUi, Page};
use eframe::egui::{self, Align, Rect}; use eframe::egui::{self, Align, Rect};
use egui::{Context, RichText, Ui, Vec2}; use egui::{Context, RichText, Ui, Vec2};
@ -277,10 +276,6 @@ fn render_a_feed(
scroll_area_id: &str, scroll_area_id: &str,
offer_load_more: bool, offer_load_more: bool,
) { ) {
let feed_properties = FeedProperties {
is_thread: threaded,
};
let feed_newest_at_bottom = GLOBALS.storage.read_setting_feed_newest_at_bottom(); let feed_newest_at_bottom = GLOBALS.storage.read_setting_feed_newest_at_bottom();
// Do not render feed while switching or we will lose our scroll offset. // Do not render feed while switching or we will lose our scroll offset.
@ -303,9 +298,9 @@ fn render_a_feed(
top: 0.0, top: 0.0,
bottom: 0.0, bottom: 0.0,
}) })
.rounding(app.theme.feed_scroll_rounding(&feed_properties)) .rounding(app.theme.feed_scroll_rounding())
.fill(app.theme.feed_scroll_fill(&feed_properties)) .fill(app.theme.feed_scroll_fill())
.stroke(app.theme.feed_scroll_stroke(&feed_properties)) .stroke(app.theme.feed_scroll_stroke())
.show(ui, |ui| { .show(ui, |ui| {
if feed_newest_at_bottom { if feed_newest_at_bottom {
ui.add_space(50.0); ui.add_space(50.0);

View File

@ -1,4 +1,4 @@
use super::{FeedProperties, NoteRenderData, ThemeDef}; use super::{NoteRenderData, ThemeDef};
use crate::ui::HighlightType; use crate::ui::HighlightType;
use eframe::egui::style::{Selection, WidgetVisuals, Widgets}; use eframe::egui::style::{Selection, WidgetVisuals, Widgets};
use eframe::egui::{ use eframe::egui::{
@ -740,13 +740,13 @@ impl ThemeDef for DefaultTheme {
} }
// feed styling // feed styling
fn feed_scroll_rounding(_feed: &FeedProperties) -> Rounding { fn feed_scroll_rounding() -> Rounding {
Rounding::ZERO Rounding::ZERO
} }
fn feed_scroll_fill(_dark_mode: bool, _feed: &FeedProperties) -> Color32 { fn feed_scroll_fill(_dark_mode: bool) -> Color32 {
Color32::from_rgba_premultiplied(0, 0, 0, 0) // Transparent separator Color32::from_rgba_premultiplied(0, 0, 0, 0) // Transparent separator
} }
fn feed_scroll_stroke(_dark_mode: bool, _feed: &FeedProperties) -> Stroke { fn feed_scroll_stroke(_dark_mode: bool) -> Stroke {
Stroke::NONE Stroke::NONE
} }
fn feed_post_separator_stroke(_dark_mode: bool, _post: &NoteRenderData) -> Stroke { fn feed_post_separator_stroke(_dark_mode: bool, _post: &NoteRenderData) -> Stroke {

View File

@ -47,11 +47,6 @@ impl Theme {
} }
} }
pub struct FeedProperties {
/// This is a thread
pub is_thread: bool,
}
macro_rules! theme_dispatch { macro_rules! theme_dispatch {
($($variant:path, $class:ident, $name:literal),+) => { ($($variant:path, $class:ident, $name:literal),+) => {
@ -370,21 +365,21 @@ macro_rules! theme_dispatch {
} }
} }
pub fn feed_scroll_fill(&self, feed: &FeedProperties) -> Color32 { pub fn feed_scroll_fill(&self) -> Color32 {
match self.variant { match self.variant {
$( $variant => $class::feed_scroll_fill(self.dark_mode, feed), )+ $( $variant => $class::feed_scroll_fill(self.dark_mode), )+
} }
} }
pub fn feed_scroll_stroke(&self, feed: &FeedProperties) -> Stroke { pub fn feed_scroll_stroke(&self) -> Stroke {
match self.variant { match self.variant {
$( $variant => $class::feed_scroll_stroke(self.dark_mode, feed), )+ $( $variant => $class::feed_scroll_stroke(self.dark_mode), )+
} }
} }
pub fn feed_scroll_rounding(&self, feed: &FeedProperties) -> Rounding { pub fn feed_scroll_rounding(&self) -> Rounding {
match self.variant { match self.variant {
$( $variant => $class::feed_scroll_rounding(feed), )+ $( $variant => $class::feed_scroll_rounding(), )+
} }
} }
@ -601,9 +596,9 @@ pub trait ThemeDef: Send + Sync {
fn input_bg_color(dark_mode: bool) -> eframe::egui::Color32; fn input_bg_color(dark_mode: bool) -> eframe::egui::Color32;
// feed styling // feed styling
fn feed_scroll_rounding(feed: &FeedProperties) -> Rounding; fn feed_scroll_rounding() -> Rounding;
fn feed_scroll_fill(dark_mode: bool, feed: &FeedProperties) -> Color32; fn feed_scroll_fill(dark_mode: bool) -> Color32;
fn feed_scroll_stroke(dark_mode: bool, feed: &FeedProperties) -> Stroke; fn feed_scroll_stroke(dark_mode: bool) -> Stroke;
fn feed_post_separator_stroke(dark_mode: bool, post: &NoteRenderData) -> Stroke; fn feed_post_separator_stroke(dark_mode: bool, post: &NoteRenderData) -> Stroke;
fn feed_post_outer_indent(ui: &mut Ui, post: &NoteRenderData); fn feed_post_outer_indent(ui: &mut Ui, post: &NoteRenderData);
fn feed_post_inner_indent(ui: &mut Ui, post: &NoteRenderData); fn feed_post_inner_indent(ui: &mut Ui, post: &NoteRenderData);