egui: bump to 0.31.1
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
use egui::{
|
||||
style::{Selection, WidgetVisuals, Widgets},
|
||||
Color32, Rounding, Shadow, Stroke, Visuals,
|
||||
Color32, CornerRadius, Shadow, Stroke, Visuals,
|
||||
};
|
||||
|
||||
pub struct ColorTheme {
|
||||
@@ -29,7 +29,7 @@ pub struct ColorTheme {
|
||||
pub inactive_weak_bg_fill: Color32,
|
||||
}
|
||||
|
||||
const WIDGET_ROUNDING: Rounding = Rounding::same(8);
|
||||
const WIDGET_CORNER_RADIUS: CornerRadius = CornerRadius::same(8);
|
||||
|
||||
pub fn create_themed_visuals(theme: ColorTheme, default: Visuals) -> Visuals {
|
||||
Visuals {
|
||||
@@ -56,7 +56,6 @@ pub fn create_themed_visuals(theme: ColorTheme, default: Visuals) -> Visuals {
|
||||
width: 1.0,
|
||||
color: theme.noninteractive_fg_stroke_color,
|
||||
},
|
||||
rounding: WIDGET_ROUNDING,
|
||||
..default.widgets.noninteractive
|
||||
},
|
||||
inactive: WidgetVisuals {
|
||||
@@ -66,15 +65,15 @@ pub fn create_themed_visuals(theme: ColorTheme, default: Visuals) -> Visuals {
|
||||
width: 1.0,
|
||||
color: theme.inactive_bg_stroke_color,
|
||||
},
|
||||
rounding: WIDGET_ROUNDING,
|
||||
corner_radius: WIDGET_CORNER_RADIUS,
|
||||
..default.widgets.inactive
|
||||
},
|
||||
hovered: WidgetVisuals {
|
||||
rounding: WIDGET_ROUNDING,
|
||||
corner_radius: WIDGET_CORNER_RADIUS,
|
||||
..default.widgets.hovered
|
||||
},
|
||||
active: WidgetVisuals {
|
||||
rounding: WIDGET_ROUNDING,
|
||||
corner_radius: WIDGET_CORNER_RADIUS,
|
||||
..default.widgets.active
|
||||
},
|
||||
open: WidgetVisuals {
|
||||
@@ -83,7 +82,6 @@ pub fn create_themed_visuals(theme: ColorTheme, default: Visuals) -> Visuals {
|
||||
},
|
||||
extreme_bg_color: theme.extreme_bg_color,
|
||||
error_fg_color: theme.err_fg_color,
|
||||
window_rounding: Rounding::same(8),
|
||||
window_fill: theme.window_fill,
|
||||
window_shadow: Shadow {
|
||||
offset: [0, 8],
|
||||
|
||||
@@ -143,7 +143,7 @@ fn show_profile_card(
|
||||
frame = frame.stroke(ui.visuals().noninteractive().fg_stroke);
|
||||
}
|
||||
frame
|
||||
.rounding(8.0)
|
||||
.corner_radius(8.0)
|
||||
.inner_margin(8.0)
|
||||
.show(ui, |ui| {
|
||||
ui.horizontal(|ui| {
|
||||
|
||||
@@ -573,7 +573,9 @@ pub(crate) fn sized_button(text: &str) -> impl Widget + '_ {
|
||||
|
||||
ui.add_sized(
|
||||
galley.rect.expand2(vec2(16.0, 8.0)).size(),
|
||||
Button::new(galley).rounding(8.0).fill(crate::colors::PINK),
|
||||
Button::new(galley)
|
||||
.corner_radius(8.0)
|
||||
.fill(crate::colors::PINK),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -293,7 +293,7 @@ impl<'a> NavTitle<'a> {
|
||||
) -> Vec<(egui::Response, f32)> {
|
||||
let y_margin: i8 = 4;
|
||||
let item_frame = egui::Frame::new()
|
||||
.rounding(egui::Rounding::same(8))
|
||||
.corner_radius(egui::CornerRadius::same(8))
|
||||
.inner_margin(Margin::symmetric(8, y_margin));
|
||||
|
||||
(0..self.columns.num_columns())
|
||||
|
||||
@@ -98,7 +98,7 @@ pub fn render_note_preview(
|
||||
.fill(ui.visuals().noninteractive().weak_bg_fill)
|
||||
.inner_margin(egui::Margin::same(8))
|
||||
.outer_margin(egui::Margin::symmetric(0, 8))
|
||||
.rounding(egui::Rounding::same(10))
|
||||
.corner_radius(egui::CornerRadius::same(10))
|
||||
.stroke(egui::Stroke::new(
|
||||
1.0,
|
||||
ui.visuals().noninteractive().bg_stroke.color,
|
||||
@@ -338,7 +338,7 @@ fn image_carousel(
|
||||
Button::image(
|
||||
Image::new(texture)
|
||||
.max_height(height)
|
||||
.rounding(5.0)
|
||||
.corner_radius(5.0)
|
||||
.fit_to_original_size(1.0),
|
||||
)
|
||||
.frame(false),
|
||||
|
||||
@@ -304,7 +304,7 @@ impl<'a, 'd> PostView<'a, 'd> {
|
||||
.outer_margin(egui::Margin::same(PostView::outer_margin()))
|
||||
.fill(ui.visuals().extreme_bg_color)
|
||||
.stroke(stroke)
|
||||
.rounding(12.0);
|
||||
.corner_radius(12.0);
|
||||
|
||||
if focused {
|
||||
frame = frame.shadow(egui::epaint::Shadow {
|
||||
@@ -452,7 +452,7 @@ impl<'a, 'd> PostView<'a, 'd> {
|
||||
let img_resp = ui.add(
|
||||
egui::Image::new(texture_handle)
|
||||
.max_size(size)
|
||||
.rounding(12.0),
|
||||
.corner_radius(12.0),
|
||||
);
|
||||
|
||||
let remove_button_rect = {
|
||||
@@ -591,7 +591,7 @@ fn media_upload_button() -> impl egui::Widget {
|
||||
};
|
||||
|
||||
painter.rect_filled(resp.rect, 8.0, fill_color);
|
||||
painter.rect_stroke(resp.rect, 8.0, stroke);
|
||||
painter.rect_stroke(resp.rect, 8.0, stroke, egui::StrokeKind::Middle);
|
||||
egui::Image::new(egui::include_image!(
|
||||
"../../../../../assets/icons/media_upload_dark_4x.png"
|
||||
))
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use core::f32;
|
||||
|
||||
use egui::{vec2, Button, Layout, Margin, RichText, Rounding, ScrollArea, TextEdit};
|
||||
use egui::{vec2, Button, CornerRadius, Layout, Margin, RichText, ScrollArea, TextEdit};
|
||||
use notedeck::{Images, NotedeckTextStyle};
|
||||
|
||||
use crate::{colors, profile_state::ProfileState};
|
||||
@@ -164,7 +164,7 @@ fn in_frame(ui: &mut egui::Ui, contents: impl FnOnce(&mut egui::Ui)) {
|
||||
|
||||
fn button(text: &str, width: f32) -> egui::Button<'static> {
|
||||
Button::new(text)
|
||||
.rounding(Rounding::same(8))
|
||||
.corner_radius(CornerRadius::same(8))
|
||||
.min_size(vec2(width, 40.0))
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ pub mod preview;
|
||||
|
||||
pub use edit::EditProfileView;
|
||||
use egui::load::TexturePoll;
|
||||
use egui::{vec2, Color32, Label, Layout, Rect, RichText, Rounding, ScrollArea, Sense, Stroke};
|
||||
use egui::{vec2, Color32, CornerRadius, Label, Layout, Rect, RichText, ScrollArea, Sense, Stroke};
|
||||
use enostr::Pubkey;
|
||||
use nostrdb::{ProfileRecord, Transaction};
|
||||
pub use picture::ProfilePic;
|
||||
@@ -244,7 +244,7 @@ fn copy_key_widget(pfp_rect: &egui::Rect) -> impl egui::Widget + '_ {
|
||||
Sense::click(),
|
||||
);
|
||||
|
||||
let copy_key_rounding = Rounding::same(100);
|
||||
let copy_key_rounding = CornerRadius::same(100);
|
||||
let fill_color = if resp.hovered() {
|
||||
ui.visuals().widgets.inactive.weak_bg_fill
|
||||
} else {
|
||||
@@ -257,6 +257,7 @@ fn copy_key_widget(pfp_rect: &egui::Rect) -> impl egui::Widget + '_ {
|
||||
copy_key_rect.shrink(1.0),
|
||||
copy_key_rounding,
|
||||
Stroke::new(1.0, stroke_color),
|
||||
egui::StrokeKind::Outside,
|
||||
);
|
||||
egui::Image::new(egui::include_image!(
|
||||
"../../../../../assets/icons/key_4x.png"
|
||||
@@ -283,7 +284,7 @@ fn edit_profile_button() -> impl egui::Widget + 'static {
|
||||
|
||||
painter.rect_filled(
|
||||
rect,
|
||||
Rounding::same(8),
|
||||
CornerRadius::same(8),
|
||||
if resp.hovered() {
|
||||
ui.visuals().widgets.active.bg_fill
|
||||
} else {
|
||||
@@ -292,12 +293,13 @@ fn edit_profile_button() -> impl egui::Widget + 'static {
|
||||
);
|
||||
painter.rect_stroke(
|
||||
rect.shrink(1.0),
|
||||
Rounding::same(8),
|
||||
CornerRadius::same(8),
|
||||
if resp.hovered() {
|
||||
ui.visuals().widgets.active.bg_stroke
|
||||
} else {
|
||||
ui.visuals().widgets.inactive.bg_stroke
|
||||
},
|
||||
egui::StrokeKind::Outside,
|
||||
);
|
||||
|
||||
let edit_icon_size = vec2(16.0, 16.0);
|
||||
|
||||
@@ -3,7 +3,9 @@ use std::collections::HashMap;
|
||||
use crate::colors::PINK;
|
||||
use crate::relay_pool_manager::{RelayPoolManager, RelayStatus};
|
||||
use crate::ui::{Preview, PreviewConfig, View};
|
||||
use egui::{Align, Button, Frame, Id, Image, Layout, Margin, Rgba, RichText, Rounding, Ui, Vec2};
|
||||
use egui::{
|
||||
Align, Button, CornerRadius, Frame, Id, Image, Layout, Margin, Rgba, RichText, Ui, Vec2,
|
||||
};
|
||||
|
||||
use enostr::RelayPool;
|
||||
use notedeck::{Accounts, NotedeckTextStyle};
|
||||
@@ -220,7 +222,7 @@ fn delete_button(_dark_mode: bool) -> egui::Button<'static> {
|
||||
fn relay_frame(ui: &mut Ui) -> Frame {
|
||||
Frame::new()
|
||||
.inner_margin(Margin::same(8))
|
||||
.rounding(ui.style().noninteractive().rounding)
|
||||
.corner_radius(ui.style().noninteractive().corner_radius)
|
||||
.stroke(ui.style().visuals.noninteractive().bg_stroke)
|
||||
}
|
||||
|
||||
@@ -239,7 +241,7 @@ fn show_connection_status(ui: &mut Ui, status: RelayStatus) {
|
||||
};
|
||||
|
||||
let frame = Frame::new()
|
||||
.rounding(Rounding::same(100))
|
||||
.corner_radius(CornerRadius::same(100))
|
||||
.fill(bg_color)
|
||||
.inner_margin(Margin::symmetric(12, 4));
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use egui::{vec2, Align, Color32, RichText, Rounding, Stroke, TextEdit};
|
||||
use egui::{vec2, Align, Color32, CornerRadius, RichText, Stroke, TextEdit};
|
||||
|
||||
use super::{note::contents::NoteContext, padding};
|
||||
use crate::{
|
||||
@@ -138,7 +138,7 @@ fn search_box(query: &mut SearchQueryState, ui: &mut egui::Ui) -> bool {
|
||||
let search_container = egui::Frame {
|
||||
inner_margin: egui::Margin::symmetric(8, 0),
|
||||
outer_margin: egui::Margin::ZERO,
|
||||
rounding: Rounding::same(18), // More rounded corners
|
||||
corner_radius: CornerRadius::same(18), // More rounded corners
|
||||
shadow: Default::default(),
|
||||
fill: Color32::from_rgb(30, 30, 30), // Darker background to match screenshot
|
||||
stroke: Stroke::new(1.0, Color32::from_rgb(60, 60, 60)),
|
||||
|
||||
Reference in New Issue
Block a user