Skip to content

Commit 6930441

Browse files
committed
Icon working in window
1 parent 3cdd6ce commit 6930441

File tree

4 files changed

+13
-7
lines changed

4 files changed

+13
-7
lines changed

Interval Timer Python - To Do.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
- Feature: hovering over always on top and minimalist mode toggles gives pop up info
88

9-
- Feature: add custom icon
9+
-
1010

1111

1212
---------------- Finished ----------------
@@ -54,4 +54,6 @@ for 3 seconds at the end of all rounds
5454

5555
- Feature: dot indication mode
5656

57-
- exe version
57+
- exe version
58+
59+
- Feature: Icon file used in window and file explorer

main.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
QLabel, QPushButton, QSlider, QProgressBar, QLineEdit, QMenu
1111
)
1212
from PyQt5.QtCore import Qt, QTimer, QPoint
13-
from PyQt5.QtGui import QPixmap, QTransform, QFont, QIntValidator, QPalette, QColor, QPainter, QPen, QBrush
13+
from PyQt5.QtGui import QPixmap, QTransform, QFont, QIntValidator, QPalette, QColor, QPainter, QPen, QBrush, QIcon
1414

1515
import pygame
1616

@@ -126,6 +126,9 @@ class WorkoutTimer(QMainWindow):
126126
def __init__(self):
127127
super().__init__()
128128

129+
# Set the window icon
130+
self.setWindowIcon(QIcon(resource_path("icon.ico")))
131+
129132
# Load settings
130133
self.settings = Settings.load_from_file()
131134
self.workout_duration = self.settings.workout_duration

settings.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"workout_duration": 7,
3-
"rest_duration": 4,
4-
"rounds": 41,
2+
"workout_duration": 60,
3+
"rest_duration": 45,
4+
"rounds": 10,
55
"lead_up_duration": 5
66
}

workout_timer.spec

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ a = Analysis(
1313
('style.qss', '.'),
1414
('work_finish.mp3', '.'),
1515
('rest_finish.mp3', '.'),
16-
('complete_finish.mp3', '.')
16+
('complete_finish.mp3', '.'),
17+
('icon.ico', '.')
1718
],
1819
hiddenimports=['pygame'], # Hidden imports not detected automatically
1920
hookspath=[], # Custom hooks for PyInstaller

0 commit comments

Comments
 (0)