mirror of
https://gitlab.com/pamhyr/pamhyr2.git
synced 2026-10-30 03:20:41 +01:00
Pamhyr2: Add new logo.
This commit is contained in:
1 parent
e350b7d8f5
commit
48e010f195
5 files changed
+33
-8
No files matched your search
Binary file not shown.
+10
-1
@@ -28,7 +28,7 @@ from tools import logger_exception
|
|||||||
|
|
||||||
from PyQt5 import QtGui
|
from PyQt5 import QtGui
|
||||||
from PyQt5.QtGui import (
|
from PyQt5.QtGui import (
|
||||||
QKeySequence, QDesktopServices,
|
QKeySequence, QDesktopServices, QIcon,
|
||||||
)
|
)
|
||||||
|
|
||||||
from PyQt5.QtCore import (
|
from PyQt5.QtCore import (
|
||||||
@@ -333,6 +333,15 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
|
|||||||
self.update_enable_action()
|
self.update_enable_action()
|
||||||
# self.showMaximized()
|
# 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):
|
def set_debug_lvl(self, debug=True):
|
||||||
if debug:
|
if debug:
|
||||||
logger.setLevel(logging.DEBUG)
|
logger.setLevel(logging.DEBUG)
|
||||||
|
|||||||
@@ -496,12 +496,7 @@ class ASubMainWindow(QMainWindow, ASubWindowFeatures, WindowToolKit):
|
|||||||
super(ASubMainWindow, self).__init__(parent=parent)
|
super(ASubMainWindow, self).__init__(parent=parent)
|
||||||
if ui is not None:
|
if ui is not None:
|
||||||
self.ui = loadUi(
|
self.ui = loadUi(
|
||||||
os.path.abspath(
|
os.path.join(self._get_ui_directory(), f"{ui}.ui"),
|
||||||
os.path.join(
|
|
||||||
os.path.dirname(__file__),
|
|
||||||
"..", "ui", f"{ui}.ui"
|
|
||||||
)
|
|
||||||
),
|
|
||||||
self
|
self
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -510,6 +505,14 @@ class ASubMainWindow(QMainWindow, ASubWindowFeatures, WindowToolKit):
|
|||||||
if self.parent is not None:
|
if self.parent is not None:
|
||||||
self.parent.sub_win_add(name, self)
|
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):
|
def closeEvent(self, event):
|
||||||
if self.parent is not None:
|
if self.parent is not None:
|
||||||
self.parent.sub_win_del(self.hash())
|
self.parent.sub_win_del(self.hash())
|
||||||
|
|||||||
@@ -16,10 +16,11 @@
|
|||||||
|
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
import os
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from PyQt5.QtGui import (
|
from PyQt5.QtGui import (
|
||||||
QKeySequence,
|
QKeySequence, QIcon,
|
||||||
)
|
)
|
||||||
|
|
||||||
from PyQt5.QtWidgets import (
|
from PyQt5.QtWidgets import (
|
||||||
@@ -97,6 +98,17 @@ class PamhyrWindowTools(object):
|
|||||||
"""
|
"""
|
||||||
self.ui.setWindowTitle(self._title)
|
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):
|
def _update(self):
|
||||||
"""Update window display component
|
"""Update window display component
|
||||||
|
|
||||||
@@ -173,6 +185,7 @@ class PamhyrWindow(ASubMainWindow, ListedSubWindow, PamhyrWindowTools):
|
|||||||
self._hash_data.append(self._config)
|
self._hash_data.append(self._config)
|
||||||
|
|
||||||
self._set_title()
|
self._set_title()
|
||||||
|
self._set_icon()
|
||||||
|
|
||||||
def closeEvent(self, event):
|
def closeEvent(self, event):
|
||||||
self._close_sub_window()
|
self._close_sub_window()
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 30 KiB |
Reference in new issue
Block a user