Skip to content

Commit

Permalink
Use resource file for curves, cursors
Browse files Browse the repository at this point in the history
  • Loading branch information
ferdnyc committed Aug 6, 2020
1 parent 59f932d commit f7a500a
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
7 changes: 3 additions & 4 deletions src/windows/models/properties_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@
from PyQt5.QtCore import QMimeData, Qt, QLocale, QTimer
from PyQt5.QtGui import *

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

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

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

# Set the background color of the cell
Expand Down
24 changes: 12 additions & 12 deletions src/windows/video_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,10 @@
from PyQt5.QtWidgets import QSizePolicy, QWidget, QPushButton
import openshot # Python module for libopenshot (required video editing module installed separately)

from classes import info, updates, openshot_rc
from classes.logger import log
from classes.app import get_app
from classes.query import Clip
from classes import updates
from classes import info

import os
import json
Expand Down Expand Up @@ -803,16 +802,17 @@ def __init__(self, *args):
self.resize_button.setMouseTracking(True)

# Initialize cursors
self.cursors = { "move": QPixmap(os.path.join(info.IMAGES_PATH, "cursor_move.png")),
"resize_x": QPixmap(os.path.join(info.IMAGES_PATH, "cursor_resize_x.png")),
"resize_y": QPixmap(os.path.join(info.IMAGES_PATH, "cursor_resize_y.png")),
"resize_bdiag": QPixmap(os.path.join(info.IMAGES_PATH, "cursor_resize_bdiag.png")),
"resize_fdiag": QPixmap(os.path.join(info.IMAGES_PATH, "cursor_resize_fdiag.png")),
"rotate": QPixmap(os.path.join(info.IMAGES_PATH, "cursor_rotate.png")),
"shear_x": QPixmap(os.path.join(info.IMAGES_PATH, "cursor_shear_x.png")),
"shear_y": QPixmap(os.path.join(info.IMAGES_PATH, "cursor_shear_y.png")),
"hand": QPixmap(os.path.join(info.IMAGES_PATH, "cursor_hand.png")),
}
self.cursors = {
"move": QPixmap(":/cursors/cursor_move.png"),
"resize_x": QPixmap(":/cursors/cursor_resize_x.png"),
"resize_y": QPixmap(":/cursors/cursor_resize_y.png"),
"resize_bdiag": QPixmap(":/cursors/cursor_resize_bdiag.png"),
"resize_fdiag": QPixmap(":/cursors/cursor_resize_fdiag.png"),
"rotate": QPixmap(":/cursors/cursor_rotate.png"),
"shear_x": QPixmap(":/cursors/cursor_shear_x.png"),
"shear_y": QPixmap(":/cursors/cursor_shear_y.png"),
"hand": QPixmap(":/cursors/cursor_hand.png"),
}

# Mutex lock
self.mutex = QMutex()
Expand Down
9 changes: 5 additions & 4 deletions src/windows/views/properties_tableview.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,11 @@ def __init__(self, parent=None, *args):
QItemDelegate.__init__(self, parent, *args)

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

def paint(self, painter, option, index):
painter.save()
Expand Down

0 comments on commit f7a500a

Please sign in to comment.