feat(ui-egui): add distinct Photoshop-style icons for adjustment layers (#9038)

# Conflicts:
#	ATTRIBUTION.md
#	contributors/people.toml
#	crates/ui-egui/src/icon_data.rs
#	crates/ui-egui/src/lib.rs
#	crates/ui-egui/src/panels.rs
This commit is contained in:
kobaltgit committed 2026-11-27 12:50:27 +02:00
1 parent 405b56c3c2
commit f87a71eaa8
24 files changed
+369 -19

No files matched your search

+3 -1
View File
@@ -35,7 +35,7 @@ next to them.
| `epaint_default_fonts::EGUI_ICONS` (build input; deflated into `OUT_DIR/egui_fonts/egui-icons.ttf.deflate`, registered by `crates/ui-egui/src/egui_fonts.rs`) | egui-icons, five-glyph subset of emoji-icon-font | John Slegers | [egui fork at 6d518fc](https://github.com/storytold/egui/tree/6d518fc799681571963842f95b55a6b68431b15a/crates/epaint_default_fonts/fonts), [original](https://github.com/jslegers/emoji-icon-font); egui subset, unmodified here | MIT; Copyright (c) 2014 John Slegers; full upstream notice in [NOTICE](NOTICE) |
| `assets/fonts/Inter-Regular.ttf`, `Inter-Medium.ttf`, `Inter-SemiBold.ttf` | Inter 4.001 (UI font) | The Inter Project Authors (Rasmus Andersson) | <https://github.com/rsms/inter> | SIL OFL 1.1, [`assets/fonts/OFL-Inter.txt`](assets/fonts/OFL-Inter.txt) |
| `assets/fonts/JetBrainsMono-Regular.ttf` | JetBrains Mono 2.305 (numeric font) | The JetBrains Mono Project Authors | <https://github.com/JetBrains/JetBrainsMono> | SIL OFL 1.1, [`assets/fonts/OFL-JetBrainsMono.txt`](assets/fonts/OFL-JetBrainsMono.txt) |
| `assets/icons/*.svg` except `slice-knife.svg`, `slice-select.svg`, `font-similar.svg`, `font-variable.svg`, `sampler.svg`, `artboard.svg`, `perspective-crop.svg`, `frame-placeholder.svg`, `ellipse-dashed.svg`, `gradient.svg`, `type-mask.svg`, `type-mask-vertical.svg`, `text-warp.svg`, `clip-below.svg`, `clip-release.svg`, `layer-mask.svg`, `adjustment-layer.svg`, `brush-replace.svg`, `history-brush.svg`, `quick-selection.svg`, `eraser-background.svg`, `eraser-magic.svg`, `lasso-magnetic.svg`, `direct-select.svg`, `convert-point.svg`, `pen-add-anchor.svg`, `pen-delete-anchor.svg`, `pen-freeform.svg`, `pen-curvature.svg`, `bandage-sparkle.svg`, `painting-symmetry.svg`, `symmetry-*.svg`, `path-op-*.svg` and `marquee-{row,column}.svg`, `align-edge-*.svg` and `distribute-*.svg`, `crop-overlay-*.svg` (113 files; `star-filled.svg` is `star.svg` with a solid fill) | Lucide icons | Lucide Icons and Contributors | <https://github.com/lucide-icons/lucide> (`icons/<name>.svg`; `align-*` are now named `text-align-*` upstream) | ISC, [`assets/icons/LICENSE-lucide.txt`](assets/icons/LICENSE-lucide.txt) |
| `assets/icons/*.svg` except `slice-knife.svg`, `slice-select.svg`, `font-similar.svg`, `font-variable.svg`, `sampler.svg`, `artboard.svg`, `perspective-crop.svg`, `frame-placeholder.svg`, `ellipse-dashed.svg`, `gradient.svg`, `type-mask.svg`, `type-mask-vertical.svg`, `text-warp.svg`, `clip-below.svg`, `clip-release.svg`, `layer-mask.svg`, `adjustment-layer.svg`, `brush-replace.svg`, `history-brush.svg`, `quick-selection.svg`, `eraser-background.svg`, `eraser-magic.svg`, `lasso-magnetic.svg`, `direct-select.svg`, `convert-point.svg`, `pen-add-anchor.svg`, `pen-delete-anchor.svg`, `pen-freeform.svg`, `pen-curvature.svg`, `bandage-sparkle.svg`, `painting-symmetry.svg`, `symmetry-*.svg`, `path-op-*.svg` and `marquee-{row,column}.svg`, `brightness-contrast.svg`, `levels.svg`, `curves.svg`, `exposure.svg`, `vibrance.svg`, `hue-saturation.svg`, `black-white.svg`, `photo-filter.svg`, `channel-mixer.svg`, `color-lookup.svg`, `invert.svg`, `posterize.svg`, `threshold.svg`, `selective-color.svg`, `gradient-map.svg`, `scale.svg`, `align-edge-*.svg` and `distribute-*.svg`, `crop-overlay-*.svg` (113 files; `star-filled.svg` is `star.svg` with a solid fill) | Lucide icons | Lucide Icons and Contributors | <https://github.com/lucide-icons/lucide> (`icons/<name>.svg`; `align-*` are now named `text-align-*` upstream) | ISC, [`assets/icons/LICENSE-lucide.txt`](assets/icons/LICENSE-lucide.txt) |
| `assets/icons/{check,chevron-down,chevron-left,chevron-right,chevron-up,chevrons-left,chevrons-right,circle,clock,compass,info,link,link-2,lock,minus,monitor,moon,move,navigation,plus,search,square,trash,triangle,type,x,zoom-in}.svg` | Lucide icons derived from Feather (subset of the row above) | Cole Bemis (Feather), Lucide Contributors | <https://github.com/feathericons/feather> via Lucide | MIT (Feather) and ISC (Lucide), [`assets/icons/LICENSE-lucide.txt`](assets/icons/LICENSE-lucide.txt) |
| `assets/icons/slice-knife.svg` | Slice tool glyph | PhotoCraft contributors | Original work | MIT OR Apache-2.0 |
| `assets/icons/slice-select.svg` | Slice Select tool glyph | PhotoCraft contributors | Original work | MIT OR Apache-2.0 |
@@ -55,6 +55,8 @@ next to them.
| `assets/icons/ellipse-dashed.svg` | Elliptical Marquee tool glyph: a dashed horizontal ellipse, drawn on Lucide's 24 px grid and stroke | PhotoCraft contributors | Original work | MIT OR Apache-2.0 |
| `assets/icons/frame-placeholder.svg` | Frame tool glyph: an empty placeholder frame, crossed corner to corner | PhotoCraft contributors | Original work | MIT OR Apache-2.0 |
| `assets/icons/gradient.svg` | Gradient tool glyph: a rounded rectangle filled with a left-to-right linear ramp, drawn on Lucide's 24 px grid and stroke | PhotoCraft contributors | Original work | MIT OR Apache-2.0 |
| `assets/icons/{brightness-contrast,levels,curves,exposure,vibrance,hue-saturation,black-white,photo-filter,channel-mixer,color-lookup,invert,posterize,threshold,selective-color,gradient-map}.svg` | Adjustment layer thumbnail glyphs for the Layers panel (Brightness/Contrast, Levels, Curves, Exposure, Vibrance, Hue/Saturation, Black & White, Photo Filter, Channel Mixer, Color Lookup, Invert, Posterize, Threshold, Selective Color, Gradient Map), drawn on Lucide's 24 px grid and stroke | PhotoCraft contributors | Original work | MIT OR Apache-2.0 |
| `assets/icons/scale.svg` | Color Balance adjustment layer glyph: Lucide balance scale icon | Lucide Icons and Contributors | <https://github.com/lucide-icons/lucide> `icons/scale.svg` | ISC, [`assets/icons/LICENSE-lucide.txt`](assets/icons/LICENSE-lucide.txt) |
| `assets/icons/eraser-background.svg`, `assets/icons/eraser-magic.svg` | Background Eraser and Magic Eraser tool glyphs: Lucide `eraser` plus added marks | Lucide Icons and Contributors; marks by PhotoCraft contributors | Derived from <https://github.com/lucide-icons/lucide> `icons/eraser.svg` | ISC, [`assets/icons/LICENSE-lucide.txt`](assets/icons/LICENSE-lucide.txt) |
| `assets/icons/brush-replace.svg` | Color Replacement tool glyph: Lucide `brush` plus two swap arrows | Lucide Icons and Contributors; arrows by PhotoCraft contributors | Derived from <https://github.com/lucide-icons/lucide> `icons/brush.svg` | ISC, [`assets/icons/LICENSE-lucide.txt`](assets/icons/LICENSE-lucide.txt) |
| `assets/icons/history-brush.svg` | History Brush tool glyph: Lucide `brush` plus counter-clockwise history rewind arrow | Lucide Icons and Contributors; arrow by PhotoCraft contributors | Derived from <https://github.com/lucide-icons/lucide> `icons/brush.svg` | ISC, [`assets/icons/LICENSE-lucide.txt`](assets/icons/LICENSE-lucide.txt) |
+15
View File
@@ -0,0 +1,15 @@
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="1.75"
stroke-linecap="round"
stroke-linejoin="round"
>
<rect width="18" height="18" x="3" y="3" rx="1.5" />
<line x1="12" y1="3" x2="12" y2="21" stroke-width="2" />
<path d="M4 3h8v18H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1z" fill="currentColor" stroke="none" />
</svg>

After

Width:  |  Height:  |  Size: 417 B

+22
View File
@@ -0,0 +1,22 @@
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<circle cx="12" cy="12" r="5" />
<path d="M12 7a5 5 0 0 1 0 10z" fill="currentColor" stroke="none" />
<line x1="12" y1="1" x2="12" y2="4" />
<line x1="12" y1="20" x2="12" y2="23" />
<line x1="4.22" y1="4.22" x2="6.34" y2="6.34" />
<line x1="17.66" y1="17.66" x2="19.78" y2="19.78" />
<line x1="1" y1="12" x2="4" y2="12" />
<line x1="20" y1="12" x2="23" y2="12" />
<line x1="4.22" y1="19.78" x2="6.34" y2="17.66" />
<line x1="17.66" y1="6.34" x2="19.78" y2="4.22" />
</svg>

After

Width:  |  Height:  |  Size: 694 B

+11
View File
@@ -0,0 +1,11 @@
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
>
<circle cx="12" cy="8.5" r="5" fill="currentColor" fill-opacity="0.45" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" />
<circle cx="8" cy="15.5" r="5" fill="currentColor" fill-opacity="0.2" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" />
<circle cx="16" cy="15.5" r="5" fill="currentColor" fill-opacity="0.7" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" />
</svg>

After

Width:  |  Height:  |  Size: 608 B

+20
View File
@@ -0,0 +1,20 @@
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
>
<rect x="3" y="4.5" width="6" height="5" fill="currentColor" fill-opacity="0.35" />
<path
d="M4.5 4.5h15c.8 0 1.5.7 1.5 1.5v12c0 .8-.7 1.5-1.5 1.5h-15c-.8 0-1.5-.7-1.5-1.5V6c0-.8.7-1.5 1.5-1.5z"
stroke="currentColor"
stroke-width="1.75"
stroke-linecap="round"
stroke-linejoin="round"
/>
<line x1="9" y1="4.5" x2="9" y2="19.5" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" />
<line x1="15" y1="4.5" x2="15" y2="19.5" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" />
<line x1="3" y1="9.5" x2="21" y2="9.5" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" />
<line x1="3" y1="14.5" x2="21" y2="14.5" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" />
</svg>

After

Width:  |  Height:  |  Size: 963 B

+18
View File
@@ -0,0 +1,18 @@
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="1.75"
stroke-linecap="round"
stroke-linejoin="round"
>
<rect width="18" height="18" x="3" y="3" rx="1.5" />
<line x1="9" y1="3" x2="9" y2="21" stroke-width="1" stroke-opacity="0.6" />
<line x1="15" y1="3" x2="15" y2="21" stroke-width="1" stroke-opacity="0.6" />
<line x1="3" y1="9" x2="21" y2="9" stroke-width="1" stroke-opacity="0.6" />
<line x1="3" y1="15" x2="21" y2="15" stroke-width="1" stroke-opacity="0.6" />
<path d="M4 20 C 8 20, 10 14, 12 12 C 14 10, 16 4, 20 4" stroke-width="2.5" />
</svg>

After

Width:  |  Height:  |  Size: 663 B

+13
View File
@@ -0,0 +1,13 @@
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
>
<path d="M13 16h4" stroke="currentColor" stroke-width="2" stroke-linecap="round" />
<path
d="M21.2 2.8c-.4-.4-1-.7-1.7-.7h-15c-1.3 0-2.4 1.1-2.4 2.4v15c0 .6.2 1.2.7 1.7s1.1.7 1.7.7h15c1.3 0 2.4-1.1 2.4-2.4v-15c0-.6-.3-1.2-.7-1.7zM6.3 6.9h1v-1c0-.6.4-1 1-1s1 .4 1 1v1h1c.6 0 1 .4 1 1 0 .6-.4 1-1 1h-1v1c0 .6-.4 1-1 1s-1-.4-1-1v-1h-1c-.6 0-1-.4-1-1 .1-.6.5-1 1.1-1zm13.8 12.6c0 .3-.3.6-.6.6h-15c-.2 0-.3-.1-.4-.2L19.9 4c.1.1.2.3.2.4v15.1z"
fill="currentColor"
/>
</svg>

After

Width:  |  Height:  |  Size: 589 B

+20
View File
@@ -0,0 +1,20 @@
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="1.75"
stroke-linecap="round"
stroke-linejoin="round"
>
<defs>
<linearGradient id="gm-grad" x1="3" y1="0" x2="21" y2="0" gradientUnits="userSpaceOnUse">
<stop offset="0%" stop-color="currentColor" stop-opacity="1" />
<stop offset="100%" stop-color="currentColor" stop-opacity="0" />
</linearGradient>
</defs>
<rect width="18" height="18" x="3" y="3" rx="1.5" />
<rect width="18" height="18" x="3" y="3" rx="1.5" fill="url(#gm-grad)" stroke="none" />
</svg>

After

Width:  |  Height:  |  Size: 633 B

+25
View File
@@ -0,0 +1,25 @@
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="1.75"
stroke-linecap="round"
stroke-linejoin="round"
>
<defs>
<linearGradient id="hs-grad" x1="3" y1="0" x2="21" y2="0" gradientUnits="userSpaceOnUse">
<stop offset="0%" stop-color="currentColor" stop-opacity="0.9" />
<stop offset="100%" stop-color="currentColor" stop-opacity="0.1" />
</linearGradient>
</defs>
<rect width="18" height="14" x="3" y="5" rx="1.5" />
<line x1="3" y1="12" x2="21" y2="12" />
<line x1="6.6" y1="5" x2="6.6" y2="12" stroke-width="1.2" />
<line x1="10.2" y1="5" x2="10.2" y2="12" stroke-width="1.2" />
<line x1="13.8" y1="5" x2="13.8" y2="12" stroke-width="1.2" />
<line x1="17.4" y1="5" x2="17.4" y2="12" stroke-width="1.2" />
<rect width="18" height="7" x="3" y="12" fill="url(#hs-grad)" stroke="none" />
</svg>

After

Width:  |  Height:  |  Size: 928 B

+12
View File
@@ -0,0 +1,12 @@
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
>
<path
d="M8.5 8.5l7.1 7.1c2-2 2-5.1 0-7.1s-5.2-1.9-7.1 0z M19.5 2.1h-15c-.6 0-1.2.3-1.7.7-.4.4-.7 1-.7 1.7v15c0 1.3 1.1 2.4 2.4 2.4h15c.6 0 1.2-.2 1.7-.7.5-.5.7-1.1.7-1.7v-15c0-1.4-1.1-2.5-2.4-2.5z M20.1 19.5c0 .2-.1.3-.2.4l-4.4-4.4c-2 1.9-5.1 1.9-7.1 0s-2-5.1 0-7.1L4 4.1c.1-.1.3-.2.4-.2h15c.3 0 .6.3.6.6v15z"
fill="currentColor"
/>
</svg>

After

Width:  |  Height:  |  Size: 460 B

+16
View File
@@ -0,0 +1,16 @@
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="1.75"
stroke-linecap="round"
stroke-linejoin="round"
>
<path
d="M3 20h18V12l-2 3-1.5-6-2 7-2.5-10-2 6-2-8-2 6-2-2-2 4z"
fill="currentColor"
/>
</svg>

After

Width:  |  Height:  |  Size: 311 B

+12
View File
@@ -0,0 +1,12 @@
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
>
<path
d="M18 11.7c-3 0-5.5 2.5-5.5 5.5s2.5 5.5 5.5 5.5 5.5-2.5 5.5-5.5-2.5-5.5-5.5-5.5zm0 9c-1.9 0-3.5-1.6-3.5-3.5s1.6-3.5 3.5-3.5 3.5 1.6 3.5 3.5-1.6 3.5-3.5 3.5zM9.6 7.5c-1.6 0-2.9 1.3-2.9 2.9s1.3 2.9 2.9 2.9 2.9-1.3 2.9-2.9-1.3-2.9-2.9-2.9zm8.4 3.7c.3 0 .5 0 .8.1V5c0-1-.8-1.8-1.8-1.8H14l-1.7-1.8H6.9L5.2 3.2H2.4C1.4 3.2.5 4 .5 5v10.9c0 1 .8 1.8 1.8 1.8H12c0-.2 0-.4 0-.5 0-3.4 2.7-6 6-6zm-12.9-.8c0-2.5 2-4.5 4.5-4.5s4.5 2 4.5 4.5-2 4.5-4.5 4.5-4.5-2.1-4.5-4.5z"
fill="currentColor"
/>
</svg>

After

Width:  |  Height:  |  Size: 616 B

+16
View File
@@ -0,0 +1,16 @@
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="1.75"
stroke-linecap="round"
stroke-linejoin="round"
>
<rect width="18" height="18" x="3" y="3" rx="1.5" />
<path d="M3 15 C 8 13, 12 9, 18 3" stroke-width="2" />
<path d="M6 21 C 12 15, 16 11, 21 9" stroke-width="2" />
<path d="M3 15 C 8 13, 12 9, 18 3 L21 3 L21 9 C 16 11, 12 15, 6 21 L3 21 Z" fill="currentColor" fill-opacity="0.3" stroke="none" />
</svg>

After

Width:  |  Height:  |  Size: 516 B

+17
View File
@@ -0,0 +1,17 @@
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="m16 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z" />
<path d="m2 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z" />
<path d="M7 21h10" />
<path d="M12 3v18" />
<path d="M3 7h2c2 0 5-1 7-2 2 1 5 2 7 2h2" />
</svg>

After

Width:  |  Height:  |  Size: 431 B

+17
View File
@@ -0,0 +1,17 @@
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="1.75"
stroke-linecap="round"
stroke-linejoin="round"
>
<rect width="18" height="18" x="3" y="3" rx="1.5" />
<line x1="3" y1="3" x2="21" y2="21" />
<line x1="3" y1="21" x2="21" y2="3" />
<path d="M3 3 L12 12 L3 21 Z" fill="currentColor" fill-opacity="0.35" stroke="none" />
<path d="M21 3 L12 12 L21 21 Z" fill="currentColor" fill-opacity="0.35" stroke="none" />
</svg>

After

Width:  |  Height:  |  Size: 528 B

+19
View File
@@ -0,0 +1,19 @@
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="1.75"
stroke-linecap="round"
stroke-linejoin="round"
>
<rect width="18" height="18" x="3" y="3" rx="1.5" />
<path
d="M3 18 h3 v-3 h4 v-3 h4 v-3 h4 v-3 h3 v15 H3 z"
fill="currentColor"
stroke="none"
/>
<path d="M3 18h3v-3h4v-3h4v-3h4v-3h3" stroke-width="2" />
</svg>

After

Width:  |  Height:  |  Size: 435 B

+14
View File
@@ -0,0 +1,14 @@
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M3 4h18L12 21z" />
<circle cx="12" cy="10" r="3.5" fill="currentColor" stroke="none" />
</svg>

After

Width:  |  Height:  |  Size: 309 B

+2
View File
@@ -311,4 +311,6 @@ sync_github_name = false
[people.davidvhk]
real_name = "David Vanhoucke"
[people.kobaltgit]
sync_github_name = true
@@ -0,0 +1,32 @@
use crate::icons;
use crate::panels::adjustment_icon;
use photocraft_doc::Adjustment;
/// Verifies that every `Adjustment` variant maps to an existing registered icon in `icon_data`.
#[test]
fn every_adjustment_kind_has_a_registered_icon() {
let adjustments = [
Adjustment::BrightnessContrast { brightness: 0.0, contrast: 0.0, legacy: false },
Adjustment::Levels { master: Default::default(), per_channel: Default::default(), space: Default::default(), black: Default::default() },
Adjustment::Curves { master: Vec::new(), per_channel: Default::default(), space: Default::default(), black: Vec::new(), pencil: false },
Adjustment::Exposure { exposure: 0.0, offset: 0.0, gamma: 1.0 },
Adjustment::Vibrance { vibrance: 0.0, saturation: 0.0 },
Adjustment::default_hue_saturation(),
Adjustment::ColorBalance { shadows: [0.0; 3], midtones: [0.0; 3], highlights: [0.0; 3], preserve_luminosity: true },
Adjustment::BlackWhite { weights: [0.0; 6], tint: None },
Adjustment::PhotoFilter { color: [0.0; 3], density: 0.25, preserve_luminosity: true },
Adjustment::ChannelMixer { matrix: [[0.0; 4]; 3], monochrome: false },
Adjustment::ColorLookup { name: "test".into(), lut: None, size: 0, tetrahedral: false, dither: false },
Adjustment::Invert,
Adjustment::Posterize { levels: 4 },
Adjustment::Threshold { level: 128.0 },
Adjustment::GradientMap { stops: Vec::new(), reverse: false, dither: false },
Adjustment::SelectiveColor { relative: false, adjustments: [[0.0; 4]; 9] },
Adjustment::Unsupported { psd_key: "test".into(), raw: std::sync::Arc::new([]) },
];
for adj in &adjustments {
let icon_name = adjustment_icon(adj);
assert!(icons::exists(icon_name), "Icon '{icon_name}' for adjustment '{}' must be registered in icons map", adj.label());
}
}
+16
View File
@@ -26,10 +26,13 @@ pub static ICONS: &[(&str, &[u8])] = &[
("ban", include_bytes!("../../../assets/icons/ban.svg")),
("bandage", include_bytes!("../../../assets/icons/bandage.svg")),
("bandage-sparkle", include_bytes!("../../../assets/icons/bandage-sparkle.svg")),
("black-white", include_bytes!("../../../assets/icons/black-white.svg")),
("blend", include_bytes!("../../../assets/icons/blend.svg")),
("brightness-contrast", include_bytes!("../../../assets/icons/brightness-contrast.svg")),
("brush", include_bytes!("../../../assets/icons/brush.svg")),
("brush-replace", include_bytes!("../../../assets/icons/brush-replace.svg")),
("brush-cleaning", include_bytes!("../../../assets/icons/brush-cleaning.svg")),
("channel-mixer", include_bytes!("../../../assets/icons/channel-mixer.svg")),
("check", include_bytes!("../../../assets/icons/check.svg")),
("chevron-down", include_bytes!("../../../assets/icons/chevron-down.svg")),
("chevron-left", include_bytes!("../../../assets/icons/chevron-left.svg")),
@@ -44,6 +47,7 @@ pub static ICONS: &[(&str, &[u8])] = &[
("clip-release", include_bytes!("../../../assets/icons/clip-release.svg")),
("clock", include_bytes!("../../../assets/icons/clock.svg")),
("cloud", include_bytes!("../../../assets/icons/cloud.svg")),
("color-lookup", include_bytes!("../../../assets/icons/color-lookup.svg")),
("compass", include_bytes!("../../../assets/icons/compass.svg")),
("contrast", include_bytes!("../../../assets/icons/contrast.svg")),
// PhotoCraft original: the Convert Point tool glyph.
@@ -57,6 +61,7 @@ pub static ICONS: &[(&str, &[u8])] = &[
("crop-overlay-grid", include_bytes!("../../../assets/icons/crop-overlay-grid.svg")),
("crop-overlay-thirds", include_bytes!("../../../assets/icons/crop-overlay-thirds.svg")),
("crop-overlay-triangle", include_bytes!("../../../assets/icons/crop-overlay-triangle.svg")),
("curves", include_bytes!("../../../assets/icons/curves.svg")),
("diamond", include_bytes!("../../../assets/icons/diamond.svg")),
("direct-select", include_bytes!("../../../assets/icons/direct-select.svg")),
("droplet", include_bytes!("../../../assets/icons/droplet.svg")),
@@ -67,6 +72,7 @@ pub static ICONS: &[(&str, &[u8])] = &[
// Derived from Lucide's eraser (ISC): with a sparkle (Magic Eraser) / a transparency grid (Background Eraser).
("eraser-background", include_bytes!("../../../assets/icons/eraser-background.svg")),
("eraser-magic", include_bytes!("../../../assets/icons/eraser-magic.svg")),
("exposure", include_bytes!("../../../assets/icons/exposure.svg")),
("eye", include_bytes!("../../../assets/icons/eye.svg")),
("eye-off", include_bytes!("../../../assets/icons/eye-off.svg")),
("file", include_bytes!("../../../assets/icons/file.svg")),
@@ -79,18 +85,22 @@ pub static ICONS: &[(&str, &[u8])] = &[
("gauge", include_bytes!("../../../assets/icons/gauge.svg")),
// PhotoCraft original: the Gradient tool glyph (a rectangle filled with a linear ramp).
("gradient", include_bytes!("../../../assets/icons/gradient.svg")),
("gradient-map", include_bytes!("../../../assets/icons/gradient-map.svg")),
("grid-2x2", include_bytes!("../../../assets/icons/grid-2x2.svg")),
("grid-3x3", include_bytes!("../../../assets/icons/grid-3x3.svg")),
("hand", include_bytes!("../../../assets/icons/hand.svg")),
("history-brush", include_bytes!("../../../assets/icons/history-brush.svg")),
("house", include_bytes!("../../../assets/icons/house.svg")),
("hue-saturation", include_bytes!("../../../assets/icons/hue-saturation.svg")),
("image", include_bytes!("../../../assets/icons/image.svg")),
("info", include_bytes!("../../../assets/icons/info.svg")),
("invert", include_bytes!("../../../assets/icons/invert.svg")),
("lasso", include_bytes!("../../../assets/icons/lasso.svg")),
("lasso-magnetic", include_bytes!("../../../assets/icons/lasso-magnetic.svg")),
("lasso-select", include_bytes!("../../../assets/icons/lasso-select.svg")),
("layer-mask", include_bytes!("../../../assets/icons/layer-mask.svg")),
("layers", include_bytes!("../../../assets/icons/layers.svg")),
("levels", include_bytes!("../../../assets/icons/levels.svg")),
("link", include_bytes!("../../../assets/icons/link.svg")),
("link-2", include_bytes!("../../../assets/icons/link-2.svg")),
("lock", include_bytes!("../../../assets/icons/lock.svg")),
@@ -126,11 +136,13 @@ pub static ICONS: &[(&str, &[u8])] = &[
("pencil", include_bytes!("../../../assets/icons/pencil.svg")),
("pentagon", include_bytes!("../../../assets/icons/pentagon.svg")),
("perspective-crop", include_bytes!("../../../assets/icons/perspective-crop.svg")),
("photo-filter", include_bytes!("../../../assets/icons/photo-filter.svg")),
("pipette", include_bytes!("../../../assets/icons/pipette.svg")),
("play", include_bytes!("../../../assets/icons/play.svg")),
("pause", include_bytes!("../../../assets/icons/pause.svg")),
("plus", include_bytes!("../../../assets/icons/plus.svg")),
("pointer", include_bytes!("../../../assets/icons/pointer.svg")),
("posterize", include_bytes!("../../../assets/icons/posterize.svg")),
("quick-selection", include_bytes!("../../../assets/icons/quick-selection.svg")),
("rectangle-horizontal", include_bytes!("../../../assets/icons/rectangle-horizontal.svg")),
("rectangle-vertical", include_bytes!("../../../assets/icons/rectangle-vertical.svg")),
@@ -138,11 +150,13 @@ pub static ICONS: &[(&str, &[u8])] = &[
("rotate-cw", include_bytes!("../../../assets/icons/rotate-cw.svg")),
("ruler", include_bytes!("../../../assets/icons/ruler.svg")),
("sampler", include_bytes!("../../../assets/icons/sampler.svg")),
("scale", include_bytes!("../../../assets/icons/scale.svg")),
("scaling", include_bytes!("../../../assets/icons/scaling.svg")),
("scan", include_bytes!("../../../assets/icons/scan.svg")),
("scan-line", include_bytes!("../../../assets/icons/scan-line.svg")),
("scissors", include_bytes!("../../../assets/icons/scissors.svg")),
("search", include_bytes!("../../../assets/icons/search.svg")),
("selective-color", include_bytes!("../../../assets/icons/selective-color.svg")),
("settings", include_bytes!("../../../assets/icons/settings.svg")),
("slash", include_bytes!("../../../assets/icons/slash.svg")),
("slice-knife", include_bytes!("../../../assets/icons/slice-knife.svg")),
@@ -169,6 +183,7 @@ pub static ICONS: &[(&str, &[u8])] = &[
("swatch-book", include_bytes!("../../../assets/icons/swatch-book.svg")),
("text-cursor", include_bytes!("../../../assets/icons/text-cursor.svg")),
("text-warp", include_bytes!("../../../assets/icons/text-warp.svg")),
("threshold", include_bytes!("../../../assets/icons/threshold.svg")),
("toggle-left", include_bytes!("../../../assets/icons/toggle-left.svg")),
("toggle-right", include_bytes!("../../../assets/icons/toggle-right.svg")),
("trash", include_bytes!("../../../assets/icons/trash.svg")),
@@ -180,6 +195,7 @@ pub static ICONS: &[(&str, &[u8])] = &[
("type-mask-vertical", include_bytes!("../../../assets/icons/type-mask-vertical.svg")),
("undo-2", include_bytes!("../../../assets/icons/undo-2.svg")),
("unlink", include_bytes!("../../../assets/icons/unlink.svg")),
("vibrance", include_bytes!("../../../assets/icons/vibrance.svg")),
("wand", include_bytes!("../../../assets/icons/wand.svg")),
("wand-sparkles", include_bytes!("../../../assets/icons/wand-sparkles.svg")),
("x", include_bytes!("../../../assets/icons/x.svg")),
+3
View File
@@ -930,3 +930,6 @@ mod saved_path_edit_tests;
#[cfg(test)]
mod pen_path_ownership_tests;
#[cfg(test)]
mod adjustment_icon_tests;
+1 -1
View File
@@ -85,7 +85,7 @@ pub(crate) use info::{SamplerReadouts, sampler_readouts};
use layer_drag::{background_drop_refused, layer_drop_payload};
pub(crate) use layer_drag::{dropped_on, layer_drag_edge_scroll};
#[cfg(test)]
pub(crate) use layer_row::thumb_load_badge;
pub(crate) use layer_row::{adjustment_icon, thumb_load_badge};
#[cfg(test)]
use layer_row::{layer_thumb_fit, paint_clipping_indicator};
pub(crate) use layers::{blend_options, fx_button};
+29 -1
View File
@@ -602,6 +602,30 @@ pub(super) fn layer_thumb_fit(cell: Rect, w: u32, h: u32) -> (Rect, Rect) {
crate::channels_panel::fit_thumb(cell, w, h)
}
/// The registered icon name matching Photoshop's adjustment layer glyph for `adj`.
pub(crate) fn adjustment_icon(adj: &photocraft_doc::Adjustment) -> &'static str {
use photocraft_doc::Adjustment;
match adj {
Adjustment::BrightnessContrast { .. } => "brightness-contrast",
Adjustment::Levels { .. } => "levels",
Adjustment::Curves { .. } => "curves",
Adjustment::Exposure { .. } => "exposure",
Adjustment::Vibrance { .. } => "vibrance",
Adjustment::HueSaturation { .. } => "hue-saturation",
Adjustment::ColorBalance { .. } => "scale",
Adjustment::BlackWhite { .. } => "black-white",
Adjustment::PhotoFilter { .. } => "photo-filter",
Adjustment::ChannelMixer { .. } => "channel-mixer",
Adjustment::ColorLookup { .. } => "color-lookup",
Adjustment::Invert => "invert",
Adjustment::Posterize { .. } => "posterize",
Adjustment::Threshold { .. } => "threshold",
Adjustment::GradientMap { .. } => "gradient-map",
Adjustment::SelectiveColor { .. } => "selective-color",
Adjustment::Unsupported { .. } => "adjustment-layer",
}
}
fn draw_layer_thumb(app: &mut PhotocraftApp, ctx: &egui::Context, ui: &egui::Ui, doc: &photocraft_doc::Document, l: &Layer, rect: Rect, selected: bool) {
let t = Tokens::get(ctx);
let p = ui.painter();
@@ -620,7 +644,11 @@ fn draw_layer_thumb(app: &mut PhotocraftApp, ctx: &egui::Context, ui: &egui::Ui,
return;
}
match &l.content {
LayerContent::Adjustment(_) | LayerContent::Group(_) => {
LayerContent::Adjustment(adj) => {
p.rect_filled(rect, 6.0, t.field);
icons::paint(ui, rect, adjustment_icon(adj), 18.0, t.icon);
}
LayerContent::Group(_) => {
p.rect_filled(rect, 6.0, t.field);
let icon = if l.is_group() { "folder" } else { "contrast" };
icons::paint(ui, rect, icon, 18.0, t.icon);
+16 -16
View File
@@ -217,22 +217,22 @@ pub(super) fn adjustments_grid(app: &mut PhotocraftApp, ui: &mut egui::Ui) {
ui.label(RichText::new(tl!("Add an adjustment")).color(t.text_dim));
ui.add_space(4.0);
let items: [(&str, &str, &str); 16] = [
("brightnessContrast", "sun", tl!("Brightness/Contrast")),
("levels", "gauge", tl!("Levels")),
("curves", "pen-tool", tl!("Curves")),
("exposure", "scan", tl!("Exposure")),
("vibrance", "sparkles", tl!("Vibrance")),
("hueSaturation", "droplet", tl!("Hue/Saturation")),
("colorBalance", "blend", tl!("Color Balance")),
("blackWhite", "contrast", tl!("Black & White")),
("photoFilter", "circle-dot", tl!("Photo Filter")),
("channelMixer", "sliders-horizontal", tl!("Channel Mixer")),
("invert", "squares-subtract", tl!("Invert")),
("posterize", "layers", tl!("Posterize")),
("threshold", "square", tl!("Threshold")),
("gradientMap", "palette", tl!("Gradient Map")),
("selectiveColor", "swatch-book", tl!("Selective Color")),
("colorLookup", "grid-3x3", tl!("Color Lookup")),
("brightnessContrast", "brightness-contrast", tl!("Brightness/Contrast")),
("levels", "levels", tl!("Levels")),
("curves", "curves", tl!("Curves")),
("exposure", "exposure", tl!("Exposure")),
("vibrance", "vibrance", tl!("Vibrance")),
("hueSaturation", "hue-saturation", tl!("Hue/Saturation")),
("colorBalance", "scale", tl!("Color Balance")),
("blackWhite", "black-white", tl!("Black & White")),
("photoFilter", "photo-filter", tl!("Photo Filter")),
("channelMixer", "channel-mixer", tl!("Channel Mixer")),
("invert", "invert", tl!("Invert")),
("posterize", "posterize", tl!("Posterize")),
("threshold", "threshold", tl!("Threshold")),
("gradientMap", "gradient-map", tl!("Gradient Map")),
("selectiveColor", "selective-color", tl!("Selective Color")),
("colorLookup", "color-lookup", tl!("Color Lookup")),
];
let mut run = None;
ui.horizontal_wrapped(|ui| {