Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Software does not utilise native icon theme #42

Closed
Ragnar770 opened this issue Dec 9, 2019 · 10 comments
Closed

Software does not utilise native icon theme #42

Ragnar770 opened this issue Dec 9, 2019 · 10 comments

Comments

@Ragnar770
Copy link

Ragnar770 commented Dec 9, 2019

There's a good chance this is a user error but the program doesn't utilise my icon theme which makes buttons harder to see with a dark theme. I've included a screenshot below.

Version: Latest commit (a7c9eb6), built with yay from the AUR
OS: Arch Linux (Kernel 5.4.2)
DE: KDE Plasma 5.17.4 / Qt 5.13.2
Icon theme: La Capitaine

Screenshot
image

@bmentink
Copy link

bmentink commented Dec 10, 2019

HI,
I am having a similar issue with icons, but the ones next to the Start/Stop Icon .. see attached:
2019-12-10-135054_1916x1026_scrot

This is running on Archlinux in a chroot environment, with latest git pull ..
Since these Icons are part of the build, do I have to execute the program from a specific directory to pick these up?

@Ho-Ro
Copy link
Member

Ho-Ro commented Dec 10, 2019

@Ragnar770 This looks exactly like I expected - what other look would you like to see? Are you talking about the top left icons?
image
This is what I see
image
The left/top run/pause icon comes from the system, the other three right/down (digitalphosphor = sine waves; zoom = search-plus; measure = drafting compass) are hardcoded into the binary, defined in the source code resources
I hacked a quick blue digitalphosphor.svg, please try if this approach gives better visibility, then I can provide also the other icons in blue:
EDIT: icons_blue_svg.zip

<svg
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:cc="http://creativecommons.org/ns#"
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:svg="http://www.w3.org/2000/svg"
   xmlns="http://www.w3.org/2000/svg"
   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
   width="64"
   height="64"
   inkscape:export-xdpi="90"
   inkscape:export-ydpi="90">
  <g transform="translate(1,12.5)" >
    <path
       style="opacity:1.0;fill:none;stroke:#8080ff;stroke-width:4.0;stroke-linecap:round;stroke-opacity:1"
       d="m 1,20 c 13,-10 17,-10 30,0 13,10 17,10 30,0"
	/>
    <path
       style="opacity:1.0;fill:none;stroke:#4040ff;stroke-width:4.0;stroke-linecap:round;stroke-opacity:1"
       d="m 1,20 c 13,-22 17,-22 30,0 13,22 17,22 30,0"
    />
    <path
       style="opacity:1.0;fill:none;stroke:#0000ff;stroke-width:4.0;stroke-linecap:round;stroke-opacity:1"
       d="m 1,20 c 13,-39 17,-39 30,0 13,39 17,39 30,0"
    />
  </g>
</svg>

@bmentink No, the icons are linked as a resource file into the binary, as well as the DE, FR, IT, ... translations.

ui->actionDigital_phosphor->setIcon(QIcon(":/images/digitalphosphor.svg"));

You need only one binary (+ the needed system libraries + an udev rule unless you are root) to run the program.

Do you get some info or error message when starting in a terminal?

@bmentink
Copy link

bmentink commented Dec 10, 2019

@Ho-Ro
Thanks. The only message I get at the console is:
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'

I have tried this compiled both for ArchLinux(chroot) and Alpine Linux(native). Common to these, I am running the Awesome window manager ..

@Ho-Ro Ho-Ro closed this as completed in 77037a7 Dec 10, 2019
@Ho-Ro
Copy link
Member

Ho-Ro commented Dec 10, 2019

@bmentink: This issue was closed automatically by a commit for the original issue of @Ragnar770, but I'll keep an eye on your problem. Do you have access to a debian system, maybe virtual or from USB stic etc. where you can compare the Qt installation against your more minimal systems?

@bmentink
Copy link

@Ho-Ro
No, I do not have any other systems, they are all Alpine based ..
Can you give me a clue as to what Qt component I may be missing ..

@Ragnar770
Copy link
Author

I hadn't looked at the source code so I had no idea they were hard coded, that makes a lot of sense actually. The blue icons are a bit easier to see but I'll play around with the vector files and see if I can get them to match my Qt theme, thanks!

@bmentink
Copy link

bmentink commented Dec 11, 2019

@Ho-Ro
I have fixed it my end. I needed to install qt5-qtsvg, suggest this gets added as a requirement check?
2019-12-11-140616_272x57_scrot

PS: Just did a git pull and now have the blue icons, which on my background does not look as good as the black .. my 2c

Maybe there should be a "dark theme" switch on the build for those with dark themes like @Ragnar770?
Personally I would like it to be consistently black like the run button ..

@Ho-Ro
Copy link
Member

Ho-Ro commented Dec 11, 2019

The blue theme was just a test, but it doesn't please me too.

@Ho-Ro
Copy link
Member

Ho-Ro commented Dec 11, 2019

Here are the icons for the dark theme, automatically switching depending on the lightness of the window border

QVariantMap colorMap;
QString iconPath = QString( ":/images/" );
if ( QPalette().color( QPalette::Window ).lightness() < 128 ) {// automatic light/dark icon switch
    iconPath += "darktheme/"; // select top window icons accordingly
    colorMap.insert("color-off", QColor(255,255,255));
    colorMap.insert("color-active", QColor(255,255,255));
}
...

image

@Ho-Ro
Copy link
Member

Ho-Ro commented Dec 11, 2019

@bmentink qt5-qtsvg was automatically loaded on my debian system with the other Qt devel stuff, but it is a good hint, I will add your finding to the build description.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants