Merge add keys section to settings by kernel #1096

kernelkind (4):
      add `AnimationHelper::scaled_rect`
      add copy to clipboard img
      make eye button public
      add keys section to settings
This commit is contained in:
William Casarin
2025-09-02 15:09:11 -07:00
5 changed files with 187 additions and 5 deletions

View File

@@ -1,4 +1,4 @@
use egui::{Pos2, Rect, Response, Sense};
use egui::{vec2, Pos2, Rect, Response, Sense};
pub fn hover_expand(
ui: &mut egui::Ui,
@@ -116,6 +116,16 @@ impl AnimationHelper {
self.rect
}
pub fn scaled_rect(&self) -> egui::Rect {
let min_height = self.rect.height() * (1.0 / self.expansion_multiple);
let min_width = self.rect.width() * (1.0 / self.expansion_multiple);
egui::Rect::from_center_size(
self.center,
vec2(self.scale_1d_pos(min_width), self.scale_1d_pos(min_height)),
)
}
pub fn center(&self) -> Pos2 {
self.rect.center()
}

View File

@@ -244,3 +244,13 @@ pub fn zap_light_image() -> Image<'static> {
pub fn like_image() -> Image<'static> {
Image::new(include_image!("../../../assets/icons/like_icon_4x.png"))
}
pub fn copy_to_clipboard_image() -> Image<'static> {
Image::new(include_image!(
"../../../assets/icons/copy-to-clipboard.svg"
))
}
pub fn copy_to_clipboard_dark_image() -> Image<'static> {
copy_to_clipboard_image().tint(Color32::BLACK)
}