Skip to content

Commit a75e70b

Browse files
fix: include svg icons in build and update fallbacks
1 parent 6a09a9f commit a75e70b

File tree

3 files changed

+45
-41
lines changed

3 files changed

+45
-41
lines changed

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ jobs:
277277
Priority: optional
278278
Architecture: ${{ steps.arch-linux.outputs.deb_arch }}
279279
Depends: libc6, libstdc++6, libqt6core6, libqt6gui6, libqt6widgets6
280-
Maintainer: Glimpse Team <noreply@example.com>
280+
Maintainer: radioactiveorange <github.com/radioactiveorange>
281281
Description: Random image viewer for collections
282282
A cross-platform desktop application for viewing random images from folders
283283
or collections. Useful for reference studies, browsing large image libraries,
@@ -294,7 +294,7 @@ jobs:
294294
Source: https://github.com/radioactiveorange/glimpse
295295
296296
Files: *
297-
Copyright: 2024 Glimpse Team
297+
Copyright: 2025 radioactiveorange
298298
License: GPL-3.0+
299299
This program is free software: you can redistribute it and/or modify
300300
it under the terms of the GNU General Public License as published by

glimpse.spec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ a = Analysis(
1212
['main.py'],
1313
pathex=[],
1414
binaries=[],
15-
datas=[('app_icon.png', '.'), ('app_icon.ico', '.')],
15+
datas=[('app_icon.png', '.'), ('app_icon.ico', '.'), ('app_icon.svg', '.'), ('icons', 'icons')],
1616
hiddenimports=[],
1717
hookspath=[],
1818
hooksconfig={},

src/core/image_utils.py

Lines changed: 42 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -182,26 +182,32 @@ def _create_coded_icon(icon_type, size=24, color="#ffffff"):
182182
margin = size // 5 # Larger margin for clearer shapes
183183

184184
if icon_type == "previous":
185-
# Clear left-pointing triangle (kept for backward compatibility)
186-
points = [
187-
QPoint(center + margin, margin),
188-
QPoint(center + margin, size - margin),
189-
QPoint(margin, center)
190-
]
191-
painter.setBrush(brush)
192-
painter.setPen(Qt.NoPen)
193-
painter.drawPolygon(QPolygon(points))
185+
# Chevron pointing left (matches SVG)
186+
painter.setBrush(Qt.NoBrush)
187+
painter.setPen(pen)
188+
189+
# Left-pointing chevron: two lines forming <
190+
x1, y1 = center + margin//2, margin + 2
191+
x2, y2 = margin + 2, center
192+
x3, y3 = center + margin//2, size - margin - 2
193+
194+
# Draw the two lines of the chevron
195+
painter.drawLine(x1, y1, x2, y2)
196+
painter.drawLine(x2, y2, x3, y3)
194197

195198
elif icon_type == "next":
196-
# Clear right-pointing triangle (kept for backward compatibility)
197-
points = [
198-
QPoint(center - margin, margin),
199-
QPoint(center - margin, size - margin),
200-
QPoint(size - margin, center)
201-
]
202-
painter.setBrush(brush)
203-
painter.setPen(Qt.NoPen)
204-
painter.drawPolygon(QPolygon(points))
199+
# Chevron pointing right (matches SVG)
200+
painter.setBrush(Qt.NoBrush)
201+
painter.setPen(pen)
202+
203+
# Right-pointing chevron: two lines forming >
204+
x1, y1 = center - margin//2, margin + 2
205+
x2, y2 = size - margin - 2, center
206+
x3, y3 = center - margin//2, size - margin - 2
207+
208+
# Draw the two lines of the chevron
209+
painter.drawLine(x1, y1, x2, y2)
210+
painter.drawLine(x2, y2, x3, y3)
205211

206212
elif icon_type == "pause":
207213
# Two thick vertical bars with proper spacing
@@ -401,31 +407,29 @@ def _create_coded_icon(icon_type, size=24, color="#ffffff"):
401407
painter.drawLine(check_x + check_size // 2, check_y + check_size // 2, check_x + check_size * 2, check_y - check_size)
402408

403409
elif icon_type == "shuffle":
404-
# Shuffle icon (crossed arrows)
410+
# Shuffle icon - diagonal crossing arrows (matches SVG design)
405411
painter.setBrush(Qt.NoBrush)
406412
painter.setPen(pen)
407413

408-
# Arrow sizes
409-
arrow_len = (size - 2 * margin) // 3
414+
# Arrow head size
410415
head_size = size // 8
411416

412-
# Top arrow (left to right)
413-
top_y = margin + arrow_len
414-
painter.drawLine(margin + arrow_len//2, top_y, size - margin - arrow_len//2, top_y)
415-
# Arrow head
416-
painter.drawLine(size - margin - arrow_len//2, top_y,
417-
size - margin - arrow_len//2 - head_size, top_y - head_size//2)
418-
painter.drawLine(size - margin - arrow_len//2, top_y,
419-
size - margin - arrow_len//2 - head_size, top_y + head_size//2)
420-
421-
# Bottom arrow (right to left)
422-
bottom_y = size - margin - arrow_len
423-
painter.drawLine(size - margin - arrow_len//2, bottom_y, margin + arrow_len//2, bottom_y)
424-
# Arrow head
425-
painter.drawLine(margin + arrow_len//2, bottom_y,
426-
margin + arrow_len//2 + head_size, bottom_y - head_size//2)
427-
painter.drawLine(margin + arrow_len//2, bottom_y,
428-
margin + arrow_len//2 + head_size, bottom_y + head_size//2)
417+
# Main diagonal crossing line (bottom-left to top-right)
418+
painter.drawLine(margin + 2, size - margin - 2, size - margin - 2, margin + 2)
419+
420+
# Top-right arrow components
421+
# Top horizontal line with arrow
422+
painter.drawLine(size - margin - size//3, margin + 2, size - margin - 2, margin + 2)
423+
painter.drawLine(size - margin - 2, margin + 2, size - margin - head_size, margin + 2 + head_size//2)
424+
# Right vertical line with arrow
425+
painter.drawLine(size - margin - 2, margin + 2, size - margin - 2, margin + size//3)
426+
painter.drawLine(size - margin - 2, margin + size//3, size - margin - 2 - head_size//2, margin + size//3 - head_size)
427+
428+
# Bottom-left arrow components
429+
painter.drawLine(margin + 2, size - margin - size//3, margin + 2, size - margin - 2)
430+
painter.drawLine(margin + 2, size - margin - 2, margin + 2 + head_size//2, size - margin - 2 - head_size)
431+
painter.drawLine(margin + 2, size - margin - 2, margin + size//3, size - margin - 2)
432+
painter.drawLine(margin + size//3, size - margin - 2, margin + size//3 - head_size, size - margin - 2 - head_size//2)
429433

430434
painter.end()
431435
return QIcon(pixmap)

0 commit comments

Comments
 (0)