feat: add --no-media flag to disable media display

- Introduced a new "no_media" boolean in ColumnsArgs to capture the
  --no-media flag.

- Updated NoteOptions to include a setting for hiding media, configured
  from parsed arguments.

- Refactored Damus to consolidate note options (textmode, scramble, and
  no-media) into a single NoteOptions field.

- Modified navigation UI rendering to pass the unified note_options.

This change allows users to disable media display via the --no-media flag.

Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
William Casarin
2025-02-22 14:39:04 -08:00
parent bd352f76d4
commit 660b7cc8b7
3 changed files with 17 additions and 21 deletions

View File

@@ -16,7 +16,7 @@ use crate::{
column::NavTitle,
configure_deck::ConfigureDeckView,
edit_deck::{EditDeckResponse, EditDeckView},
note::{NoteOptions, PostAction, PostType},
note::{PostAction, PostType},
profile::EditProfileView,
support::SupportView,
RelayView, View,
@@ -243,13 +243,6 @@ fn render_nav_body(
col: usize,
inner_rect: egui::Rect,
) -> Option<RenderNavAction> {
let note_options = {
let mut options = NoteOptions::default();
options.set_textmode(app.textmode);
options.set_scramble_text(app.scramble);
options
};
match top {
Route::Timeline(kind) => render_timeline_route(
ctx.ndb,
@@ -260,7 +253,7 @@ fn render_nav_body(
ctx.accounts,
kind,
col,
note_options,
app.note_options,
depth,
ui,
),
@@ -317,7 +310,7 @@ fn render_nav_body(
ctx.img_cache,
&note,
inner_rect,
note_options,
app.note_options,
)
.id_source(id)
.show(ui)
@@ -353,7 +346,7 @@ fn render_nav_body(
draft,
&note,
inner_rect,
note_options,
app.note_options,
)
.id_source(id)
.show(ui)
@@ -375,7 +368,7 @@ fn render_nav_body(
ctx.note_cache,
kp,
inner_rect,
note_options,
app.note_options,
)
.ui(&txn, ui);