mirror of https://gitlab.com/pamhyr/pamhyr2
Pamhyr2: Add new logo.
parent
e350b7d8f5
commit
48e010f195
Binary file not shown.
|
|
@ -28,7 +28,7 @@ from tools import logger_exception
|
|||
|
||||
from PyQt5 import QtGui
|
||||
from PyQt5.QtGui import (
|
||||
QKeySequence, QDesktopServices,
|
||||
QKeySequence, QDesktopServices, QIcon,
|
||||
)
|
||||
|
||||
from PyQt5.QtCore import (
|
||||
|
|
@ -333,6 +333,15 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
|
|||
self.update_enable_action()
|
||||
# self.showMaximized()
|
||||
|
||||
image = os.path.abspath(
|
||||
os.path.join(
|
||||
os.path.dirname(__file__),
|
||||
"ui", "ressources",
|
||||
"Pamhyr2_logo.png"
|
||||
)
|
||||
)
|
||||
self.setWindowIcon(QIcon(image))
|
||||
|
||||
def set_debug_lvl(self, debug=True):
|
||||
if debug:
|
||||
logger.setLevel(logging.DEBUG)
|
||||
|
|
|
|||
|
|
@ -496,12 +496,7 @@ class ASubMainWindow(QMainWindow, ASubWindowFeatures, WindowToolKit):
|
|||
super(ASubMainWindow, self).__init__(parent=parent)
|
||||
if ui is not None:
|
||||
self.ui = loadUi(
|
||||
os.path.abspath(
|
||||
os.path.join(
|
||||
os.path.dirname(__file__),
|
||||
"..", "ui", f"{ui}.ui"
|
||||
)
|
||||
),
|
||||
os.path.join(self._get_ui_directory(), f"{ui}.ui"),
|
||||
self
|
||||
)
|
||||
|
||||
|
|
@ -510,6 +505,14 @@ class ASubMainWindow(QMainWindow, ASubWindowFeatures, WindowToolKit):
|
|||
if self.parent is not None:
|
||||
self.parent.sub_win_add(name, self)
|
||||
|
||||
def _get_ui_directory(self):
|
||||
return os.path.abspath(
|
||||
os.path.join(
|
||||
os.path.dirname(__file__),
|
||||
"..", "ui"
|
||||
)
|
||||
)
|
||||
|
||||
def closeEvent(self, event):
|
||||
if self.parent is not None:
|
||||
self.parent.sub_win_del(self.hash())
|
||||
|
|
|
|||
|
|
@ -16,10 +16,11 @@
|
|||
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import os
|
||||
import logging
|
||||
|
||||
from PyQt5.QtGui import (
|
||||
QKeySequence,
|
||||
QKeySequence, QIcon,
|
||||
)
|
||||
|
||||
from PyQt5.QtWidgets import (
|
||||
|
|
@ -97,6 +98,17 @@ class PamhyrWindowTools(object):
|
|||
"""
|
||||
self.ui.setWindowTitle(self._title)
|
||||
|
||||
def _set_icon(self):
|
||||
self.setWindowIcon(
|
||||
QIcon(
|
||||
os.path.join(
|
||||
self._get_ui_directory(),
|
||||
"ressources",
|
||||
"Pamhyr2_logo.png"
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
def _update(self):
|
||||
"""Update window display component
|
||||
|
||||
|
|
@ -173,6 +185,7 @@ class PamhyrWindow(ASubMainWindow, ListedSubWindow, PamhyrWindowTools):
|
|||
self._hash_data.append(self._config)
|
||||
|
||||
self._set_title()
|
||||
self._set_icon()
|
||||
|
||||
def closeEvent(self, event):
|
||||
self._close_sub_window()
|
||||
|
|
|
|||
Binary file not shown.
|
After Width: | Height: | Size: 30 KiB |
Loading…
Reference in New Issue