Skip to content

Commit 845af9b

Browse files
committed
Fixing AppImage button icon paths
1 parent a62a5e6 commit 845af9b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/themes/base.py

+8
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
from PyQt5.QtWidgets import QTabWidget, QWidget, QSizePolicy
3434

3535
from classes import ui_util
36+
from classes.info import PATH
3637
from themes.manager import ThemeManager
3738

3839

@@ -109,6 +110,13 @@ def set_toolbar_buttons(self, toolbar, icon_size=24, settings=None):
109110
expand = setting.get("expand", False)
110111
divide = setting.get("divide", False)
111112

113+
# Update button_icon to abs path (if not found)
114+
# This is needed for AppImage, where the relative path is wrong
115+
if button_icon and not button_icon.startswith(":") and not os.path.exists(button_icon):
116+
new_abs_path = os.path.join(PATH, button_icon)
117+
if os.path.exists(new_abs_path):
118+
button_icon = new_abs_path
119+
112120
if expand:
113121
# Add spacer and 'New Version Available' toolbar button (default hidden)
114122
spacer = QWidget(toolbar)

0 commit comments

Comments
 (0)