Skip to content

Commit

Permalink
Add icon to GUI
Browse files Browse the repository at this point in the history
- Add ROMSearch icon to GUI
- Also add version to about page
- Update docs for attribution
- Update GH action to include icon
  • Loading branch information
bbtufty committed Jan 10, 2025
1 parent 6984569 commit 087d0cf
Show file tree
Hide file tree
Showing 10 changed files with 122 additions and 19 deletions.
1 change: 1 addition & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ jobs:
pyinstaller romsearch_gui.py
--copy-metadata romsearch
--collect-data romsearch
--icon=romsearch/gui/img/logo.ico
--onefile
-n romsearch.exe
- uses: softprops/action-gh-release@v2
Expand Down
1 change: 1 addition & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ ROMParser
General
~~~~~~~

- Add logo and version in GUI
- Clean up potential errors if directory name ends with period
- regex cleanup
- Move clonelist from unexpectedpanda to Daeymon
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,6 @@ works for the following consoles:
* PlayStation 2

but be aware there may be quirks that will only become apparent over time. We encourage users to open
[issues](https://github.com/bbtufty/romsearch/issues) as and where they find them.
[issues](https://github.com/bbtufty/romsearch/issues) as and where they find them.

The ROMSearch icon has been created by [Freepik - Flaticon](https://www.flaticon.com/free-icons/rom).
2 changes: 2 additions & 0 deletions docs/intro.rst
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,5 @@ but be aware there may be quirks that will only become apparent over time. We en
ROMSearch is also built in such a way that other platforms/filters can be added in a simple way using config files
rather than manually adding to the base code. For more details of how these work, see the various
:doc:`configs <configs>` pages.

The ROMSearch icon has been created by `Freepik - Flaticon <https://www.flaticon.com/free-icons/rom>`_.
12 changes: 12 additions & 0 deletions romsearch/gui/gui_about.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import os
from PySide6.QtGui import QPixmap
from PySide6.QtWidgets import QDialog

import romsearch
from .layout_about import Ui_About


Expand All @@ -12,3 +15,12 @@ def __init__(self, parent=None):

self.ui = Ui_About()
self.ui.setupUi(self)

# Set the GUI icon
icon_path = os.path.join(os.path.dirname(__file__), "img", "logo.png")
icon = QPixmap(icon_path)
self.ui.labelIcon.setPixmap(icon)

# Set the version
version = romsearch.__version__
self.ui.aboutVersion.setText(f"v{version}")
10 changes: 9 additions & 1 deletion romsearch/gui/gui_romsearch.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
from PySide6.QtCore import Slot, Signal, QObject, QThread
import os
from PySide6.QtCore import Slot, Signal, QObject, QThread, QSize
from PySide6.QtGui import QIcon
from PySide6.QtWidgets import (
QApplication,
QMainWindow,
Expand Down Expand Up @@ -28,6 +30,12 @@ def __init__(self):
self.ui = Ui_RomSearch()
self.ui.setupUi(self)

# Set the window icon
icon_path = os.path.join(os.path.dirname(__file__), "img", "logo.png")
icon = QIcon()
icon.addFile(icon_path, QSize(), QIcon.Mode.Normal, QIcon.State.Off)
self.setWindowIcon(icon)

log_level = self.ui.radioButtonConfigLoggerLevel.checkedButton().text().lower()
self.logger = get_gui_logger(log_level=log_level)
self.logger.warning("Do not close this window!")
Expand Down
Binary file added romsearch/gui/img/logo.ico
Binary file not shown.
Binary file added romsearch/gui/img/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 34 additions & 4 deletions romsearch/gui/layout_about.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
################################################################################
## Form generated from reading UI file 'layout_about.ui'
##
## Created by: Qt User Interface Compiler version 6.7.3
## Created by: Qt User Interface Compiler version 6.8.1
##
## WARNING! All changes made in this file will be lost when recompiling UI file!
################################################################################
Expand All @@ -15,8 +15,8 @@
QFont, QFontDatabase, QGradient, QIcon,
QImage, QKeySequence, QLinearGradient, QPainter,
QPalette, QPixmap, QRadialGradient, QTransform)
from PySide6.QtWidgets import (QApplication, QDialog, QLabel, QSizePolicy,
QVBoxLayout, QWidget)
from PySide6.QtWidgets import (QApplication, QDialog, QHBoxLayout, QLabel,
QSizePolicy, QSpacerItem, QVBoxLayout, QWidget)

class Ui_About(object):
def setupUi(self, About):
Expand All @@ -30,17 +30,45 @@ def setupUi(self, About):
About.setSizePolicy(sizePolicy)
About.setMinimumSize(QSize(332, 191))
About.setMaximumSize(QSize(332, 191))
icon = QIcon(QIcon.fromTheme(QIcon.ThemeIcon.HelpAbout))
About.setWindowIcon(icon)
About.setModal(True)
self.verticalLayout = QVBoxLayout(About)
self.verticalLayout.setObjectName(u"verticalLayout")
self.horizontalLayout = QHBoxLayout()
self.horizontalLayout.setObjectName(u"horizontalLayout")
self.labelIcon = QLabel(About)
self.labelIcon.setObjectName(u"labelIcon")
self.labelIcon.setScaledContents(True)

self.horizontalLayout.addWidget(self.labelIcon)

self.horizontalSpacer = QSpacerItem(40, 20, QSizePolicy.Policy.MinimumExpanding, QSizePolicy.Policy.Minimum)

self.horizontalLayout.addItem(self.horizontalSpacer)

self.verticalLayout_2 = QVBoxLayout()
self.verticalLayout_2.setObjectName(u"verticalLayout_2")
self.aboutLargeTitle = QLabel(About)
self.aboutLargeTitle.setObjectName(u"aboutLargeTitle")
font = QFont()
font.setPointSize(16)
self.aboutLargeTitle.setFont(font)
self.aboutLargeTitle.setAlignment(Qt.AlignmentFlag.AlignCenter)

self.verticalLayout.addWidget(self.aboutLargeTitle)
self.verticalLayout_2.addWidget(self.aboutLargeTitle)

self.aboutVersion = QLabel(About)
self.aboutVersion.setObjectName(u"aboutVersion")
self.aboutVersion.setAlignment(Qt.AlignmentFlag.AlignCenter)

self.verticalLayout_2.addWidget(self.aboutVersion)


self.horizontalLayout.addLayout(self.verticalLayout_2)


self.verticalLayout.addLayout(self.horizontalLayout)

self.aboutURL = QLabel(About)
self.aboutURL.setObjectName(u"aboutURL")
Expand All @@ -60,7 +88,9 @@ def setupUi(self, About):

def retranslateUi(self, About):
About.setWindowTitle(QCoreApplication.translate("About", u"About", None))
self.labelIcon.setText("")
self.aboutLargeTitle.setText(QCoreApplication.translate("About", u"ROMSearch", None))
self.aboutVersion.setText("")
self.aboutURL.setText(QCoreApplication.translate("About", u"<a href=\"https://github.com/bbtufty/romsearch\">https://github.com/bbtufty/romsearch</a>", None))
# retranslateUi

73 changes: 60 additions & 13 deletions romsearch/gui/layout_about.ui
Original file line number Diff line number Diff line change
Expand Up @@ -31,24 +31,71 @@
<property name="windowTitle">
<string>About</string>
</property>
<property name="windowIcon">
<iconset theme="QIcon::ThemeIcon::HelpAbout"/>
</property>
<property name="modal">
<bool>true</bool>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="aboutLargeTitle">
<property name="font">
<font>
<pointsize>16</pointsize>
</font>
</property>
<property name="text">
<string>ROMSearch</string>
</property>
<property name="alignment">
<set>Qt::AlignmentFlag::AlignCenter</set>
</property>
</widget>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="labelIcon">
<property name="text">
<string/>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Policy::MinimumExpanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QLabel" name="aboutLargeTitle">
<property name="font">
<font>
<pointsize>16</pointsize>
</font>
</property>
<property name="text">
<string>ROMSearch</string>
</property>
<property name="alignment">
<set>Qt::AlignmentFlag::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="aboutVersion">
<property name="text">
<string/>
</property>
<property name="alignment">
<set>Qt::AlignmentFlag::AlignCenter</set>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
<item>
<widget class="QLabel" name="aboutURL">
Expand Down

0 comments on commit 087d0cf

Please sign in to comment.