Coder Social home page Coder Social logo

Comments (6)

plfiorini avatar plfiorini commented on July 27, 2024

What does the .desktop say for the Icon field?

from shell.

iBelieve avatar iBelieve commented on July 27, 2024

Here's the .desktop file for Chrome Remote Desktop:

#!/usr/bin/env xdg-open
[Desktop Entry]
Version=1.0
Terminal=false
Type=Application
Name=Chrome Remote Desktop
Exec=/opt/google/chrome/google-chrome --profile-directory=Default --app-id=gbchcmhmhahfdphkhkmpfmihenigjmpp
Icon=chrome-gbchcmhmhahfdphkhkmpfmihenigjmpp-Default
StartupWMClass=crx_gbchcmhmhahfdphkhkmpfmihenigjmpp

The icons come from ~/.local/share/icons/hicolor:

/home/mspencer/.local/share/icons/
└── hicolor
    ├── 128x128
    │   └── apps
    │       ├── chrome-aohghmighlieiainnegkcijnfilokake-Default.png
    │       └── chrome-pnoffddplpippgcfjdhbmhkofpnaalpg-Default.png
    ├── 16x16
    │   └── apps
    │       ├── chrome-aohghmighlieiainnegkcijnfilokake-Default.png
    │       └── chrome-pnoffddplpippgcfjdhbmhkofpnaalpg-Default.png
    ├── 256x256
    │   └── apps
    │       ├── chrome-bgjohebimpjdhhocbknplfelpmdhifhd-Default.png
    │       └── chrome-pnoffddplpippgcfjdhbmhkofpnaalpg-Default.png
    ├── 32x32
    │   └── apps
    │       ├── chrome-hlffpaajmfllggclnjppbblobdhokjhe-Default.png
    │       └── chrome-pnoffddplpippgcfjdhbmhkofpnaalpg-Default.png
    ├── 48x48
    │   └── apps
    │       ├── chrome-gbchcmhmhahfdphkhkmpfmihenigjmpp-Default.png
    │       └── chrome-pnoffddplpippgcfjdhbmhkofpnaalpg-Default.png
    └── 512x512
        └── apps
            └── chrome-pnoffddplpippgcfjdhbmhkofpnaalpg-Default.png

from shell.

plfiorini avatar plfiorini commented on July 27, 2024

@ibeliever It depends on the theme, I logged the requested icon and the resulting QIcon from the Fluid icon theme image provider with Papirus GTK:

Requested "chrome-dlhghfjpjbjckmefnkkmgechilbmhflf-Default" QIcon("chrome",availableSizes[normal,Off]=(QSize(16, 16), QSize(22, 22), QSize(24, 24), QSize(48, 48), QSize(32, 32)),cacheKey=0

Somehow Papirus GTK provides an icon for Chrome apps. There are icons like chrome.svg and chrome-okdgofnjkaimfebepijgaoimfphblkpd.svg though I don't know how this should affect the lookup exactly.

If I use Adwaita I can see the icon correctly and the log reports:

Requested "chrome-dlhghfjpjbjckmefnkkmgechilbmhflf-Default" QIcon("chrome-dlhghfjpjbjckmefnkkmgechilbmhflf-Default",availableSizes[normal,Off]=(QSize(48, 48), QSize(32, 32), QSize(256, 256), QSize(16, 16), QSize(128, 128), QSize(48, 48), QSize(32, 32), QSize(256, 256), QSize(16, 16), QSize(128, 128)),cacheKey=0x3400000000)

My Chrome application is this page and as you can see here it shows the GH icon:

icon

It might also be a Qt bug but I'm not sure what should I report since it works with Adwaita.

from shell.

iBelieve avatar iBelieve commented on July 27, 2024

Yeah, it looks like somehow Paper is falling back to a generic Chrome icon instead of the original icons when a Paper version of the icon isn't found. I think the original issue was that I didn't have the Hawaii icon theme installed (I've since changed the theme in dconf).

from shell.

iBelieve avatar iBelieve commented on July 27, 2024

Though, that only happens in qmlOS - they properly fall back to the original icons in GNOME.

from shell.

plfiorini avatar plfiorini commented on July 27, 2024

QIcon might have some issue with hicolor.

This is a simple program:

#include <QtWidgets/QApplication>
#include <QtGui/QIcon>
#include <QDebug>

int main(int argc, char *argv[])
{
        QApplication app(argc, argv);
        qWarning() << QIcon::themeName();
        //QIcon::setThemeName("hicolor");
        qWarning() << QIcon::themeName();
        qWarning() << QIcon::fromTheme("rhythmbox");
        qWarning() << QIcon::fromTheme("chrome-dlhghfjpjbjckmefnkkmgechilbmhflf-Default");
        return app.exec();
}

Set XDG_DATA_DIRS=$HOME/.local/share:/usr/share, build and run.

This is the output:

"Papirus-GTK"
"Papirus-GTK"
QIcon("rhythmbox",availableSizes[normal,Off]=(QSize(16, 16), QSize(22, 22), QSize(24, 24), QSize(32, 32), QSize(48, 48)),cacheKey=0x100000000)
QIcon("chrome",availableSizes[normal,Off]=(QSize(16, 16), QSize(22, 22), QSize(24, 24), QSize(32, 32), QSize(48, 48)),cacheKey=0x200000000)

Uncomment the line that sets the theme to hicolor, build and run:

"Papirus-GTK"
"hicolor"
QIcon("rhythmbox",availableSizes[normal,Off]=(QSize(48, 48), QSize(32, 32), QSize(256, 256), QSize(24, 24), QSize(22, 22), QSize(16, 16)),cacheKey=0x100000000)
QIcon("chrome-dlhghfjpjbjckmefnkkmgechilbmhflf-Default",availableSizes[normal,Off]=(QSize(48, 48), QSize(32, 32), QSize(256, 256), QSize(16, 16), QSize(128, 128)),cacheKey=0x200000000)

from shell.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.