Skip to content

Commit

Permalink
fix(icons): incorrect file icons
Browse files Browse the repository at this point in the history
  • Loading branch information
eythaann committed Feb 10, 2025
1 parent 40a7509 commit 88428fb
Show file tree
Hide file tree
Showing 87 changed files with 460 additions and 136 deletions.
11 changes: 10 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
# Changelog

## [Unreleased]
## [Unreleased]
### features
- add button to clear the cached icons on settings.

### enhancements
- allow custom icons by extension on icon packs.

### fix
- error on file icons.

## [2.1.7]
### fix
- power module not clickable on toolbar.
Expand Down
11 changes: 3 additions & 8 deletions src/apps/seelen_rofi/modules/launcher/infra/Item.tsx
Original file line number Diff line number Diff line change
@@ -1,29 +1,24 @@
import { SeelenCommand } from '@seelen-ui/lib';
import { path } from '@tauri-apps/api';
import { convertFileSrc, invoke } from '@tauri-apps/api/core';
import { invoke } from '@tauri-apps/api/core';
import { getCurrentWindow } from '@tauri-apps/api/window';
import { Menu } from 'antd';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';

import { BackgroundByLayersV2 } from '../../../../seelenweg/components/BackgroundByLayers/infra';

import { useIcon } from 'src/apps/shared/hooks';
import { FileIcon } from 'src/apps/shared/components/Icon';

import { StartMenuApp } from '../../shared/store/domain';

import { AnimatedDropdown } from '../../../../shared/components/AnimatedWrappers';
import { OverflowTooltip } from '../../../../shared/components/OverflowTooltip';

const MISSING_ICON_SRC = convertFileSrc(await path.resolveResource('static/icons/missing.png'));

