Skip to content

Commit f7a500a

Browse files
committed
Use resource file for curves, cursors
1 parent 59f932d commit f7a500a

File tree

3 files changed

+20
-20
lines changed

3 files changed

+20
-20
lines changed

src/windows/models/properties_model.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@
3232
from PyQt5.QtCore import QMimeData, Qt, QLocale, QTimer
3333
from PyQt5.QtGui import *
3434

35-
from classes import updates
36-
from classes import info
35+
from classes import info, updates, openshot_rc
3736
from classes.query import Clip, Transition, Effect, File
3837
from classes.logger import log
3938
from classes.app import get_app
@@ -672,7 +671,7 @@ def update_model(self, filter=""):
672671
col.setData((c.Id(), item_type))
673672
if points > 1:
674673
# Apply icon to cell
675-
my_icon = QPixmap(os.path.join(info.IMAGES_PATH, "keyframe-%s.png" % interpolation))
674+
my_icon = QPixmap(":/curves/keyframe-%s.png" % interpolation)
676675
col.setData(my_icon, Qt.DecorationRole)
677676

678677
# Set the background color of the cell
@@ -755,7 +754,7 @@ def update_model(self, filter=""):
755754

756755
if points > 1:
757756
# Apply icon to cell
758-
my_icon = QPixmap(os.path.join(info.IMAGES_PATH, "keyframe-%s.png" % interpolation))
757+
my_icon = QPixmap(":/curves/keyframe-%s.png" % interpolation)
759758
col.setData(my_icon, Qt.DecorationRole)
760759

761760
# Set the background color of the cell

src/windows/video_widget.py

+12-12
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,10 @@
3030
from PyQt5.QtWidgets import QSizePolicy, QWidget, QPushButton
3131
import openshot # Python module for libopenshot (required video editing module installed separately)
3232

33+
from classes import info, updates, openshot_rc
3334
from classes.logger import log
3435
from classes.app import get_app
3536
from classes.query import Clip
36-
from classes import updates
37-
from classes import info
3837

3938
import os
4039
import json
@@ -803,16 +802,17 @@ def __init__(self, *args):
803802
self.resize_button.setMouseTracking(True)
804803

805804
# Initialize cursors
806-
self.cursors = { "move": QPixmap(os.path.join(info.IMAGES_PATH, "cursor_move.png")),
807-
"resize_x": QPixmap(os.path.join(info.IMAGES_PATH, "cursor_resize_x.png")),
808-
"resize_y": QPixmap(os.path.join(info.IMAGES_PATH, "cursor_resize_y.png")),
809-
"resize_bdiag": QPixmap(os.path.join(info.IMAGES_PATH, "cursor_resize_bdiag.png")),
810-
"resize_fdiag": QPixmap(os.path.join(info.IMAGES_PATH, "cursor_resize_fdiag.png")),
811-
"rotate": QPixmap(os.path.join(info.IMAGES_PATH, "cursor_rotate.png")),
812-
"shear_x": QPixmap(os.path.join(info.IMAGES_PATH, "cursor_shear_x.png")),
813-
"shear_y": QPixmap(os.path.join(info.IMAGES_PATH, "cursor_shear_y.png")),
814-
"hand": QPixmap(os.path.join(info.IMAGES_PATH, "cursor_hand.png")),
815-
}
805+
self.cursors = {
806+
"move": QPixmap(":/cursors/cursor_move.png"),
807+
"resize_x": QPixmap(":/cursors/cursor_resize_x.png"),
808+
"resize_y": QPixmap(":/cursors/cursor_resize_y.png"),
809+
"resize_bdiag": QPixmap(":/cursors/cursor_resize_bdiag.png"),
810+
"resize_fdiag": QPixmap(":/cursors/cursor_resize_fdiag.png"),
811+
"rotate": QPixmap(":/cursors/cursor_rotate.png"),
812+
"shear_x": QPixmap(":/cursors/cursor_shear_x.png"),
813+
"shear_y": QPixmap(":/cursors/cursor_shear_y.png"),
814+
"hand": QPixmap(":/cursors/cursor_hand.png"),
815+
}
816816

817817
# Mutex lock
818818
self.mutex = QMutex()

src/windows/views/properties_tableview.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,11 @@ def __init__(self, parent=None, *args):
4646
QItemDelegate.__init__(self, parent, *args)
4747

4848
# pixmaps for curve icons
49-
self.curve_pixmaps = {openshot.BEZIER: QPixmap(os.path.join(info.IMAGES_PATH, "keyframe-%s.png" % openshot.BEZIER)),
50-
openshot.LINEAR: QPixmap(os.path.join(info.IMAGES_PATH, "keyframe-%s.png" % openshot.LINEAR)),
51-
openshot.CONSTANT: QPixmap(os.path.join(info.IMAGES_PATH, "keyframe-%s.png" % openshot.CONSTANT))
52-
}
49+
self.curve_pixmaps = {
50+
openshot.BEZIER: QPixmap(":/curves/keyframe-%s.png" % openshot.BEZIER),
51+
openshot.LINEAR: QPixmap(":/curves/keyframe-%s.png" % openshot.LINEAR),
52+
openshot.CONSTANT: QPixmap(":/curves/keyframe-%s.png" % openshot.CONSTANT),
53+
}
5354

5455
def paint(self, painter, option, index):
5556
painter.save()

0 commit comments

Comments
 (0)