adding application icon
This commit is contained in:
parent
4735a78b5d
commit
ea4afadf54
25
install_desktop_integration.sh
Executable file
25
install_desktop_integration.sh
Executable file
@ -0,0 +1,25 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# Install desktop integration files for pyPhotoAlbum
|
||||||
|
|
||||||
|
# Create directories if they don't exist
|
||||||
|
mkdir -p ~/.local/share/applications
|
||||||
|
mkdir -p ~/.local/share/icons/hicolor/256x256/apps
|
||||||
|
|
||||||
|
# Copy desktop file
|
||||||
|
cp pyphotoalbum.desktop ~/.local/share/applications/
|
||||||
|
|
||||||
|
# Copy icon
|
||||||
|
cp pyPhotoAlbum/icons/icon.png ~/.local/share/icons/hicolor/256x256/apps/pyphotoalbum.png
|
||||||
|
|
||||||
|
# Update desktop database
|
||||||
|
if command -v update-desktop-database &> /dev/null; then
|
||||||
|
update-desktop-database ~/.local/share/applications
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Update icon cache
|
||||||
|
if command -v gtk-update-icon-cache &> /dev/null; then
|
||||||
|
gtk-update-icon-cache ~/.local/share/icons/hicolor/
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Desktop integration installed!"
|
||||||
|
echo "You may need to restart the application for changes to take effect."
|
||||||
BIN
pyPhotoAlbum/icons/icon.png
Normal file
BIN
pyPhotoAlbum/icons/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 106 KiB |
@ -6,11 +6,13 @@ This version uses the mixin architecture with auto-generated ribbon configuratio
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
|
from pathlib import Path
|
||||||
from PyQt6.QtWidgets import (
|
from PyQt6.QtWidgets import (
|
||||||
QApplication, QMainWindow, QVBoxLayout, QWidget,
|
QApplication, QMainWindow, QVBoxLayout, QWidget,
|
||||||
QStatusBar
|
QStatusBar
|
||||||
)
|
)
|
||||||
from PyQt6.QtCore import Qt
|
from PyQt6.QtCore import Qt
|
||||||
|
from PyQt6.QtGui import QIcon
|
||||||
|
|
||||||
from pyPhotoAlbum.project import Project
|
from pyPhotoAlbum.project import Project
|
||||||
from pyPhotoAlbum.template_manager import TemplateManager
|
from pyPhotoAlbum.template_manager import TemplateManager
|
||||||
@ -80,6 +82,15 @@ class MainWindow(
|
|||||||
self.setWindowTitle("pyPhotoAlbum")
|
self.setWindowTitle("pyPhotoAlbum")
|
||||||
self.resize(1200, 800)
|
self.resize(1200, 800)
|
||||||
|
|
||||||
|
# Set window icon
|
||||||
|
icon_path = Path(__file__).parent / "icons" / "icon.png"
|
||||||
|
print(f"Window icon path: {icon_path}")
|
||||||
|
print(f"Icon exists: {icon_path.exists()}")
|
||||||
|
if icon_path.exists():
|
||||||
|
icon = QIcon(str(icon_path))
|
||||||
|
print(f"Icon is null: {icon.isNull()}")
|
||||||
|
self.setWindowIcon(icon)
|
||||||
|
|
||||||
# Create main widget with layout
|
# Create main widget with layout
|
||||||
main_widget = QWidget()
|
main_widget = QWidget()
|
||||||
main_layout = QVBoxLayout()
|
main_layout = QVBoxLayout()
|
||||||
@ -163,6 +174,20 @@ def main():
|
|||||||
"""Application entry point"""
|
"""Application entry point"""
|
||||||
app = QApplication(sys.argv)
|
app = QApplication(sys.argv)
|
||||||
|
|
||||||
|
# Set application identity for proper taskbar/window manager integration
|
||||||
|
app.setApplicationName("pyPhotoAlbum")
|
||||||
|
app.setApplicationDisplayName("pyPhotoAlbum")
|
||||||
|
app.setDesktopFileName("pyphotoalbum.desktop")
|
||||||
|
|
||||||
|
# Set application icon
|
||||||
|
icon_path = Path(__file__).parent / "icons" / "icon.png"
|
||||||
|
print(f"Application icon path: {icon_path}")
|
||||||
|
print(f"Icon exists: {icon_path.exists()}")
|
||||||
|
if icon_path.exists():
|
||||||
|
icon = QIcon(str(icon_path))
|
||||||
|
print(f"Icon is null: {icon.isNull()}")
|
||||||
|
app.setWindowIcon(icon)
|
||||||
|
|
||||||
# Enable high DPI scaling
|
# Enable high DPI scaling
|
||||||
try:
|
try:
|
||||||
app.setAttribute(Qt.ApplicationAttribute.AA_EnableHighDpiScaling, True)
|
app.setAttribute(Qt.ApplicationAttribute.AA_EnableHighDpiScaling, True)
|
||||||
|
|||||||
11
pyphotoalbum.desktop
Normal file
11
pyphotoalbum.desktop
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
[Desktop Entry]
|
||||||
|
Type=Application
|
||||||
|
Name=pyPhotoAlbum
|
||||||
|
GenericName=Photo Album Designer
|
||||||
|
Comment=Design photo albums and export them to PDF
|
||||||
|
Exec=pyphotoalbum
|
||||||
|
Icon=pyphotoalbum
|
||||||
|
Terminal=false
|
||||||
|
Categories=Graphics;Photography;Qt;
|
||||||
|
Keywords=photo;album;pdf;design;layout;
|
||||||
|
StartupWMClass=pyPhotoAlbum
|
||||||
@ -56,7 +56,11 @@ where = ["."]
|
|||||||
include = ["pyPhotoAlbum*"]
|
include = ["pyPhotoAlbum*"]
|
||||||
|
|
||||||
[tool.setuptools.package-data]
|
[tool.setuptools.package-data]
|
||||||
pyPhotoAlbum = ["templates/*.json"]
|
pyPhotoAlbum = ["templates/*.json", "icons/*.png"]
|
||||||
|
|
||||||
|
# Desktop integration files (for Linux)
|
||||||
|
# Note: The .desktop file should be installed to ~/.local/share/applications or /usr/share/applications
|
||||||
|
# The icon should be installed to appropriate icon theme directories
|
||||||
|
|
||||||
[tool.pytest.ini_options]
|
[tool.pytest.ini_options]
|
||||||
testpaths = ["tests"]
|
testpaths = ["tests"]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user