1
0
Fork 0
mirror of synced 2024-09-30 17:30:21 +13:00

ImageManager: Increase margin on desktop icons

Add size presets for wide covers
This commit is contained in:
loathingKernel 2023-02-14 10:21:38 +02:00
parent 9f408772e3
commit 034c6f2ade

View file

@ -3,6 +3,7 @@ import json
import pickle import pickle
import zlib import zlib
from enum import Enum from enum import Enum
# from concurrent import futures # from concurrent import futures
from logging import getLogger from logging import getLogger
from pathlib import Path from pathlib import Path
@ -16,12 +17,18 @@ from PyQt5.QtCore import (
QObject, QObject,
QSize, QSize,
QThreadPool, QThreadPool,
QRunnable, QRect, QRectF, QRunnable,
QRect,
QRectF,
) )
from PyQt5.QtGui import ( from PyQt5.QtGui import (
QPixmap, QPixmap,
QImage, QImage,
QPainter, QPainterPath, QColor, QBrush, QTransform, QPen, QPainter,
QPainterPath,
QBrush,
QTransform,
QPen,
) )
from PyQt5.QtWidgets import QApplication from PyQt5.QtWidgets import QApplication
from legendary.models.game import Game from legendary.models.game import Game
@ -52,7 +59,7 @@ class ImageSize:
self.__img_factor = 67 self.__img_factor = 67
self.__size = QSize(self.__img_factor * 3, self.__img_factor * 4) * pixel_ratio / divisor self.__size = QSize(self.__img_factor * 3, self.__img_factor * 4) * pixel_ratio / divisor
else: else:
self.__img_factor = 17 self.__img_factor = 23
self.__size = QSize(self.__img_factor * 16, self.__img_factor * 9) * pixel_ratio / divisor self.__size = QSize(self.__img_factor * 16, self.__img_factor * 9) * pixel_ratio / divisor
# lk: for prettier images set this to true # lk: for prettier images set this to true
self.__smooth_transform: bool = False self.__smooth_transform: bool = False
@ -86,12 +93,17 @@ class ImageSize:
Image = Preset(1, 2) Image = Preset(1, 2)
"""! @brief Size and pixel ratio of the image on disk""" """! @brief Size and pixel ratio of the image on disk"""
ImageWide = Preset(1, 2, Orientation.Wide)
"""! @brief Size and pixel ratio for wide 16/9 image on disk"""
Display = Preset(1, 1) Display = Preset(1, 1)
"""! @brief Size and pixel ratio for displaying""" """! @brief Size and pixel ratio for displaying"""
Wide = Preset(1, 1, Orientation.Wide) DisplayWide = Preset(1, 1, Orientation.Wide)
"""! @brief Size and pixel ratio for wide 16/9 image display""" """! @brief Size and pixel ratio for wide 16/9 image display"""
Wide = DisplayWide
Normal = Display Normal = Display
"""! @brief Same as Display""" """! @brief Same as Display"""
@ -275,12 +287,13 @@ class ImageManager(QObject):
if ImageManager.__icon_overlay is not None: if ImageManager.__icon_overlay is not None:
return ImageManager.__icon_overlay return ImageManager.__icon_overlay
rounded_path = QPainterPath() rounded_path = QPainterPath()
margin = 0.1
rounded_path.addRoundedRect( rounded_path.addRoundedRect(
QRectF( QRectF(
rect.width() * 0.05, rect.width() * margin,
rect.height() * 0.05, rect.height() * margin,
rect.width() - (rect.width() * 0.1), rect.width() - (rect.width() * margin * 2),
rect.height() - (rect.width() * 0.1) rect.height() - (rect.width() * margin * 2)
), ),
rect.height() * 0.2, rect.height() * 0.2,
rect.height() * 0.2, rect.height() * 0.2,