Merge remote-tracking branch 'fernando/feat/settings-view'
This commit is contained in:
@@ -46,6 +46,9 @@ impl<'a, 'd> NoteContents<'a, 'd> {
|
||||
|
||||
impl egui::Widget for &mut NoteContents<'_, '_> {
|
||||
fn ui(self, ui: &mut egui::Ui) -> egui::Response {
|
||||
if self.options.contains(NoteOptions::ShowNoteClientTop) {
|
||||
render_client(ui, self.note_context.note_cache, self.note);
|
||||
}
|
||||
let result = render_note_contents(
|
||||
ui,
|
||||
self.note_context,
|
||||
@@ -54,7 +57,7 @@ impl egui::Widget for &mut NoteContents<'_, '_> {
|
||||
self.options,
|
||||
self.jobs,
|
||||
);
|
||||
if self.options.contains(NoteOptions::ShowNoteClient) {
|
||||
if self.options.contains(NoteOptions::ShowNoteClientBottom) {
|
||||
render_client(ui, self.note_context.note_cache, self.note);
|
||||
}
|
||||
self.action = result.action;
|
||||
|
||||
@@ -235,13 +235,13 @@ fn get_selected_index(ui: &egui::Ui, selection_id: egui::Id) -> usize {
|
||||
/// Checks to see if we have any left/right key presses and updates the carousel index
|
||||
fn update_selected_image_index(ui: &mut egui::Ui, carousel_id: egui::Id, num_urls: i32) -> usize {
|
||||
if num_urls > 1 {
|
||||
let next_image = ui.data(|data| {
|
||||
data.get_temp(carousel_id.with("next_image"))
|
||||
.unwrap_or(false)
|
||||
});
|
||||
let prev_image = ui.data(|data| {
|
||||
data.get_temp(carousel_id.with("prev_image"))
|
||||
.unwrap_or(false)
|
||||
let (next_image, prev_image) = ui.data(|data| {
|
||||
(
|
||||
data.get_temp(carousel_id.with("next_image"))
|
||||
.unwrap_or_default(),
|
||||
data.get_temp(carousel_id.with("prev_image"))
|
||||
.unwrap_or_default(),
|
||||
)
|
||||
});
|
||||
|
||||
if next_image
|
||||
|
||||
@@ -23,7 +23,8 @@ bitflags! {
|
||||
/// will end with a ... and a "Show more" button.
|
||||
const Truncate = 1 << 11;
|
||||
/// Show note's client in the note header
|
||||
const ShowNoteClient = 1 << 12;
|
||||
const ShowNoteClientTop = 1 << 12;
|
||||
const ShowNoteClientBottom = 1 << 13;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user