retext-project / retext

ReText: Simple but powerful editor for Markdown and reStructuredText
GNU General Public License v2.0
1.89k stars 196 forks source link

toolbar icons are missing on MacOS #245

Closed jeremy886 closed 7 years ago

jeremy886 commented 8 years ago

My dirty fix to init.py

icon_path = 'icons/'
if sys.platform == "darwin":
        icon_path = join('/usr/local/lib/python3.5/site-packages/ReText', 'icons/')
else:
        for dir in datadirs:
                if exists(join(dir, 'icons')):
                        icon_path = join(dir, 'icons/')
                        break

I have icons in the icons directory. I think I downloaded them previously.

holzkohlengrill commented 8 years ago

Same problem for me under linux (Ubuntu 16.04)

mitya57 commented 8 years ago

@jeremy886 Please unpack the icons pack to one of datadirs (you can use some debug prints to check what they are on macOS, I guess it would be something like /usr/local/share/retext/). Also, there is already one hack for macOS (for macports package manager), see #198, and I don't want to add another one.

@holzkohlengrill On Ubuntu everything should work perfectly fine. Which desktop environment are you using? What is the output of gsettings get org.gnome.desktop.interface icon-theme command? How did you install ReText, and which version of it you are using?

holzkohlengrill commented 8 years ago

output is: 'ubuntu-mono-dark'

ls /usr/bin/*session
/usr/bin/dbus-run-session  /usr/bin/lightdm-unity8-session
/usr/bin/gnome-session

ReText 6.0.2 (using PyMarkups 2.0.0) Qt version 5.7.0.

Installed via package manager

mitya57 commented 8 years ago

@holzkohlengrill The ls /usr/bin/*session is not as informative as i.e. echo $XDG_CURRENT_DESKTOP, but I assume you are using Unity 8.

As Unity 8 does not provide an XSettings interface, ReText should fall back to using GSettings. Can you please install python3-gi package and try with that?

holzkohlengrill commented 8 years ago
echo $XDG_CURRENT_DESKTOP
Unity

python3-gi was already installed.

mitya57 commented 8 years ago

@holzkohlengrill Oh, so that's Unity 7 actually. Please run one more command then:

python3 -c "from PyQt5 import QtGui; app = QtGui.QGuiApplication([]); print(QtGui.QIcon.themeName())"
holzkohlengrill commented 8 years ago
python3 -c "from PyQt5 import QtGui; app = QtGui.QGuiApplication([]); print(QtGui.QIcon.themeName())"
Adwaita

whatever Adwaita means; probably you know more than I.

Also synced scrolling is not working anymore.

mitya57 commented 8 years ago

Adwaita is an icon theme name, available in adwaita-icon-theme package.

Do you have Adwaita-Qt, or any other custom platform theme installed? If yes, can you try running ReText with QT_QPA_PLATFORMTHEME environment variable unset?

Or just install apt install adwaita-icon-theme as a workaround.

holzkohlengrill commented 8 years ago

seems not:

dpkg -l *-qt
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version      Architecture Description
+++-==============-============-============-=================================
ii  appmenu-qt:amd 0.2.7+14.04. amd64        application menu for Qt
un  kdiff3-qt      <none>       <none>       (no description available)
ii  sni-qt:amd64   0.2.7+15.10. amd64        indicator support for Qt
ii  virtualbox-qt  5.1.6-dfsg-2 amd64        x86 virtualization solution - Qt
mitya57 commented 8 years ago

Ok, if my previous guesses were not correct, here is another one.

You said that you are using Qt 5.7, which is not available in the official Ubuntu repository. The Qt 5.7.0 installers from the official website are missing GTK+ integration support (this is a known issue), so you may be affected by that.

When Qt 5.7.0 arrives in Ubuntu repositories, it would not have this issue, because we build with GTK+ support.

As a workaround to make ReText showing the icons, just install adwaita-icon-theme package.

holzkohlengrill commented 8 years ago

This is what ReText was showing in help>"About Qt"

However:

qmake -v
QMake version 3.0
Using Qt version 5.6.1 in /usr/lib/x86_64-linux-gnu
holzkohlengrill commented 8 years ago

Installing adwaita-icon-theme didn't help.

mitya57 commented 8 years ago

It's getting stranger. Try installing libqt5libqgtk2 package then.

holzkohlengrill commented 8 years ago

Was not installed before but still not working. Do you need any further information from my side?

mitya57 commented 8 years ago

Maybe you have some wrong icon theme name hard-coded in ReText settings?

If you open the settings and enter ubuntu-mono-dark as the icon theme name, will it work?

benletib commented 8 years ago

I had the same pb on a venv install on Ubuntu 12.04. Forcing the icon theme in the settings worked for me, thanks !

holzkohlengrill commented 8 years ago

I tried it once before and it didn't work. Now I tried it again and voila: everything is fine. I just want to mention that one have to restart ReText that changes are being made.

mitya57 commented 8 years ago

Restarting ReText should not be needed, since commit 7e4c9b0d (which is available in 4.1.0 and newer versions)…

holzkohlengrill commented 8 years ago

Hmm.. I also double-checked the code which seems fine in my opinion. Also after installing lxqt-qtplugin which was suggested here https://github.com/lxde/libqtxdg/issues/65

icons were missing without lxqt-qtplugin They should have been missing! It's a job of lxqt-qtplugin to make Qt5 apps know about icon themes.

ReText does something when changing the theme but not actually changing it correctly. Sometimes the icons just disappear and their alternative names were displayed.

mitya57 commented 8 years ago

@holzkohlengrill You said that you were using Unity, so the LXQt plugin does not matter or help here.

yaomtc commented 8 years ago

I've been searching and I can't find answers - how do I set up an icon theme for Qt on Windows? I downloaded this:

https://github.com/pasnox/oxygen-icons-png

But I have no idea where to put it or what to do with it.

Edit by @mitya57: replied in #246

mitya57 commented 7 years ago

@jeremy886 Now that I merged #248, can we close this issue? (Feel free to close it yourself if the bug is fixed for you.)

mitya57 commented 7 years ago

Closing, the issue on macOS should be fixed by #248. If it still happens for somebody then please open a new bug.