note/options: simplify flag logic
simpler, less macro magic Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
@@ -437,9 +437,18 @@ impl Damus {
|
||||
let debug = ctx.args.debug;
|
||||
let support = Support::new(ctx.path);
|
||||
let mut note_options = NoteOptions::default();
|
||||
note_options.set_textmode(parsed_args.is_flag_set(ColumnsFlag::Textmode));
|
||||
note_options.set_scramble_text(parsed_args.is_flag_set(ColumnsFlag::Scramble));
|
||||
note_options.set_hide_media(parsed_args.is_flag_set(ColumnsFlag::NoMedia));
|
||||
note_options.set(
|
||||
NoteOptions::Textmode,
|
||||
parsed_args.is_flag_set(ColumnsFlag::Textmode),
|
||||
);
|
||||
note_options.set(
|
||||
NoteOptions::ScrambleText,
|
||||
parsed_args.is_flag_set(ColumnsFlag::Scramble),
|
||||
);
|
||||
note_options.set(
|
||||
NoteOptions::HideMedia,
|
||||
parsed_args.is_flag_set(ColumnsFlag::NoMedia),
|
||||
);
|
||||
|
||||
let jobs = JobsCache::default();
|
||||
|
||||
|
||||
@@ -88,7 +88,7 @@ pub fn render_thread_route(
|
||||
) -> Option<RenderNavAction> {
|
||||
// don't truncate thread notes for now, since they are
|
||||
// default truncated everywher eelse
|
||||
note_options.set_truncate(false);
|
||||
note_options.set(NoteOptions::Truncate, false);
|
||||
|
||||
ui::ThreadView::new(
|
||||
threads,
|
||||
|
||||
@@ -302,8 +302,8 @@ impl<'a> ThreadNote<'a> {
|
||||
match self.note_type {
|
||||
ThreadNoteType::Chain { root: _ } => cur_options,
|
||||
ThreadNoteType::Selected { root: _ } => {
|
||||
cur_options.set_wide(true);
|
||||
cur_options.set_selectable_text(true);
|
||||
cur_options.set(NoteOptions::Wide, true);
|
||||
cur_options.set(NoteOptions::SelectableText, true);
|
||||
cur_options
|
||||
}
|
||||
ThreadNoteType::Reply => cur_options,
|
||||
|
||||
Reference in New Issue
Block a user