lxqt / pcmanfm-qt

File manager and desktop icon manager (Qt port of PCManFM and libfm)
https://lxqt-project.org
GNU General Public License v2.0
424 stars 112 forks source link

Icon for encrypted volume #400

Closed alex3kov closed 8 years ago

alex3kov commented 8 years ago

In old pcmanfm, mounted encrypted volumes were displayed with a nice icon with padlock, indicating encryption ("localStorage" below):
old
In pcmanfm-qt, it looks like a volume of unknown type:
new
I'm using Faience icon theme in gtk, so I set the same theme in pcmanfm-qt's preferences.

tsujan commented 8 years ago

so I set the same theme in pcmanfm-qt's preferences.

pcmanfm-qt doesn't have a setting for icon themes.

alex3kov commented 8 years ago

pcmanfm-qt doesn't have a setting for icon themes.

Then what is this?
jjj

agaida commented 8 years ago

that only means that the system and/or the fallback theme isn't proper set

alex3kov commented 8 years ago

that only means that the system and/or the fallback theme isn't proper set

What do you mean?

tsujan commented 8 years ago

It means that, probably, the output of echo $QT_QPA_PLATFORMTHEME is not lxqt in your case.

alex3kov commented 8 years ago

@tsujan It was empty. I don't use full lxqt, just pcmanfm-qt (WM=Openbox, no DE), so I did this (according to Arch wiki article):

$ export QT_QPA_PLATFORMTHEME="qt5ct"
$ qt5ct 
# set icon theme to Faience for QT5 applications
$ pcmanfm-qt

Now in pcmanfm-qt "Icon theme" drop-list disappeared (so apparently pcmanfm-qt did pick up the theme), but the icon for encrypted volume is still "unknown".

tsujan commented 8 years ago

