Skip to content

Commit

Permalink
Update numerous symbols to Sfsymbols
Browse files Browse the repository at this point in the history
  • Loading branch information
SO9010 authored and SO9010 committed Sep 10, 2024
1 parent 3a2556f commit 22876d0
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 35 deletions.
6 changes: 3 additions & 3 deletions psst-gui/src/ui/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -349,8 +349,8 @@ fn volume_slider() -> impl Widget<AppState> {
}

fn topbar_sort_widget() -> impl Widget<AppState> {
let up_icon = icons::UP.scale((10.0, theme::grid(2.0)));
let down_icon = icons::DOWN.scale((10.0, theme::grid(2.0)));
let up_icon = icons::UP.scale((theme::grid(2.0), theme::grid(2.0)));
let down_icon = icons::DOWN.scale((theme::grid(2.0), theme::grid(2.0)));

let ascending_icon = up_icon
.padding(theme::grid(1.0))
Expand Down Expand Up @@ -393,7 +393,7 @@ fn topbar_sort_widget() -> impl Widget<AppState> {
}

fn topbar_back_button_widget() -> impl Widget<AppState> {
let icon = icons::BACK.scale((10.0, theme::grid(2.0)));
let icon = icons::BACK.scale((theme::grid(2.0), theme::grid(2.0)));
let disabled = icon
.clone()
.with_color(theme::GREY_600)
Expand Down
75 changes: 43 additions & 32 deletions psst-gui/src/widget/icons.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,41 +8,41 @@ pub static LOGO: SvgIcon = SvgIcon {
op: PaintOp::Fill,
};

// SF Pro Regular - gearshape
// SFSymbols - gear
pub static PREFERENCES: SvgIcon = SvgIcon {
svg_path: "M13.1035 23.208H14.8877C15.6172 23.208 16.1885 22.751 16.3643 22.0479L16.7158 20.5098L16.9443 20.4219L18.2891 21.2568C18.9043 21.6436 19.6338 21.5381 20.1523 21.0195L21.3828 19.7891C21.9102 19.2617 21.998 18.541 21.6113 17.9346L20.7764 16.5898L20.8643 16.3789L22.4023 16.0186C23.0967 15.8428 23.5537 15.2715 23.5537 14.542V12.8105C23.5537 12.0811 23.1055 11.5098 22.4023 11.334L20.873 10.9648L20.7852 10.7363L21.6201 9.40039C22.0068 8.79395 21.9189 8.07324 21.3916 7.53711L20.1611 6.30664C19.6514 5.78809 18.9219 5.69141 18.3066 6.06934L16.9619 6.89551L16.7158 6.80762L16.3643 5.26074C16.1885 4.55762 15.6172 4.10938 14.8877 4.10938H13.1035C12.3652 4.10938 11.7939 4.55762 11.627 5.26074L11.2754 6.80762L11.0293 6.89551L9.68457 6.06934C9.06055 5.69141 8.33984 5.78809 7.83008 6.30664L6.59082 7.53711C6.07227 8.07324 5.97559 8.79395 6.3623 9.40039L7.19727 10.7363L7.10938 10.9648L5.58887 11.334C4.88574 11.5098 4.4375 12.0811 4.4375 12.8105V14.542C4.4375 15.2715 4.89453 15.8428 5.58887 16.0186L7.12695 16.3789L7.20605 16.5898L6.37109 17.9346C5.98438 18.541 6.08105 19.2617 6.59961 19.7891L7.83887 21.0195C8.34863 21.5381 9.07812 21.6436 9.69336 21.2568L11.0381 20.4219L11.2754 20.5098L11.627 22.0479C11.7939 22.751 12.3652 23.208 13.1035 23.208ZM13.332 21.5908C13.1826 21.5908 13.1035 21.5293 13.0859 21.3975L12.5586 19.2354C12.0049 19.1035 11.4688 18.875 11.0381 18.6025L9.13965 19.7715C9.02539 19.8418 8.91992 19.833 8.81445 19.7275L7.8916 18.8047C7.78613 18.708 7.78613 18.6025 7.85645 18.4883L9.02539 16.5898C8.7793 16.168 8.55078 15.6406 8.41895 15.0869L6.24805 14.5684C6.11621 14.5508 6.0459 14.4717 6.0459 14.3223V13.0215C6.0459 12.8633 6.10742 12.8018 6.24805 12.7666L8.41016 12.2568C8.54199 11.668 8.79688 11.123 9.0166 10.7275L7.84766 8.84668C7.77734 8.72363 7.77734 8.61816 7.87402 8.5127L8.80566 7.59863C8.91113 7.50195 9.00781 7.48438 9.13965 7.56348L11.0205 8.71484C11.416 8.46875 12.0049 8.22266 12.5674 8.08203L13.0859 5.91992C13.1035 5.78809 13.1826 5.71777 13.332 5.71777H14.6592C14.8086 5.71777 14.8789 5.7793 14.9053 5.91992L15.4326 8.09082C16.0039 8.23145 16.5225 8.46875 16.9619 8.71484L18.8428 7.56348C18.9746 7.49316 19.0713 7.50195 19.1768 7.60742L20.1084 8.52148C20.2139 8.61816 20.2139 8.72363 20.1348 8.84668L18.9746 10.7275C19.1855 11.123 19.4492 11.668 19.5811 12.2568L21.7432 12.7666C21.8838 12.8018 21.9365 12.8633 21.9365 13.0215V14.3223C21.9365 14.4717 21.875 14.5508 21.7432 14.5684L19.5723 15.0869C19.4404 15.6406 19.2031 16.1768 18.957 16.5898L20.126 18.4795C20.1963 18.6025 20.1963 18.6992 20.0908 18.7959L19.168 19.7275C19.0625 19.833 18.957 19.8418 18.8428 19.7715L16.9531 18.6025C16.5137 18.875 16.0127 19.0947 15.4326 19.2354L14.9053 21.3975C14.8789 21.5293 14.8086 21.5908 14.6592 21.5908H13.332ZM14 16.9941C15.8281 16.9941 17.3311 15.4912 17.3311 13.6543C17.3311 11.835 15.8281 10.332 14 10.332C12.1631 10.332 10.6514 11.835 10.6514 13.6543C10.6514 15.4912 12.1631 16.9941 14 16.9941ZM14 15.4736C12.998 15.4736 12.1807 14.6562 12.1807 13.6543C12.1807 12.6699 13.0068 11.8525 14 11.8525C14.9756 11.8525 15.793 12.6699 15.793 13.6543C15.793 14.6475 14.9756 15.4736 14 15.4736Z",
svg_size: Size::new(28.0, 28.0),
op: PaintOp::Fill,
svg_path: "M12.5225 23.925C12.8909 23.925 13.3328 23.925 13.6275 23.85L14.2168 24.9C14.2905 25.125 14.4378 25.2 14.7324 25.125 15.0271 25.125 15.0271 24.975 15.1007 24.75L15.2481 23.55A9.675 9.5024 90 0017.3843 22.725L18.2682 23.55C18.4156 23.7 18.5629 23.7 18.7839 23.625S19.0049 23.4 19.0049 23.1L18.7839 21.975A10.35 10.1653 90 0020.5518 20.475L21.6567 20.925C21.8776 21.075 21.9514 21 22.1723 20.775 22.3933 20.55 22.3933 20.475 22.1723 20.25L21.583 19.2A11.1 10.902 90 0022.688 17.175L23.8665 17.25C24.1612 17.25 24.2348 17.175 24.3085 16.95 24.3822 16.725 24.3822 16.575 24.1612 16.425L23.2773 15.675C23.4983 14.925 23.5719 14.175 23.6455 13.425L24.7505 13.05C24.9715 12.975 25.0451 12.825 25.0451 12.6S24.9715 12.225 24.7505 12.15L23.6455 11.775A12.225 12.007 90 0023.2773 9.525L24.1612 8.775C24.3822 8.625 24.3822 8.55 24.3085 8.25 24.2348 8.025 24.1612 7.95 23.8665 7.95L22.688 8.025A11.475 11.2703 90 0021.583 6L22.1723 5.025C22.3197 4.8 22.3197 4.65 22.1723 4.5 21.9514 4.275 21.804 4.2 21.6567 4.35L20.5518 4.8A11.25 11.0493 90 0018.7839 3.3L19.0049 2.175C19.0785 1.875 19.0049 1.8 18.7839 1.65 18.4892 1.5 18.4156 1.5 18.2682 1.725L17.3843 2.4A11.1 10.902 90 0015.2481 1.65L15.1007.45C15.1007.15 14.9534.075 14.7324.075 14.4378.075 14.3642.075 14.2168.3L13.6275 1.425A12.45 12.2279 90 0012.5225 1.35C12.1542 1.35 11.7859 1.35 11.4177 1.425L10.8284.225C10.7546.075 10.6074 0 10.3127 0S10.0181.15 9.9444.375L9.797 1.65C9.0605 1.875 8.3238 2.1 7.6609 2.475L6.7769 1.725C6.5559 1.575 6.4823 1.575 6.2613 1.65 6.0403 1.725 6.0403 1.875 6.0403 2.175L6.2613 3.3A10.8 10.6074 90 004.4934 4.8L3.3884 4.35C3.1675 4.2 3.0938 4.275 2.7991 4.5 2.6518 4.65 2.6518 4.8 2.7991 5.025L3.4621 6.075A11.475 11.2703 90 002.3572 7.95L1.1786 7.875C.8839 7.875.8103 7.95.7366 8.175.5893 8.475.6629 8.55.8839 8.7L1.7679 9.45A13.125 12.8909 90 001.3996 11.7L.2946 12.075C0 12.15 0 12.225 0 12.525S.0736 12.9.2946 12.975L1.3996 13.35C1.4732 14.1 1.5469 14.925 1.7679 15.6L.8839 16.35C.6629 16.5.6629 16.575.7366 16.875.8103 17.1.8839 17.175 1.1786 17.175L2.3572 17.1C2.6518 17.775 3.0201 18.45 3.4621 19.125L2.8728 20.175C2.7255 20.4 2.7255 20.55 2.8728 20.7 3.0938 20.925 3.2411 21 3.4621 20.85L4.5671 20.4C5.0827 21 5.672 21.45 6.3349 21.9L6.114 23.025C6.0403 23.325 6.114 23.4 6.3349 23.55 6.6295 23.7 6.7033 23.625 6.8506 23.475L7.7345 22.65A10.8 10.6074 90 009.8708 23.475L10.0181 24.675C10.0181 24.975 10.0917 25.05 10.3863 25.05S10.7546 25.05 10.902 24.825L11.4913 23.775C11.8596 23.85 12.2279 23.85 12.5963 23.85ZM15.0271 12.3A2.55 2.5046 90 0012.5963 10.2 2.25 2.2099 90 0011.7123 10.425L7.4399 3.15A10.575 10.3863 90 0112.4489 1.875C18.1946 1.875 22.7616 6.45 22.909 12.3ZM2.1362 12.6C2.1362 8.7 4.0514 5.4 6.9242 3.525L11.0493 10.725A2.475 2.4308 90 0011.123 14.775L6.9979 21.825C4.0514 19.95 2.1362 16.575 2.1362 12.675ZM10.7546 12.675C10.7546 11.625 11.5649 10.8 12.5963 10.8 13.5538 10.8 14.4378 11.625 14.4378 12.675S13.6275 14.55 12.5963 14.55A1.875 1.8415 90 0110.7546 12.675ZM12.5225 23.4C10.7546 23.4 9.0605 22.95 7.5872 22.125L11.7123 15.075A2.625 2.5782 90 0012.5225 15.225C13.8485 15.225 14.8798 14.25 14.9534 12.975H22.909C22.7616 18.825 18.1946 23.4 12.4489 23.4Z",
svg_size: Size::new(25.0, 25.0),
op: PaintOp::Stroke,
};
// SF Pro Regular - key
// Sfsymbols - person.crop.circle
pub static ACCOUNT: SvgIcon = SvgIcon {
svg_path: "M13.332 24.3682C13.7363 24.7197 14.29 24.7637 14.6768 24.377L17.3926 21.6611C17.7705 21.2832 17.7529 20.6943 17.3838 20.3164L16.0918 19.0244L18.0078 17.1084C18.377 16.7393 18.377 16.1416 17.999 15.7637L16.25 14.0059C18.6318 12.8193 19.9678 10.8418 19.9678 8.5127C19.9678 5.2168 17.3047 2.55371 14 2.55371C10.6865 2.55371 8.03223 5.20801 8.03223 8.5127C8.03223 10.877 9.37695 12.9951 11.5215 13.9619V22.2061C11.5215 22.5225 11.6182 22.8828 11.8906 23.1201L13.332 24.3682ZM14 22.8037L13.0508 21.8545V12.8018C11.0469 12.3623 9.61426 10.6045 9.61426 8.5127C9.61426 6.0957 11.5654 4.14453 14 4.14453C16.4346 4.14453 18.377 6.0957 18.377 8.5127C18.377 10.5869 16.9355 12.3711 14.7383 12.8545V14.7617L16.4258 16.4492L14.624 18.2158V19.8066L15.8105 20.9756L14 22.8037ZM14 8.56543C14.8613 8.56543 15.5645 7.8623 15.5645 7.00098C15.5645 6.13965 14.8613 5.43652 14 5.43652C13.1299 5.43652 12.4355 6.13086 12.4355 7.00098C12.4355 7.8623 13.1387 8.56543 14 8.56543Z",
svg_path: "M12.5572 14.3821c2.4709 0 4.3597-2.1216 4.3597-4.8642.0129-2.5744-1.9405-4.7478-4.3597-4.7478-2.432 0-4.3596 2.1734-4.3596 4.7478 0 2.7426 1.8758 4.8642 4.3596 4.8642Zm0 2.238c-4.502 0-7.7879 2.2639-8.6546 3.9846C1.8844 18.4701.6555 15.5981.6555 12.4287.6555 5.8698 5.9854.5268 12.5572.5268c6.5589 0 11.9018 5.343 11.9018 11.9019 0 3.1565-1.229 6.0285-3.2342 8.163-.9185-1.7206-4.2044-3.9716-8.6676-3.9716Zm0 8.3571c6.8953 0 12.5357-5.6404 12.5357-12.5485 0-6.8953-5.6404-12.5357-12.5357-12.5357S.0216 5.5334.0216 12.4287c0 6.9081 5.6404 12.5485 12.5356 12.5485Z",
svg_size: Size::new(28.0, 28.0),
op: PaintOp::Fill,
op: PaintOp::Stroke,
};
// SF Pro Regular - internaldrive
// Sfsymbols - tray.full
pub static STORAGE: SvgIcon = SvgIcon {
svg_path: "M3.40039 17.2139C3.40039 19.5781 5.17578 21.3535 7.71582 21.3535H20.2842C22.8242 21.3535 24.5996 19.5781 24.5996 17.2139C24.5996 16.502 24.3975 15.8604 24.1514 15.2803L21.1279 8.19629C20.5127 6.74609 19.291 5.98145 17.6562 5.98145H10.3525C8.70898 5.98145 7.4873 6.74609 6.88086 8.19629L3.875 15.2451C3.62012 15.834 3.40039 16.4844 3.40039 17.2139ZM6.57324 13.2676L8.48926 8.5918C8.78809 7.83594 9.46484 7.44043 10.3701 7.44043H17.6299C18.5439 7.44043 19.2207 7.83594 19.5195 8.5918L21.4355 13.2676C21.084 13.1533 20.6973 13.083 20.2842 13.083H7.71582C7.30273 13.083 6.9248 13.1533 6.57324 13.2676ZM5.08789 17.2139C5.08789 15.8164 6.13379 14.7705 7.71582 14.7705H20.2842C21.8662 14.7705 22.9121 15.8164 22.9121 17.2139C22.9121 18.7607 21.8662 19.6572 20.2842 19.6572H7.71582C6.13379 19.6572 5.08789 18.6201 5.08789 17.2139ZM11.4512 18.084C11.4512 18.3828 11.6885 18.6113 11.9873 18.6113C12.2773 18.6113 12.5059 18.3828 12.5059 18.084V16.3525C12.5059 16.0625 12.2773 15.8252 11.9873 15.8252C11.6885 15.8252 11.4512 16.0625 11.4512 16.3525V18.084ZM13.4727 18.084C13.4727 18.3828 13.7012 18.6113 14 18.6113C14.29 18.6113 14.5273 18.3828 14.5273 18.084V16.3525C14.5273 16.0625 14.29 15.8252 14 15.8252C13.7012 15.8252 13.4727 16.0625 13.4727 16.3525V18.084ZM15.4854 18.084C15.4854 18.3828 15.7227 18.6113 16.0215 18.6113C16.3115 18.6113 16.5488 18.3828 16.5488 18.084V16.3525C16.5488 16.0625 16.3115 15.8252 16.0215 15.8252C15.7227 15.8252 15.4854 16.0625 15.4854 16.3525V18.084ZM17.5068 18.084C17.5068 18.3828 17.7441 18.6113 18.043 18.6113C18.333 18.6113 18.5703 18.3828 18.5703 18.084V16.3525C18.5703 16.0625 18.333 15.8252 18.043 15.8252C17.7441 15.8252 17.5068 16.0625 17.5068 16.3525V18.084ZM19.5283 18.084C19.5283 18.3828 19.7656 18.6113 20.0645 18.6113C20.3545 18.6113 20.583 18.3828 20.583 18.084V16.3525C20.583 16.0625 20.3545 15.8252 20.0645 15.8252C19.7656 15.8252 19.5283 16.0625 19.5283 16.3525V18.084Z",
svg_size: Size::new(28.0, 28.0),
op: PaintOp::Fill,
svg_path: "M22.2357 21.0197H2.8427c-1.8032 0-2.7643-.9934-2.7643-2.7751V12.4677c0-.5292.0756-.7559.3348-1.1014L5.0995 5.298c.799-1.0259 1.3282-1.285 2.6886-1.285H17.301c1.3498 0 1.8897.2592 2.6779 1.285l4.6971 6.0684c.2484.3455.3347.5723.3347 1.1014v5.7769c0 1.814-.961 2.7751-2.7751 2.7751Zm-9.6964-5.4314c1.7276 0 3.0774-1.3173 3.0774-3.1206v-.0864c0-.27.1295-.432.3994-.432H24.201c.1296 0 .1728-.1187.0863-.2267L19.4391 5.449c-.5291-.6586-1.0799-.9285-2.0192-.9285H7.6586c-.9395 0-1.4902.2699-2.0084.9285L.7803 11.7227c-.0756.108-.0432.2267.0972.2267H9.0623c.2699 0 .4104.162.4104.432v.0864c0 1.8032 1.3389 3.1206 3.0666 3.1206ZM7.6262 6.5505h9.8045c.162 0 .2807.108.2807.2807 0 .1728-.1187.2808-.2807.2808H7.6262c-.1511 0-.2699-.108-.2699-.2808 0-.1728.1188-.2807.2699-.2807ZM5.7906 9.2823H19.2663c.162 0 .2916.108.2916.2699 0 .162-.1296.2699-.2916.2699H5.7906c-.1511 0-.27-.108-.27-.2699 0-.162.1189-.2699.27-.2699ZM22.2142 20.4905c1.4901 0 2.2676-.7774 2.2676-2.2675V12.4569H16.1673c0 2.1703-1.6305 3.6389-3.628 3.6389-1.9869 0-3.6173-1.4901-3.6282-3.6389H.6076V18.223c0 1.4901.8314 2.2675 2.2676 2.2675Z",
svg_size: Size::new(25.0, 25.0),
op: PaintOp::Stroke,
};

// Sfsymbols - arrow.left
pub static BACK: SvgIcon = SvgIcon {
svg_path: "M9.70711 0.292893C10.0976 0.683417 10.0976 1.31658 9.70711 1.70711L2.41421 9L9.70711 16.2929C10.0976 16.6834 10.0976 17.3166 9.70711 17.7071C9.31658 18.0976 8.68342 18.0976 8.29289 17.7071L0.292893 9.70711C-0.0976311 9.31658 -0.0976311 8.68342 0.292893 8.29289L8.29289 0.292893C8.68342 -0.0976311 9.31658 -0.0976311 9.70711 0.292893Z",
svg_size: Size::new(10.0, 18.0),
op: PaintOp::Fill,
};

pub static DOWN: SvgIcon = SvgIcon {
svg_path: "m -3.7071056,4.292866 c 0.390524,-0.39049 1.023687,-0.39049 1.414217,0 l 7.2928898,7.2929 7.2928998,-7.2929 c 0.3905,-0.39049 1.0237,-0.39049 1.4142,0 0.3905,0.39053 0.3905,1.02369 0,1.41422 l -7.9999898,7.999997 c -0.39053,0.390525 -1.02369,0.390525 -1.41422,0 L -3.7071056,5.707086 c -0.390524,-0.39053 -0.390524,-1.02369 0,-1.41422 z",
svg_size: Size::new(10.0, 18.0),
op: PaintOp::Fill,
svg_path: "M25.2048 12.5084c0 .1936-.1505.3321-.3148.3321H3.9085L1.0069 12.799l2.8742 2.8767 6.1727 6.2376c.041.0415.0821.1384.0821.249 0 .166-.1368.3181-.3422.3181-.0958 0-.1642-.0277-.2326-.0967L.1036 12.7436c-.0685-.0552-.0958-.1244-.0958-.2351 0-.0967.0273-.1659.0958-.2212l9.4575-9.64c.0684-.0691.1368-.0968.2326-.0968.2054 0 .3422.1521.3422.3183 0 .0965-.0411.2073-.0821.2488L3.8811 9.3552 1.0069 12.2319l2.9016-.0415H24.89c.1643 0 .3148.1385.3148.3182Z",
svg_size: Size::new(25.0, 25.0),
op: PaintOp::Stroke,
};

pub static UP: SvgIcon = SvgIcon {
svg_path: "m 13.707083,13.707109 c -0.390524,0.39049 -1.023687,0.39049 -1.414217,0 L 4.9999761,6.4142094 -2.2929238,13.707109 c -0.3905,0.39049 -1.0237,0.39049 -1.4142,0 -0.3905,-0.39053 -0.3905,-1.02369 0,-1.41422 L 4.2928661,4.2928924 c 0.39053,-0.390525 1.02369,-0.390525 1.41422,0 l 7.9999969,7.9999966 c 0.390524,0.39053 0.390524,1.02369 0,1.41422 z",
svg_size: Size::new(10.0, 18.0),
op: PaintOp::Fill,
svg_path: "M12.4914 24.9848c.1797 0 .3182-.1505.3182-.3148V3.6885L12.7681.7869l2.8767 2.8742 6.2376 6.1727c.0415.041.1523.0821.2488.0821.1662 0 .3183-.1368.3183-.3422 0-.0958-.0277-.1642-.0968-.2326l-9.64-9.4575c-.0553-.0685-.1245-.0958-.2212-.0958-.1107 0-.1799.0273-.2351.0958L2.6163 9.3411c-.069.0684-.0967.1368-.0967.2326 0 .2054.1521.3422.3181.3422.1106 0 .2075-.0411.249-.0821L9.3243 3.6611 12.201.7869l-.0415 2.9016V24.67c0 .1643.1385.3148.3321.3148Z",
svg_size: Size::new(25.0, 25.0),
op: PaintOp::Stroke,
};

pub static DOWN: SvgIcon = SvgIcon {
svg_path: "M12.5086.0162c-.1797-0-.3182.1505-.3182.3148V21.3125l.0415 2.9016-2.8767-2.8742-6.2376-6.1727c-.0415-.041-.1523-.0821-.2488-.0821-.1662 0-.3183.1368-.3183.3422 0 .0958.0277.1642.0968.2326l9.64 9.4575c.0553.0685.1245.0958.2212.0958.1107 0 .1799-.0273.2351-.0958l9.6401-9.4575c.069-.0684.0967-.1368.0967-.2326 0-.2054-.1521-.3422-.3181-.3422-.1106 0-.2075.0411-.249.0821l-6.2376 6.1727-2.8767 2.8742.0415-2.9016V.331c0-.1643-.1385-.3148-.3321-.3148Z",
svg_size: Size::new(25.0, 25.0),
op: PaintOp::Stroke,
};

// SF Pro Regular - play.fill
Expand All @@ -51,6 +51,7 @@ pub static PLAY: SvgIcon = SvgIcon {
svg_size: Size::new(28.0, 28.0),
op: PaintOp::Fill,
};

// SF Pro Regular - pause.fill
pub static PAUSE: SvgIcon = SvgIcon {
svg_path: "M9.63184 20.9668H11.6973C12.5322 20.9668 12.9629 20.5361 12.9629 19.7012V7.60742C12.9629 6.75488 12.5322 6.35059 11.6973 6.3418H9.63184C8.79688 6.3418 8.36621 6.77246 8.36621 7.60742V19.7012C8.35742 20.5361 8.78809 20.9668 9.63184 20.9668ZM16.3115 20.9668H18.3682C19.2031 20.9668 19.6338 20.5361 19.6338 19.7012V7.60742C19.6338 6.75488 19.2031 6.3418 18.3682 6.3418H16.3115C15.4678 6.3418 15.0459 6.77246 15.0459 7.60742V19.7012C15.0459 20.5361 15.4678 20.9668 16.3115 20.9668Z",
Expand Down Expand Up @@ -94,11 +95,11 @@ pub static PLAY_LOOP_ALL: SvgIcon = SvgIcon {
op: PaintOp::Fill,
};

// Font awesome - reload
// Sfsymbols - arrow.2.circlepath
pub static RELOAD: SvgIcon = SvgIcon {
svg_path: "M13.5 2c-5.621 0-10.211 4.443-10.475 10h-3.025l5 6.625 5-6.625h-2.975c.257-3.351 3.06-6 6.475-6 3.584 0 6.5 2.916 6.5 6.5s-2.916 6.5-6.5 6.5c-1.863 0-3.542-.793-4.728-2.053l-2.427 3.216c1.877 1.754 4.389 2.837 7.155 2.837 5.79 0 10.5-4.71 10.5-10.5s-4.71-10.5-10.5-10.5z",
svg_size: Size::new(28.0, 28.0),
op: PaintOp::Fill,
svg_path: "M.3 12c-.3 0-.5.2-.2.6l2.2 3.2c.2.3.4.3.6 0l2.2-3.2c.2-.3.1-.6-.2-.6H2.7c.2-5.2 4.5-9.4 9.8-9.4 3.2 0 6 1.5 7.8 3.8.1.1.3.1.4.1.1-.1.1-.2 0-.4-1.9-2.4-4.9-4-8.2-4C7 2.1 2.4 6.5 2.2 12H.3Zm24.3 1c.3 0 .5-.2.2-.6L22.7 9.2c-.2-.3-.4-.3-.6 0l-2.2 3.2c-.2.3-.1.6.2.6h2.2c-.3 5.2-4.6 9.4-9.8 9.4-3.2 0-6-1.5-7.8-3.8-.1-.1-.2-.1-.4-.1-.1.1-.1.3 0 .4C6.2 21.4 9.2 23 12.5 23c5.5 0 10.1-4.4 10.3-9.9h1.8Z",
svg_size: Size::new(25.0, 25.0),
op: PaintOp::StrokeAndFill,
};

// SF Pro Regular - exclamationmark.circle
Expand All @@ -108,11 +109,11 @@ pub static ERROR: SvgIcon = SvgIcon {
op: PaintOp::Fill,
};

// SF Pro Regular - magnifyingglass.circle
// Sfsymbols - magnifyingglass.circle
pub static SEARCH: SvgIcon = SvgIcon {
svg_path: "M10.9912 19.7422C15.9746 19.7422 20.0879 15.6289 20.0879 10.6543C20.0879 5.67969 15.9658 1.56641 10.9824 1.56641C6.00781 1.56641 1.90332 5.67969 1.90332 10.6543C1.90332 15.6289 6.0166 19.7422 10.9912 19.7422ZM10.9912 17.9316C6.95703 17.9316 3.73145 14.6885 3.73145 10.6543C3.73145 6.62012 6.95703 3.38574 10.9824 3.38574C15.0166 3.38574 18.2598 6.62012 18.2686 10.6543C18.2773 14.6885 15.0254 17.9316 10.9912 17.9316ZM10.0771 13.3525C10.7539 13.3525 11.3955 13.168 11.9404 12.834L14.0498 14.9346C14.2344 15.1367 14.4541 15.2246 14.7178 15.2246C15.1924 15.2246 15.5352 14.873 15.5352 14.3809C15.5352 14.1611 15.4297 13.9502 15.2715 13.7832L13.1533 11.665C13.5225 11.0938 13.7334 10.417 13.7334 9.69629C13.7334 7.68359 12.0898 6.04004 10.0771 6.04004C8.07324 6.04004 6.4209 7.69238 6.4209 9.69629C6.4209 11.709 8.07324 13.3525 10.0771 13.3525ZM10.0771 12.043C8.79395 12.043 7.72168 10.9883 7.72168 9.69629C7.72168 8.41309 8.79395 7.34961 10.0771 7.34961C11.3691 7.34961 12.4238 8.4043 12.4238 9.69629C12.4238 10.9883 11.3691 12.043 10.0771 12.043Z",
svg_size: Size::new(22.0, 22.0),
op: PaintOp::Fill,
svg_path: "M19.5 9.7c0 2.3-.9 4.6-2.3 6.2l7.7 7.7c.1.1.2.3.2.5 0 .5-.4.7-.7.7-.2 0-.4 0-.5-.2L16.2 17c-1.7 1.5-4 2.5-6.4 2.5C4.4 19.5 0 15 0 9.7 0 4.3 4.4-.1 9.8-.1c5.3-0 9.7 4.4 9.7 9.8Zm-.7 0c0-5-4.1-9.1-9-9.1C4.8.6.6 4.7.6 9.7s4.2 9.1 9.2 9.1c4.9 0 9-4.1 9-9.1Z",
svg_size: Size::new(25.0, 25.0),
op: PaintOp::Stroke,
};
// SF Pro Regular - heart.circle
pub static HEART: SvgIcon = SvgIcon {
Expand Down Expand Up @@ -167,6 +168,8 @@ pub static CIRCLE_CHECK: SvgIcon = SvgIcon {
#[derive(Copy, Clone)]
pub enum PaintOp {
Fill,
Stroke,
StrokeAndFill,
}

#[derive(Clone)]
Expand Down Expand Up @@ -231,10 +234,18 @@ impl<T> Widget<T> for Icon {

fn paint(&mut self, ctx: &mut PaintCtx, _data: &T, env: &Env) {
let color = self.color.resolve(env);
let stroke_width = theme::grid(0.15);
ctx.with_save(|ctx| {
ctx.transform(self.scale);
match self.op {
PaintOp::Fill => ctx.fill(&self.bez_path, &color),
PaintOp::Stroke => {
ctx.stroke(&self.bez_path, &color, stroke_width);
},
PaintOp::StrokeAndFill => {
ctx.stroke(&self.bez_path, &color, stroke_width);
ctx.fill(&self.bez_path, &color);
},
}
});
}
Expand Down

0 comments on commit 22876d0

Please sign in to comment.