mirror of
https://github.com/rbreu/beeref.git
synced 2026-03-11 08:54:28 +00:00
Remove old file
This commit is contained in:
parent
49bdfc0d39
commit
6656982ab2
2 changed files with 1 additions and 55 deletions
|
|
@ -1,54 +0,0 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
# This file is part of BeeRef.
|
||||
#
|
||||
# BeeRef is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# BeeRef is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with BeeRef. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
import logging
|
||||
import os.path
|
||||
|
||||
from PyQt6 import QtGui, QtWidgets
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class BeeAssets:
|
||||
_instance = None
|
||||
PATH = os.path.join(os.path.dirname(__file__), 'assets')
|
||||
|
||||
def __new__(cls, *args, **kwargs):
|
||||
if not cls._instance:
|
||||
cls._instance = super().__new__(cls, *args, **kwargs)
|
||||
cls._instance.on_new()
|
||||
return cls._instance
|
||||
|
||||
def on_new(self):
|
||||
logger.debug(f'Assets path: {self.PATH}')
|
||||
|
||||
self.logo = QtGui.QIcon(os.path.join(self.PATH, 'logo.png'))
|
||||
self.cursor_rotate = self.cursor_from_image(
|
||||
'cursor_rotate.png', (20, 20))
|
||||
self.cursor_flip_h = self.cursor_from_image(
|
||||
'cursor_flip_h.png', (20, 20))
|
||||
self.cursor_flip_v = self.cursor_from_image(
|
||||
'cursor_flip_v.png', (20, 20))
|
||||
|
||||
def cursor_from_image(self, filename, hotspot):
|
||||
app = QtWidgets.QApplication.instance()
|
||||
scaling = app.primaryScreen().devicePixelRatio()
|
||||
img = QtGui.QImage(os.path.join(self.PATH, filename))
|
||||
pixmap = QtGui.QPixmap.fromImage(img)
|
||||
pixmap.setDevicePixelRatio(scaling)
|
||||
return QtGui.QCursor(pixmap, hotspot[0]/scaling, hotspot[1]/scaling)
|
||||
|
|
@ -26,7 +26,7 @@ logger = logging.getLogger(__name__)
|
|||
|
||||
class BeeAssets:
|
||||
_instance = None
|
||||
PATH = os.path.join(os.path.dirname(__file__), 'assets')
|
||||
PATH = os.path.dirname(__file__)
|
||||
|
||||
def __new__(cls, *args, **kwargs):
|
||||
if not cls._instance:
|
||||
|
|
|
|||
Loading…
Reference in a new issue