Could you find the exact names of those icons in the theme you use? I mean the "unknown" icon as well as the correct one that appears in the gtk-based pcmanfm. (I don't have an encrypted volume to test.)

tsujan commented 8 years ago

Oh, I forgot to say that qt5ct is NOT related to LXQt.

alex3kov commented 8 years ago

Could you find the exact names of those icons in the theme you use? I mean the "unknown" icon as well as the correct one that appears in the gtk-based pcmanfm. (I don't have an encrypted volume to test.)

Actually, I can't find either of them (searched in /usr/share/icons/Faience/). Correct icon looks exactly like drive-harddisk.png though, just with a padlock added. Could it be that gtk pcmanfm was taking an icon from theme and adding a padlock to it (just guessing)? As for "unknown" one with a question mark - can't find it at all.

Oh, I forgot to say that qt5ct is NOT related to LXQt.

For sure. It does seem to do the trick though.

tsujan commented 8 years ago

Could it be that gtk pcmanfm was taking an icon from theme and adding a padlock to it (just guessing)?

Yes, it's so. The lock icon is just an emblem.

Anyhow, unless you try LXQt or just use its EV's in your DE and test with a standard icon theme, we couldn't know that this is a real issue.

alex3kov commented 8 years ago

Don't want to install whole LXQT suite - I want just pcmanfm(-qt) and lxpanel (lxqt-panel when it becomes usable).

So let's go with your second option. What's "EV"? What would be considered a standard icon theme?

/--Regards, Aleksei/


From: Tsujan Sent: Sunday, September 25, 2016 6:02PM To: Lxde/pcmanfm-qt Cc: Aleksei Kovura, Author Subject: Re: [lxde/pcmanfm-qt] Icon for encrypted volume (#400)

Could it be that gtk pcmanfm was taking an icon from theme and
adding a padlock to it (just guessing)?

Yes, it's so. The lock icon is just an emblem.

Anyhow, unless you try LXQt or just use its EV's in your DE and test with a standard icon theme, we couldn't know that this is a real issue.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/lxde/pcmanfm-qt/issues/400#issuecomment-249426635, or mute the thread https://github.com/notifications/unsubscribe-auth/ADct8iFQuhOanc9KSVpfkbmwhc_1OL8Gks5qto0ggaJpZM4KFwaq.

tsujan commented 8 years ago

What's "EV"?

The environment variable in quesion is QT_QPA_PLATFORMTHEME, which requires installation of lxqt-qtplugin. You'll also need lxqt-config.

What would be considered a standard icon theme?

Breeze or Oxygen. Gnome icon theme is standard too but it's gtk oriented.

Don't want to install whole LXQT suite

LXQt is so light! You already have Openbox, which is LXQt's default window manager.

alex3kov commented 8 years ago

The environment variable in quesion is QT_QPA_PLATFORMTHEME, which requires installation of lxqt-qtplugin. You'll also need lxqt-config.

Installed both (Why? Are you doing away with the modularity?). Rebooted - QT_QPA_PLATFORMTHEME is empty.

Breeze or Oxygen. Gnome icon theme is standard too but it's gtk oriented.

Installed Breeze. Ran lxqt-config-appearance, highlighted Breeze (there's no OK/Save/Apply button - clicked Close). No change in pcmanfm-qt after that (I'm guessing because of still-empty QT_QPA_PLATFORMTHEME). After running lxqt-config-appearance again no icon theme is selected. There is no indication as to what icon theme is currently used (if any).

LXQt is so light! You already have Openbox, which is LXQt's default window manager.

From my experience with pcmanfm-qt and lxqt-panel LXQT is very much a work in progress. With LXDE I just installed pcmanfm, lxpanel and lxappearance - they picked up my icon theme and just started working. There was no need to install anything else or tinker with environment variables.

alex3kov commented 8 years ago

Also, I've set Breeze in Preferences->Display of pcmanfm-qt, here's how the volume looks in it (the one in the middle):
brz

tsujan commented 8 years ago

Installed both ... Rebooted - QT_QPA_PLATFORMTHEME is empty.

A reboot doesn't do any magic. You should set that EV. Some desktop environments have their tools for that. See how environment variables can be set for a session in your distro.

Are you doing away with the modularity?

No! LXQt is so modular that, right now, I'm using its QT_QPA_PLATFORMTHEME under Enlightenment, which is a very different DE.

From my experience with pcmanfm-qt and lxqt-panel LXQT is very much a work in progress.

lxqt-panel and pcmanfm-qt are quite mature. Of course, their development never stops.

With LXDE I just installed pcmanfm, lxpanel and lxappearance - they picked up my icon theme and ...

Most DE's are GTK-based and so, have a poor support for Qt5 apps. LXQt is Qt5-based; so, it needs (and has) its own plugin.

alex3kov commented 8 years ago

A reboot doesn't do any magic. You should set that EV. Some desktop environments have their tools for that. See how environment variables can be set for a session in your distro.

So what was the point of installing these 2 packages? You said they are required for QT_QPA_PLATFORMTHEME:

The environment variable in quesion is QT_QPA_PLATFORMTHEME, which requires installation of lxqt-qtplugin. You'll also need lxqt-config.

But anyway - what should I set QT_QPA_PLATFORMTHEME to?

lxqt-panel and pcmanfm-qt are quite mature. Of course, their development never stops.

Sorry, but no, they are not. Lxqt-panel is ugly as hell, after spending 15 minutes of trying to make it look better I gave up. Give users some sane defaults, then we'll talk :) Pcmanfm-qt - maybe, if you document this whole QT_QPA_PLATFORMTHEME thing somewhere in a VERY visible place, like a warning window on pcmanfm-qt startup.

agaida commented 8 years ago

don't feed any longer

tsujan commented 8 years ago

Sorry, but no, they are not...

I wasn't here to convince you of anything but just wanted to know whether your problem was personal or about a (minor) bug -- a question the apparently wasn't going to be answered; hence closing this issue.

alex3kov commented 8 years ago

I was asking what should I do next:

The environment variable in quesion is QT_QPA_PLATFORMTHEME, which requires installation of lxqt-qtplugin. You'll also need lxqt-config.

But anyway - what should I set QT_QPA_PLATFORMTHEME to?

paulolieuthier commented 8 years ago

The startlxqt script (which is run when you select LXQt in your display manager) sets $QT_QPA_PLATFORMTHEME to "lxqt". The script is provided by lxqt-common.

alex3kov commented 8 years ago

@paulolieuthier All right, here's what I get with lxqt-config and lxqt-qtplugin installed - still blank icon for encrypted volume:

[username@arch ~]$ export QT_QPA_PLATFORMTHEME="lxqt"
[username@arch ~]$ lxqt-config-appearance 
# set icon theme to Breeze here
[username@arch ~]$ cat ~/.config/lxqt/lxqt.conf 
[General]
__userfile__=true
icon_theme=breeze
single_click_activate=false
theme=frost
tool_button_style=ToolButtonTextBesideIcon

[Qt]
doubleClickInterval=400
font="Sans,11,-1,5,50,0,0,0,0,0"
style=Fusion
wheelScrollLines=3
[username@arch ~]$ pcmanfm-qt 
** (process:10796): WARNING **: XDG_TEMPLATES_DIR is set to invalid path, ignoring it

brz

tsujan commented 8 years ago

All right, here's what I get with lxqt-config and lxqt-qtplugin installed - still blank icon for encrypted volume:

Now it seems to be a bug. I'll look into it.

tsujan commented 8 years ago

@alex3kov Please check with Faience (instead of Breeze) too and tell me the result!

tsujan commented 8 years ago

For reference: Somehow, QIcon::fromTheme() returns a null icon in libfm-qt → icontheme.cpp. I could investigate why only if I had an encrypted volume to get the icon name :(

Since I think that, even without lxqt-qtplugin, there should be an icon instead of "unknown", I reopen the issue. Also the missing lock emblem deserves an investigation.

alex3kov commented 8 years ago

@tsujan Faience. I copied from first post for simplicity, but it looks the same. new

tsujan commented 8 years ago

@alex3kov Good! I was going to ask you again.

So, as far as I can see, this is a bug because that icon exists in Faience but IconTheme::convertFromGIcon() (in libfm-qt → icontheme.cpp) returns a fallback icon ("unknown").

tsujan commented 8 years ago

As http://doc.qt.io/qt-5/qicon.html says, starting with Qt5.7, "Qt will make use of GTK's icon-theme.cache if present to speed up the lookup..."

@alex3kov, could you update the gtk icon cache with the following command and see if the problem is fixed?

gtk-update-icon-cache --force PATH

Replace PATH with faience's directory path! If it's installed in /usr/share/themes, you'll need to add a "sudo" to the beginning.

alex3kov commented 8 years ago

@tsujan

# gtk-update-icon-cache --force /usr/share/icons/Faience/
gtk-update-icon-cache: Cache file created successfully.

No change in pcmanfm-qt.

alex3kov commented 8 years ago

@tsujan

I could investigate why only if I had an encrypted volume to get the icon name :(

Just an idea - if you don't want to mess with your disk layout, you could create a small encrypted volume on some USB stick.

tsujan commented 8 years ago

Just an idea - if you don't want to mess with your disk layout, you could create a small encrypted volume on some USB stick

Now I'm busy but I'll do it soon. Good idea!

tsujan commented 8 years ago

I encrypted a USB stick (encUSB) and, at last, saw the problem:

encrypted

I'll experiment with libfm-qt when I have time.

EDIT: The problem can't be in Qt because Dolphin shows a decent icon ;)

tsujan commented 8 years ago

Found the root of problem after a few minutes (no solution yet):

In GLib terms, the icon for encrypted volumes is a GEmblemedIcon, while other volumes have a GThemedIcon. Now, GEmblemedIcon isn't handled in libfm-qt → icontheme.cppIconTheme::convertFromGIcon().

My GLib knowledge is poor. So, to fix this problem, I first have to study GLib. @PCMan could fix the issue faster.

tsujan commented 8 years ago

@alex3kov, if you're familiar with compiling from the source, check https://github.com/lxde/libfm-qt/pull/41 (it works here with my encrypted USB flash); otherwise, wait until it's merged and your distro gets it. My poor knowledge of GLib was enough after all ;)

alex3kov commented 8 years ago

I'd rather compile/test it.

Not sure how to do that though - I cloned lxde/libfm-qt and switched to emblemed_icons - git checkout remotes/origin/emblemed_icons. Neither make nor cmake are working though:


$ make
make: *** No targets specified and no makefile found.  Stop.

$ cmake
Usage

   cmake [options] <path-to-source>

    ...

I'm not too familiar with git/github, what's the correct way to do it?

/--Regards, Aleksei/


From: Tsujan Sent: Tuesday, September 27, 2016 3:01PM To: Lxde/pcmanfm-qt Cc: Aleksei Kovura, Mention Subject: Re: [lxde/pcmanfm-qt] Icon for encrypted volume (#400)

@alex3kov https://github.com/alex3kov, if you're familiar with compiling from the source, check lxde/libfm-qt#41 https://github.com/lxde/libfm-qt/pull/41 (it works here with my encrypted USB flash); otherwise, wait until it's merged and your distro gets it. My poor knowledge of GLib was enough after all ;)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/lxde/pcmanfm-qt/issues/400#issuecomment-249844896, or mute the thread https://github.com/notifications/unsubscribe-auth/ADct8guVZ6ty6ssdudTztyWPvM-7zieRks5quQWXgaJpZM4KFwaq.

tsujan commented 8 years ago

Not sure how to do that though

So, preferably, don't do it! It may cause damages to parts of your system.

alex3kov commented 8 years ago

I've compiled things before :) Just not sure how to pull that PR into local tree.
Anyway, there's a libfm-qt-git in AUR, so I'll get it from there when it's merged into master branch.

tsujan commented 8 years ago

Anyway, there's a libfm-qt-git in AUR, so I'll get it from there when it's merged into master branch.

That's a better choice. It's always better to make installable packages first. Make sure you use pcmanfm-qt-git with it then!

pmattern commented 8 years ago

@alex3kov See https://wiki.archlinux.org/index.php/VCS_package_guidelines#VCS_sources for instructions to build packages based upon particular commits or branches easily. Involves building the package by running makepkg in a local copy of the AUR stuff as e. g. acquired by running git clone https://aur.archlinux.org/libfm-qt-git.git but that's actually basic knowledge of AUR usage.

alex3kov commented 8 years ago

Meh :) I'll just wait for the merge to master.

/--Regards, Aleksei/


From: Peter Mattern Sent: Tuesday, September 27, 2016 6:31PM To: Lxde/pcmanfm-qt Cc: Aleksei Kovura, Mention Subject: Re: [lxde/pcmanfm-qt] Icon for encrypted volume (#400)

@alex3kov https://github.com/alex3kov See https://wiki.archlinux.org/index.php/VCS_package_guidelines#VCS_sources for how to create packages based upon particular commits or branches easily. Involves building the package by running |makepkg| in a local copy of the AUR stuff as e. g. acquired by running |git clone https://aur.archlinux.org/libfm-qt-git.git| but that's actually basic knowledge of AUR usage.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/lxde/pcmanfm-qt/issues/400#issuecomment-249901437, or mute the thread https://github.com/notifications/unsubscribe-auth/ADct8vph0QlEr95cILXyLAg5d16rENvcks5quTbYgaJpZM4KFwaq.

pmattern commented 8 years ago

Also, note the current proposal isn't complete yet and the padlock / emblems in general have to be considered wip. See discussion in lxde/libfm-qt#41.

alex3kov commented 8 years ago

I tested latest code from git - it works with encrypted volumes on internal drives as well (@tsujan was testing on pluggable USB stick).