mirror of
https://github.com/TagStudioDev/TagStudio.git
synced 2026-01-31 15:19:10 +00:00
Merge remote-tracking branch 'refs/remotes/upstream/main'
This commit is contained in:
BIN
tagstudio/resources/icon.icns
Normal file
BIN
tagstudio/resources/icon.icns
Normal file
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 628 KiB After Width: | Height: | Size: 148 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 992 KiB After Width: | Height: | Size: 677 KiB |
@@ -84,7 +84,7 @@ class CliDriver:
|
||||
|
||||
self.external_preview_size: tuple[int, int] = (960, 960)
|
||||
epd_path = os.path.normpath(
|
||||
f"{Path(__file__).parent.parent.parent}/resources/cli/images/external_preview.png"
|
||||
f"{Path(__file__).parents[2]}/resources/cli/images/external_preview.png"
|
||||
)
|
||||
self.external_preview_default: Image = (
|
||||
Image.open(epd_path)
|
||||
@@ -93,7 +93,7 @@ class CliDriver:
|
||||
)
|
||||
self.external_preview_default.thumbnail(self.external_preview_size)
|
||||
epb_path = os.path.normpath(
|
||||
f"{Path(__file__).parent.parent.parent}/resources/cli/images/no_preview.png"
|
||||
f"{Path(__file__).parents[2]}/resources/cli/images/no_preview.png"
|
||||
)
|
||||
self.external_preview_broken: Image = (
|
||||
Image.open(epb_path)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,20 +1,13 @@
|
||||
<!-- TO COMPILE: pyside6-rcc resources.qrc -o resources.py (in \tagstudio\src\qt)-->
|
||||
<!-- TO COMPILE: pyside6-rcc resources.qrc -o resources_rc.py (in \tagstudio\src\qt)-->
|
||||
<RCC>
|
||||
<qresource prefix="/">
|
||||
<file alias = "images/star_icon_empty_128.png">../../resources/qt/images/star_icon_empty_128.png</file>
|
||||
<file alias = "images/star_icon_filled_128.png">../../resources/qt/images/star_icon_filled_128.png</file>
|
||||
<file alias = "images/box_icon_empty_128.png">../../resources/qt/images/box_icon_empty_128.png</file>
|
||||
<file alias = "images/box_icon_filled_128.png">../../resources/qt/images/box_icon_filled_128.png</file>
|
||||
<file alias = "images/edit_icon_128.png">../../resources/qt/images/edit_icon_128.png</file>
|
||||
<file alias = "images/trash_icon_128.png">../../resources/qt/images/trash_icon_128.png</file>
|
||||
<file alias = "images/clipboard_icon_128.png">../../resources/qt/images/clipboard_icon_128.png</file>
|
||||
<file alias = "images/splash.png">../../resources/qt/images/splash.png</file>
|
||||
<!-- <file>../../CommonClasses/PNGWriter/report_text/GothamBlackRegular.otf</file>
|
||||
<file>../../CommonClasses/PNGWriter/report_text/GothamBold.otf</file>
|
||||
<file>../../CommonClasses/PNGWriter/report_text/GothamBook.otf</file>
|
||||
<file>../../CommonClasses/PNGWriter/report_text/GothamLight.otf</file>
|
||||
<file>../../CommonClasses/PNGWriter/report_text/GothamMedium.otf</file>
|
||||
<file>../../CommonClasses/PNGWriter/report_text/Spanish</file>
|
||||
<file>../../CommonClasses/PNGWriter/report_text/viewmind.png</file> -->
|
||||
<!-- <file alias = "images/edit_icon_128.png">../../resources/qt/images/edit_icon_128.png</file> -->
|
||||
<!-- <file alias = "images/trash_icon_128.png">../../resources/qt/images/trash_icon_128.png</file> -->
|
||||
<!-- <file alias = "images/clipboard_icon_128.png">../../resources/qt/images/clipboard_icon_128.png</file> -->
|
||||
<!-- <file alias = "images/splash.png">../../resources/qt/images/splash.png</file> -->
|
||||
</qresource>
|
||||
</RCC>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -90,6 +90,7 @@ from src.qt.modals import (
|
||||
FixDupeFilesModal,
|
||||
FoldersToTagsModal,
|
||||
)
|
||||
|
||||
import src.qt.resources_rc
|
||||
|
||||
# SIGQUIT is not defined on Windows
|
||||
@@ -230,9 +231,7 @@ class QtDriver(QObject):
|
||||
# QPalette.ColorRole.Window, QColor('#110F1B'))
|
||||
# app.setPalette(pal)
|
||||
home_path = os.path.normpath(f"{Path(__file__).parent}/ui/home.ui")
|
||||
icon_path = os.path.normpath(
|
||||
f"{Path(__file__).parent.parent.parent}/resources/icon.png"
|
||||
)
|
||||
icon_path = os.path.normpath(f"{Path(__file__).parents[2]}/resources/icon.png")
|
||||
|
||||
# Handle OS signals
|
||||
self.setup_signals()
|
||||
@@ -257,7 +256,9 @@ class QtDriver(QObject):
|
||||
# self.windowFX = WindowEffect()
|
||||
# self.windowFX.setAcrylicEffect(self.main_window.winId())
|
||||
|
||||
splash_pixmap = QPixmap(":/images/splash.png")
|
||||
splash_pixmap = QPixmap(
|
||||
f"{Path(__file__).parents[2]}/resources/qt/images/splash.png"
|
||||
)
|
||||
splash_pixmap.setDevicePixelRatio(self.main_window.devicePixelRatio())
|
||||
self.splash = QSplashScreen(splash_pixmap)
|
||||
# self.splash.setAttribute(Qt.WidgetAttribute.WA_TranslucentBackground)
|
||||
@@ -437,9 +438,10 @@ class QtDriver(QObject):
|
||||
# self.main_window.centralWidget().layout().addWidget(menu_bar, 0,0,1,1)
|
||||
# self.main_window.tb_layout.addWidget(menu_bar)
|
||||
|
||||
icon = QIcon()
|
||||
icon.addFile(icon_path)
|
||||
self.main_window.setWindowIcon(icon)
|
||||
if sys.platform != "darwin":
|
||||
icon = QIcon()
|
||||
icon.addFile(icon_path)
|
||||
self.main_window.setWindowIcon(icon)
|
||||
|
||||
self.preview_panel = PreviewPanel(self.lib, self)
|
||||
l: QHBoxLayout = self.main_window.splitter
|
||||
@@ -455,7 +457,7 @@ class QtDriver(QObject):
|
||||
|
||||
QFontDatabase.addApplicationFont(
|
||||
os.path.normpath(
|
||||
f"{Path(__file__).parent.parent.parent}/resources/qt/fonts/Oxanium-Bold.ttf"
|
||||
f"{Path(__file__).parents[2]}/resources/qt/fonts/Oxanium-Bold.ttf"
|
||||
)
|
||||
)
|
||||
|
||||
@@ -472,7 +474,7 @@ class QtDriver(QObject):
|
||||
# so the resource isn't being used, then store the specific size variations
|
||||
# in a global dict for methods to access for different DPIs.
|
||||
# adj_font_size = math.floor(12 * self.main_window.devicePixelRatio())
|
||||
# self.ext_font = ImageFont.truetype(os.path.normpath(f'{Path(__file__).parent.parent.parent}/resources/qt/fonts/Oxanium-Bold.ttf'), adj_font_size)
|
||||
# self.ext_font = ImageFont.truetype(os.path.normpath(f'{Path(__file__).parents[2]}/resources/qt/fonts/Oxanium-Bold.ttf'), adj_font_size)
|
||||
|
||||
search_button: QPushButton = self.main_window.searchButton
|
||||
search_button.clicked.connect(
|
||||
|
||||
@@ -142,7 +142,7 @@ class CollageIconRenderer(QObject):
|
||||
)
|
||||
with Image.open(
|
||||
os.path.normpath(
|
||||
f"{Path(__file__).parent.parent.parent}/resources/qt/images/thumb_broken_512.png"
|
||||
f"{Path(__file__).parents[2]}/resources/qt/images/thumb_broken_512.png"
|
||||
)
|
||||
) as pic:
|
||||
pic.thumbnail(size)
|
||||
|
||||
@@ -16,24 +16,24 @@ from PySide6.QtWidgets import QWidget, QVBoxLayout, QHBoxLayout, QLabel, QPushBu
|
||||
|
||||
|
||||
class FieldContainer(QWidget):
|
||||
# TODO: reference a resources folder rather than path.parent.parent.parent.parent?
|
||||
# TODO: reference a resources folder rather than path.parents[3]?
|
||||
clipboard_icon_128: Image.Image = Image.open(
|
||||
os.path.normpath(
|
||||
f"{Path(__file__).parent.parent.parent.parent}/resources/qt/images/clipboard_icon_128.png"
|
||||
f"{Path(__file__).parents[3]}/resources/qt/images/clipboard_icon_128.png"
|
||||
)
|
||||
).resize((math.floor(24 * 1.25), math.floor(24 * 1.25)))
|
||||
clipboard_icon_128.load()
|
||||
|
||||
edit_icon_128: Image.Image = Image.open(
|
||||
os.path.normpath(
|
||||
f"{Path(__file__).parent.parent.parent.parent}/resources/qt/images/edit_icon_128.png"
|
||||
f"{Path(__file__).parents[3]}/resources/qt/images/edit_icon_128.png"
|
||||
)
|
||||
).resize((math.floor(24 * 1.25), math.floor(24 * 1.25)))
|
||||
edit_icon_128.load()
|
||||
|
||||
trash_icon_128: Image.Image = Image.open(
|
||||
os.path.normpath(
|
||||
f"{Path(__file__).parent.parent.parent.parent}/resources/qt/images/trash_icon_128.png"
|
||||
f"{Path(__file__).parents[3]}/resources/qt/images/trash_icon_128.png"
|
||||
)
|
||||
).resize((math.floor(24 * 1.25), math.floor(24 * 1.25)))
|
||||
trash_icon_128.load()
|
||||
|
||||
@@ -52,14 +52,14 @@ class ItemThumb(FlowWidget):
|
||||
|
||||
collation_icon_128: Image.Image = Image.open(
|
||||
os.path.normpath(
|
||||
f"{Path(__file__).parent.parent.parent.parent}/resources/qt/images/collation_icon_128.png"
|
||||
f"{Path(__file__).parents[3]}/resources/qt/images/collation_icon_128.png"
|
||||
)
|
||||
)
|
||||
collation_icon_128.load()
|
||||
|
||||
tag_group_icon_128: Image.Image = Image.open(
|
||||
os.path.normpath(
|
||||
f"{Path(__file__).parent.parent.parent.parent}/resources/qt/images/tag_group_icon_128.png"
|
||||
f"{Path(__file__).parents[3]}/resources/qt/images/tag_group_icon_128.png"
|
||||
)
|
||||
)
|
||||
tag_group_icon_128.load()
|
||||
|
||||
@@ -25,7 +25,7 @@ INFO = f"[INFO]"
|
||||
class TagWidget(QWidget):
|
||||
edit_icon_128: Image.Image = Image.open(
|
||||
os.path.normpath(
|
||||
f"{Path(__file__).parent.parent.parent.parent}/resources/qt/images/edit_icon_128.png"
|
||||
f"{Path(__file__).parents[3]}/resources/qt/images/edit_icon_128.png"
|
||||
)
|
||||
).resize((math.floor(14 * 1.25), math.floor(14 * 1.25)))
|
||||
edit_icon_128.load()
|
||||
|
||||
@@ -44,48 +44,48 @@ class ThumbRenderer(QObject):
|
||||
|
||||
thumb_mask_512: Image.Image = Image.open(
|
||||
os.path.normpath(
|
||||
f"{Path(__file__).parent.parent.parent.parent}/resources/qt/images/thumb_mask_512.png"
|
||||
f"{Path(__file__).parents[3]}/resources/qt/images/thumb_mask_512.png"
|
||||
)
|
||||
)
|
||||
thumb_mask_512.load()
|
||||
|
||||
thumb_mask_hl_512: Image.Image = Image.open(
|
||||
os.path.normpath(
|
||||
f"{Path(__file__).parent.parent.parent.parent}/resources/qt/images/thumb_mask_hl_512.png"
|
||||
f"{Path(__file__).parents[3]}/resources/qt/images/thumb_mask_hl_512.png"
|
||||
)
|
||||
)
|
||||
thumb_mask_hl_512.load()
|
||||
|
||||
thumb_loading_512: Image.Image = Image.open(
|
||||
os.path.normpath(
|
||||
f"{Path(__file__).parent.parent.parent.parent}/resources/qt/images/thumb_loading_512.png"
|
||||
f"{Path(__file__).parents[3]}/resources/qt/images/thumb_loading_512.png"
|
||||
)
|
||||
)
|
||||
thumb_loading_512.load()
|
||||
|
||||
thumb_broken_512: Image.Image = Image.open(
|
||||
os.path.normpath(
|
||||
f"{Path(__file__).parent.parent.parent.parent}/resources/qt/images/thumb_broken_512.png"
|
||||
f"{Path(__file__).parents[3]}/resources/qt/images/thumb_broken_512.png"
|
||||
)
|
||||
)
|
||||
thumb_broken_512.load()
|
||||
|
||||
thumb_file_default_512: Image.Image = Image.open(
|
||||
os.path.normpath(
|
||||
f"{Path(__file__).parent.parent.parent.parent}/resources/qt/images/thumb_file_default_512.png"
|
||||
f"{Path(__file__).parents[3]}/resources/qt/images/thumb_file_default_512.png"
|
||||
)
|
||||
)
|
||||
thumb_file_default_512.load()
|
||||
|
||||
# thumb_debug: Image.Image = Image.open(os.path.normpath(
|
||||
# f'{Path(__file__).parent.parent.parent}/resources/qt/images/temp.jpg'))
|
||||
# f'{Path(__file__).parents[2]}/resources/qt/images/temp.jpg'))
|
||||
# thumb_debug.load()
|
||||
|
||||
# TODO: Make dynamic font sized given different pixel ratios
|
||||
font_pixel_ratio: float = 1
|
||||
ext_font = ImageFont.truetype(
|
||||
os.path.normpath(
|
||||
f"{Path(__file__).parent.parent.parent.parent}/resources/qt/fonts/Oxanium-Bold.ttf"
|
||||
f"{Path(__file__).parents[3]}/resources/qt/fonts/Oxanium-Bold.ttf"
|
||||
),
|
||||
math.floor(12 * font_pixel_ratio),
|
||||
)
|
||||
@@ -110,7 +110,7 @@ class ThumbRenderer(QObject):
|
||||
ThumbRenderer.font_pixel_ratio = pixelRatio
|
||||
ThumbRenderer.ext_font = ImageFont.truetype(
|
||||
os.path.normpath(
|
||||
f"{Path(__file__).parent.parent.parent.parent}/resources/qt/fonts/Oxanium-Bold.ttf"
|
||||
f"{Path(__file__).parents[3]}/resources/qt/fonts/Oxanium-Bold.ttf"
|
||||
),
|
||||
math.floor(12 * ThumbRenderer.font_pixel_ratio),
|
||||
)
|
||||
@@ -292,7 +292,7 @@ class ThumbRenderer(QObject):
|
||||
ThumbRenderer.font_pixel_ratio = pixelRatio
|
||||
ThumbRenderer.ext_font = ImageFont.truetype(
|
||||
os.path.normpath(
|
||||
f"{Path(__file__).parent.parent.parent.parent}/resources/qt/fonts/Oxanium-Bold.ttf"
|
||||
f"{Path(__file__).parents[3]}/resources/qt/fonts/Oxanium-Bold.ttf"
|
||||
),
|
||||
math.floor(12 * ThumbRenderer.font_pixel_ratio),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user