export const Item = memo(({ item, hidden }: { item: StartMenuApp; hidden: boolean }) => {
const { path, umid } = item;

const { t } = useTranslation();

const icon = useIcon({ path, umid: umid });

function onClick() {
invoke(SeelenCommand.OpenFile, { path });
getCurrentWindow().hide();
Expand Down Expand Up @@ -78,7 +73,7 @@ export const Item = memo(({ item, hidden }: { item: StartMenuApp; hidden: boolea
className="launcher-item"
onClick={onClick}
>
<img className="launcher-item-icon" src={icon || MISSING_ICON_SRC} />
<FileIcon className="launcher-item-icon" path={path} umid={umid} />
<OverflowTooltip className="launcher-item-label" text={displayName} />
<OverflowTooltip className="launcher-item-path" text={shortPath} />
</button>
Expand Down
7 changes: 2 additions & 5 deletions src/apps/seelenweg/modules/item/infra/MediaSession.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@ import { LAZY_CONSTANTS } from '../../shared/utils/infra';

import { calcLuminance } from '../../../../toolbar/modules/media/application';
import { Selectors } from '../../shared/store/app';
import { useIcon } from 'src/apps/shared/hooks';
import { cx } from 'src/apps/shared/styles';

import { MediaWegItem } from '../../shared/store/domain';

import { Icon } from '../../../../shared/components/Icon';
import { FileIcon, Icon } from '../../../../shared/components/Icon';
import { WithContextMenu } from '../../../components/WithContextMenu';
import { DraggableItem } from './DraggableItem';
import { getMenuForItem } from './Menu';
Expand All @@ -33,8 +32,6 @@ export function MediaSession({ item }: { item: MediaWegItem }) {
const sessions = useSelector(Selectors.mediaSessions);
const session = sessions.find((s) => s.default);

let appIconSrc = useIcon({ umid: session?.umid });

let thumbnailSrc = convertFileSrc(
session?.thumbnail ? session.thumbnail : LAZY_CONSTANTS.DEFAULT_THUMBNAIL,
);
Expand Down Expand Up @@ -80,7 +77,7 @@ export function MediaSession({ item }: { item: MediaWegItem }) {
}}
>
<div className="media-session-thumbnail-container">
{appIconSrc && <img className="media-session-app-icon" src={appIconSrc} />}
<FileIcon className="media-session-app-icon" umid={session?.umid} noFallback />
<img className="media-session-thumbnail" src={thumbnailSrc} />
</div>
<img className="media-session-blurred-thumbnail" src={thumbnailSrc} />
Expand Down
17 changes: 6 additions & 11 deletions src/apps/seelenweg/modules/item/infra/UserApplication.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import { SeelenCommand, SeelenWegSide } from '@seelen-ui/lib';
import { convertFileSrc, invoke } from '@tauri-apps/api/core';
import { invoke } from '@tauri-apps/api/core';
import moment from 'moment';
import { memo, useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { useSelector } from 'react-redux';

import { BackgroundByLayersV2 } from '../../../components/BackgroundByLayers/infra';
import { LAZY_CONSTANTS, updatePreviews } from '../../shared/utils/infra';
import { updatePreviews } from '../../shared/utils/infra';

import { Selectors } from '../../shared/store/app';
import { parseCommand } from 'src/apps/shared/Command';
import { useIcon, useWindowFocusChange } from 'src/apps/shared/hooks';
import { FileIcon } from 'src/apps/shared/components/Icon';
import { useWindowFocusChange } from 'src/apps/shared/hooks';

import { PinnedWegItem, TemporalWegItem } from '../../shared/store/domain';

Expand All @@ -37,12 +38,6 @@ export const UserApplication = memo(({ item, onAssociatedViewOpenChanged }: Prop
const settings = useSelector(Selectors.settings);
const focusedApp = useSelector(Selectors.focusedApp);

const iconSrc =
useIcon({
path: item.path,
umid: item.umid,
}) || convertFileSrc(LAZY_CONSTANTS.MISSING_ICON_PATH);

const { t } = useTranslation();
const calculatePlacement = (position: any) => {
switch (position) {
Expand Down Expand Up @@ -91,7 +86,7 @@ export const UserApplication = memo(({ item, onAssociatedViewOpenChanged }: Prop
className={cx({ 'associated-view-open': openPreview || openContextMenu })}
>
<WithContextMenu
items={getUserApplicationContextMenu(t, item, devTools, iconSrc) || []}
items={getUserApplicationContextMenu(t, item, devTools) || []}
onOpenChange={(isOpen) => {
setOpenContextMenu(isOpen);
if (openPreview && isOpen) {
Expand Down Expand Up @@ -162,7 +157,7 @@ export const UserApplication = memo(({ item, onAssociatedViewOpenChanged }: Prop
onContextMenu={(e) => e.stopPropagation()}
>
<BackgroundByLayersV2 prefix="item" />
<img className="weg-item-icon" src={iconSrc} />
<FileIcon className="weg-item-icon" path={item.path} umid={item.umid} />
{notificationsCount > 0 && <div className="weg-item-badge">{notificationsCount}</div>}
<div
className={cx('weg-item-open-sign', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,12 @@ import { parseCommand } from 'src/apps/shared/Command';

import { PinnedWegItem, TemporalWegItem } from '../../shared/store/domain';

import { Icon } from '../../../../shared/components/Icon';
import { FileIcon, Icon } from '../../../../shared/components/Icon';

export function getUserApplicationContextMenu(
t: TFunction,
item: PinnedWegItem | TemporalWegItem,
devTools: boolean,
iconSrc: string,
): ItemType[] {
const isPinned = isPinnedApp(item);

Expand Down Expand Up @@ -59,7 +58,7 @@ export function getUserApplicationContextMenu(
{
key: 'weg_run_new',
label: item.displayName,
icon: <img className="weg-context-menu-item-icon" src={iconSrc} />,
icon: <FileIcon className="weg-context-menu-item-icon" path={item.path} umid={item.umid} />,
onClick: () => {
const { program, args } = parseCommand(item.relaunchCommand);
invoke(SeelenCommand.Run, { program, args, workingDir: item.relaunchIn });
Expand Down
2 changes: 2 additions & 0 deletions src/apps/settings/i18n/translations/af.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ devtools:
settings_file: Instellingslêer
simulate_fullscreen: Simuleer volskerm gebeurtenis
extras:
clear_icons: Maak stelselikone kas uit
clear_icons_tooltip: '''N Herbegin kan nodig wees om alle widgets ten volle in werking te stel'
discord: Teenstrydigheid
exit: Hou op/uitgang
github: Github
Expand Down
2 changes: 2 additions & 0 deletions src/apps/settings/i18n/translations/am.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ devtools:
settings_file: የቅንብሮች ፋይል
simulate_fullscreen: የሙሉ ስክሪን ክስተት አስመስለው
extras:
clear_icons: የስርዓት አዶዎች መሸጎጫ
clear_icons_tooltip: ዳግም ማስጀመር በሁሉም ፍርግሞች ላይ ሙሉ በሙሉ እንዲተገበር ሊፈልግ ይችላል
discord: አለመግባባት
exit: ማቆም / መውጣት
github: Github
Expand Down
2 changes: 2 additions & 0 deletions src/apps/settings/i18n/translations/ar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ devtools:
settings_file: ملف الإعدادات
simulate_fullscreen: محاكاة حدث ملء الشاشة
extras:
clear_icons: مسح ذاكرة التخزين المؤقت لأيقونات النظام
clear_icons_tooltip: قد تكون إعادة التشغيل مطلوبة لتدخل جميع الأدوات حيز التنفيذ بالكامل
discord: ديسكورد
exit: إنهاء/خروج
github: جيت هب
Expand Down
2 changes: 2 additions & 0 deletions src/apps/settings/i18n/translations/az.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ devtools:
settings_file: Parametrlər faylı
simulate_fullscreen: Tam ekran hadisəsini simulyasiya edin
extras:
clear_icons: Sistem nişanlar önbelleği təmizləyin
clear_icons_tooltip: Bütün vidjetlərə tam təsir göstərmək üçün yenidən başlama tələb oluna bilər
discord: Nifaq
exit: Çıxmaq / çıxmaq
github: Gitub
Expand Down
4 changes: 4 additions & 0 deletions src/apps/settings/i18n/translations/bg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ devtools:
settings_file: Файл за настройки
simulate_fullscreen: Симулирайте събитие на цял екран
extras:
clear_icons: Изчистване на кеша на системните икони
clear_icons_tooltip: >-
Може да се наложи рестартиране, за да се прояви напълно ефектът върху всички
джаджи.
discord: Раздор
exit: QUIT/EXIT
github: Github
Expand Down
4 changes: 4 additions & 0 deletions src/apps/settings/i18n/translations/bn.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ devtools:
settings_file: সেটিংস ফাইল
simulate_fullscreen: পূর্ণস্ক্রীন ইভেন্ট অনুকরণ
extras:
clear_icons: ক্লিয়ার সিস্টেম আইকন ক্যাশে
clear_icons_tooltip: >-
সমস্ত উইজেটগুলিতে পুরোপুরি কার্যকর করার জন্য একটি পুনঃসূচনা প্রয়োজন হতে
পারে
discord: মতবিরোধ
exit: প্রস্থান/প্রস্থান
github: গিথুব
Expand Down
2 changes: 2 additions & 0 deletions src/apps/settings/i18n/translations/bs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ devtools:
settings_file: Datoteka postavki
simulate_fullscreen: Simulirajte događaj preko cijelog ekrana
extras:
clear_icons: Clear System Icons predmemorija
clear_icons_tooltip: Može se ponovo pokrenuti za u potpunosti stupiti na snagu na svim widgetima
discord: Nesklad
exit: Prestanite / izlaz
github: Github
Expand Down
2 changes: 2 additions & 0 deletions src/apps/settings/i18n/translations/ca.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ devtools:
settings_file: Arxiu de configuració
simulate_fullscreen: Simula un esdeveniment a pantalla completa
extras:
clear_icons: Esborrar la memòria cau de les icones del sistema
clear_icons_tooltip: Es pot requerir un reinici per tenir efecte sobre tots els ginys
discord: Discòrdia
exit: Deixar/sortir
github: Github
Expand Down
2 changes: 2 additions & 0 deletions src/apps/settings/i18n/translations/cs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ devtools:
settings_file: Nastavení souboru
simulate_fullscreen: Simulovat událost na celou obrazovku
extras:
clear_icons: Vymazání mezipaměti systémových ikon
clear_icons_tooltip: Aby se plně projevily všechny widgety, mohlo by být nutné restartování.
discord: Svár
exit: Ukončit/ukončit
github: GitHub
Expand Down
2 changes: 2 additions & 0 deletions src/apps/settings/i18n/translations/cy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ devtools:
settings_file: Ffeil Gosodiadau
simulate_fullscreen: Efelychu digwyddiad sgrin lawn
extras:
clear_icons: Storfa eiconau system glir
clear_icons_tooltip: Gellid bod yn ofynnol i ailgychwyn ddod i rym yn llawn ar bob teclyn
discord: Anghytgord
exit: Rhoi'r gorau iddi/allanfa
github: Github
Expand Down
2 changes: 2 additions & 0 deletions src/apps/settings/i18n/translations/da.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ devtools:
settings_file: Indstillinger fil
simulate_fullscreen: Simuler begivenhed i fuld skærm
extras:
clear_icons: Ryd cache for systemikoner
clear_icons_tooltip: En genstart kan være nødvendig for at få fuld effekt på alle widgets
discord: Uenighed
exit: Afslut/exit
github: GitHub
Expand Down
4 changes: 4 additions & 0 deletions src/apps/settings/i18n/translations/de.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ devtools:
settings_file: Einstellungsdatei
simulate_fullscreen: Vollbildereignis simulieren
extras:
clear_icons: System-Symbol-Cache löschen
clear_icons_tooltip: >-
Ein Neustart könnte erforderlich sein, um alle Widgets vollständig zu
aktivieren.
discord: Discord
exit: Beenden
github: GitHub
Expand Down
2 changes: 2 additions & 0 deletions src/apps/settings/i18n/translations/el.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ devtools:
settings_file: Αρχείο ρυθμίσεων
simulate_fullscreen: Προσομοίωση συμβάντος πλήρους οθόνης
extras:
clear_icons: Εκκαθάριση προσωρινής μνήμης εικονιδίων συστήματος
clear_icons_tooltip: Μπορεί να απαιτηθεί επανεκκίνηση για να ισχύσει πλήρως σε όλα τα widgets
discord: Διχόνοια
exit: Εγκατάλειψη/έξοδο
github: Github
Expand Down
2 changes: 2 additions & 0 deletions src/apps/settings/i18n/translations/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ devtools:
settings_file: Settings File
simulate_fullscreen: Simulate fullscreen event
extras:
clear_icons: Clear System Icons Cache
clear_icons_tooltip: A restart could be required to fully take effect on all widgets
discord: Discord
exit: Quit/Exit
github: GitHub
Expand Down
4 changes: 4 additions & 0 deletions src/apps/settings/i18n/translations/es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ devtools:
settings_file: Archivo de configuración
simulate_fullscreen: Simular evento de pantalla completa
extras:
clear_icons: Borrar caché de iconos del sistema
clear_icons_tooltip: >-
Podría ser necesario reiniciar el sistema para que surta efecto en todos los
widgets.
discord: Discordia
exit: Salir
github: GitHub
Expand Down
2 changes: 2 additions & 0 deletions src/apps/settings/i18n/translations/et.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ devtools:
settings_file: Seadete fail
simulate_fullscreen: Täisekraanil toimuva sündmuse simuleerimine
extras:
clear_icons: Tühjenda süsteemi ikoonide vahemälu
clear_icons_tooltip: Kõigi vidinate täielikuks jõustumiseks võib olla vajalik taaskäivitamine.
discord: Ebakõla
exit: Lõpeta/väljumine
github: Github
Expand Down
2 changes: 2 additions & 0 deletions src/apps/settings/i18n/translations/eu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ devtools:
settings_file: Ezarpenak fitxategia
simulate_fullscreen: Simulatu pantaila osoko gertaera
extras:
clear_icons: Garbitu sistemaren ikonoak cachea
clear_icons_tooltip: Berrabiarazi behar da widget guztietan erabat indarrean egon dadin
discord: Deskudun
exit: Irten / irten
github: Github
Expand Down
4 changes: 4 additions & 0 deletions src/apps/settings/i18n/translations/fa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ devtools:
settings_file: پرونده تنظیمات
simulate_fullscreen: شبیه سازی رویداد تمام صفحه
extras:
clear_icons: حافظه نهان سیستم را پاک کنید
clear_icons_tooltip: >-
یک راه اندازی مجدد می تواند مورد نیاز باشد تا به طور کامل در همه ویجت ها
تأثیر بگذارد
discord: اختلاف
exit: ترک/خروج
github: گیتوب
Expand Down
4 changes: 4 additions & 0 deletions src/apps/settings/i18n/translations/fi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ devtools:
settings_file: Asetustiedosto
simulate_fullscreen: Simuloi koko näytön tapahtumaa
extras:
clear_icons: Tyhjennä järjestelmän kuvakkeiden välimuisti
clear_icons_tooltip: >-
Uudelleenkäynnistystä saatetaan tarvita, jotta kaikki widgetit tulisivat
täysin voimaan.
discord: Erimielisyys
exit: Lopettaa/poistua
github: Github
Expand Down
4 changes: 4 additions & 0 deletions src/apps/settings/i18n/translations/fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ devtools:
settings_file: Fichier de paramètres
simulate_fullscreen: Simuler un événement en plein écran
extras:
clear_icons: Effacer le cache des icônes du système
clear_icons_tooltip: >-
Un redémarrage pourrait être nécessaire pour que tous les widgets soient
pleinement pris en compte.
discord: Discorde
exit: Quitter/Quitter
github: GitHub
Expand Down
2 changes: 2 additions & 0 deletions src/apps/settings/i18n/translations/gu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ devtools:
settings_file: સેટિંગ્સ ફાઇલ
simulate_fullscreen: પૂર્ણસ્ક્રીન ઇવેન્ટનું અનુકરણ કરો
extras:
clear_icons: સ્પષ્ટ સિસ્ટમ ચિહ્નો કેશ
clear_icons_tooltip: બધા વિજેટો પર સંપૂર્ણ અસર કરવા માટે ફરીથી પ્રારંભ કરવાની જરૂર પડી શકે છે
discord: વિખવાદ
exit: છોડો/બહાર નીકળો
github: GitHub
Expand Down
2 changes: 2 additions & 0 deletions src/apps/settings/i18n/translations/he.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ devtools:
settings_file: קובץ הגדרות
simulate_fullscreen: הדמיית אירוע במסך מלא
extras:
clear_icons: מטמון סמלי מערכת נקה
clear_icons_tooltip: ניתן להידרש להפעלה מחדש כדי להיכנס לתוקף באופן מלא על כל הווידג'טים
discord: מַחֲלוֹקֶת
exit: יצא/יציאה
github: Github
Expand Down
4 changes: 4 additions & 0 deletions src/apps/settings/i18n/translations/hi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ devtools:
settings_file: सेटिंग संचिका
simulate_fullscreen: फ़ुलस्क्रीन ईवेंट का अनुकरण करें
extras:
clear_icons: स्पष्ट प्रणाली आइकन कैश
clear_icons_tooltip: >-
सभी विजेट पर पूरी तरह से प्रभावी होने के लिए एक पुनरारंभ की आवश्यकता हो सकती
है
discord: कलह
exit: छोड़ देना/बाहर निकलना
github: GitHub
Expand Down
2 changes: 2 additions & 0 deletions src/apps/settings/i18n/translations/hr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ devtools:
settings_file: Datoteka postavki
simulate_fullscreen: Simulirajte događaj preko cijelog zaslona
extras:
clear_icons: Očistite predmemoriju ikona sustava
clear_icons_tooltip: Ponovno pokretanje moglo bi se u potpunosti stupiti na sve widgete
discord: Nesklad
exit: Prestati/izaći
github: Ždrijeb
Expand Down
Loading

0 comments on commit 88428fb

Please sign in to comment.