Merge remote-tracking branch 'github/pr/928'
This commit is contained in:
@@ -14,7 +14,9 @@ use crate::{
|
||||
Result,
|
||||
};
|
||||
|
||||
use notedeck::{Accounts, AppAction, AppContext, DataPath, DataPathType, FilterState, UnknownIds};
|
||||
use notedeck::{
|
||||
ui::is_narrow, Accounts, AppAction, AppContext, DataPath, DataPathType, FilterState, UnknownIds,
|
||||
};
|
||||
use notedeck_ui::{jobs::JobsCache, NoteOptions};
|
||||
|
||||
use enostr::{ClientMessage, PoolRelay, Pubkey, RelayEvent, RelayMessage, RelayPool};
|
||||
@@ -561,14 +563,22 @@ fn render_damus_mobile(
|
||||
}
|
||||
}
|
||||
|
||||
rect.min.x = rect.max.x - 100.0;
|
||||
rect.min.x = rect.max.x - if is_narrow(ui.ctx()) { 60.0 } else { 100.0 };
|
||||
rect.min.y = rect.max.y - 100.0;
|
||||
|
||||
let interactive = true;
|
||||
let is_interactive = app_ctx
|
||||
.accounts
|
||||
.get_selected_account()
|
||||
.key
|
||||
.secret_key
|
||||
.is_some();
|
||||
let darkmode = ui.ctx().style().visuals.dark_mode;
|
||||
|
||||
if ui
|
||||
.put(rect, ui::post::compose_note_button(interactive, darkmode))
|
||||
.put(
|
||||
rect,
|
||||
ui::post::compose_note_button(is_interactive, darkmode),
|
||||
)
|
||||
.clicked()
|
||||
&& !app.columns(app_ctx.accounts).columns().is_empty()
|
||||
{
|
||||
|
||||
@@ -187,7 +187,7 @@ impl<'a> AddColumnView<'a> {
|
||||
ScrollArea::vertical()
|
||||
.show(ui, |ui| {
|
||||
let mut selected_option: Option<AddColumnResponse> = None;
|
||||
for column_option_data in self.get_base_options() {
|
||||
for column_option_data in self.get_base_options(ui) {
|
||||
let option = column_option_data.option.clone();
|
||||
if self.column_option_ui(ui, column_option_data).clicked() {
|
||||
selected_option = Some(option.take_as_response(self.cur_account));
|
||||
@@ -203,7 +203,7 @@ impl<'a> AddColumnView<'a> {
|
||||
|
||||
fn notifications_ui(&mut self, ui: &mut Ui) -> Option<AddColumnResponse> {
|
||||
let mut selected_option: Option<AddColumnResponse> = None;
|
||||
for column_option_data in self.get_notifications_options() {
|
||||
for column_option_data in self.get_notifications_options(ui) {
|
||||
let option = column_option_data.option.clone();
|
||||
if self.column_option_ui(ui, column_option_data).clicked() {
|
||||
selected_option = Some(option.take_as_response(self.cur_account));
|
||||
@@ -441,7 +441,7 @@ impl<'a> AddColumnView<'a> {
|
||||
helper.take_animation_response()
|
||||
}
|
||||
|
||||
fn get_base_options(&self) -> Vec<ColumnOptionData> {
|
||||
fn get_base_options(&self, ui: &mut Ui) -> Vec<ColumnOptionData> {
|
||||
let mut vec = Vec::new();
|
||||
vec.push(ColumnOptionData {
|
||||
title: "Universe",
|
||||
@@ -465,7 +465,7 @@ impl<'a> AddColumnView<'a> {
|
||||
vec.push(ColumnOptionData {
|
||||
title: "Notifications",
|
||||
description: "Stay up to date with notifications and mentions",
|
||||
icon: app_images::notifications_image(),
|
||||
icon: app_images::notifications_image(ui.visuals().dark_mode),
|
||||
option: AddColumnOption::UndecidedNotification,
|
||||
});
|
||||
vec.push(ColumnOptionData {
|
||||
@@ -490,7 +490,7 @@ impl<'a> AddColumnView<'a> {
|
||||
vec
|
||||
}
|
||||
|
||||
fn get_notifications_options(&self) -> Vec<ColumnOptionData> {
|
||||
fn get_notifications_options(&self, ui: &mut Ui) -> Vec<ColumnOptionData> {
|
||||
let mut vec = Vec::new();
|
||||
|
||||
let source = if self.cur_account.key.secret_key.is_some() {
|
||||
@@ -502,14 +502,14 @@ impl<'a> AddColumnView<'a> {
|
||||
vec.push(ColumnOptionData {
|
||||
title: "Your Notifications",
|
||||
description: "Stay up to date with your notifications and mentions",
|
||||
icon: app_images::notifications_image(),
|
||||
icon: app_images::notifications_image(ui.visuals().dark_mode),
|
||||
option: AddColumnOption::Notification(source),
|
||||
});
|
||||
|
||||
vec.push(ColumnOptionData {
|
||||
title: "Someone else's Notifications",
|
||||
description: "Stay up to date with someone else's notifications and mentions",
|
||||
icon: app_images::notifications_image(),
|
||||
icon: app_images::notifications_image(ui.visuals().dark_mode),
|
||||
option: AddColumnOption::ExternalNotification,
|
||||
});
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ use egui::{vec2, Direction, Layout, Pos2, Stroke};
|
||||
use egui_tabs::TabColor;
|
||||
use enostr::KeypairUnowned;
|
||||
use nostrdb::Transaction;
|
||||
use notedeck::ui::is_narrow;
|
||||
use notedeck_ui::jobs::JobsCache;
|
||||
use std::f32::consts::PI;
|
||||
use tracing::{error, warn};
|
||||
@@ -114,7 +115,9 @@ fn timeline_ui(
|
||||
.unwrap_or(false);
|
||||
|
||||
let goto_top_resp = if show_top_button {
|
||||
let top_button_pos = ui.available_rect_before_wrap().right_top() - vec2(48.0, -24.0);
|
||||
let top_button_pos_x = if is_narrow(ui.ctx()) { 28.0 } else { 48.0 };
|
||||
let top_button_pos =
|
||||
ui.available_rect_before_wrap().right_top() - vec2(top_button_pos_x, -24.0);
|
||||
egui::Area::new(ui.id().with("foreground_area"))
|
||||
.order(egui::Order::Middle)
|
||||
.fixed_pos(top_button_pos)
|
||||
|
||||
Reference in New Issue
Block a user