From 5010ca60e9cea555277c01e4fac7c50235313352 Mon Sep 17 00:00:00 2001 From: Timmy Welch Date: Tue, 21 May 2024 20:32:01 -0700 Subject: [PATCH] Remove reduce_widget_font_size --- comictaggerlib/autotagmatchwindow.py | 4 ---- comictaggerlib/autotagprogresswindow.py | 3 --- comictaggerlib/coverimagewidget.py | 4 +--- comictaggerlib/fileselectionlist.py | 4 +--- comictaggerlib/issueselectionwindow.py | 5 +---- comictaggerlib/matchselectionwindow.py | 4 ---- comictaggerlib/progresswindow.py | 3 --- comictaggerlib/seriesselectionwindow.py | 6 +----- comictaggerlib/taggerwindow.py | 10 +--------- comictaggerlib/ui/qtutils.py | 6 ------ 10 files changed, 5 insertions(+), 44 deletions(-) diff --git a/comictaggerlib/autotagmatchwindow.py b/comictaggerlib/autotagmatchwindow.py index 062ffb6..4cc9a16 100644 --- a/comictaggerlib/autotagmatchwindow.py +++ b/comictaggerlib/autotagmatchwindow.py @@ -28,7 +28,6 @@ from comictaggerlib.coverimagewidget import CoverImageWidget from comictaggerlib.ctsettings import ct_ns from comictaggerlib.resulttypes import IssueResult, Result from comictaggerlib.ui import ui_path -from comictaggerlib.ui.qtutils import reduce_widget_font_size from comictalker.comictalker import ComicTalker, TalkerError logger = logging.getLogger(__name__) @@ -65,9 +64,6 @@ class AutoTagMatchWindow(QtWidgets.QDialog): gridlayout.addWidget(self.archiveCoverWidget) gridlayout.setContentsMargins(0, 0, 0, 0) - reduce_widget_font_size(self.twList) - reduce_widget_font_size(self.teDescription, 1) - self.setWindowFlags( QtCore.Qt.WindowType( self.windowFlags() diff --git a/comictaggerlib/autotagprogresswindow.py b/comictaggerlib/autotagprogresswindow.py index ae7d773..bd6b850 100644 --- a/comictaggerlib/autotagprogresswindow.py +++ b/comictaggerlib/autotagprogresswindow.py @@ -22,7 +22,6 @@ from PyQt5 import QtCore, QtWidgets, uic from comictaggerlib.coverimagewidget import CoverImageWidget from comictaggerlib.ui import ui_path -from comictaggerlib.ui.qtutils import reduce_widget_font_size from comictalker.comictalker import ComicTalker logger = logging.getLogger(__name__) @@ -59,8 +58,6 @@ class AutoTagProgressWindow(QtWidgets.QDialog): ) ) - reduce_widget_font_size(self.textEdit) - def set_archive_image(self, img_data: bytes) -> None: self.set_cover_image(img_data, self.archiveCoverWidget) diff --git a/comictaggerlib/coverimagewidget.py b/comictaggerlib/coverimagewidget.py index 22a43a3..5746b82 100644 --- a/comictaggerlib/coverimagewidget.py +++ b/comictaggerlib/coverimagewidget.py @@ -31,7 +31,7 @@ from comictaggerlib.imagefetcher import ImageFetcher from comictaggerlib.imagepopup import ImagePopup from comictaggerlib.pageloader import PageLoader from comictaggerlib.ui import ui_path -from comictaggerlib.ui.qtutils import get_qimage_from_data, reduce_widget_font_size +from comictaggerlib.ui.qtutils import get_qimage_from_data from comictalker.comictalker import ComicTalker logger = logging.getLogger(__name__) @@ -82,8 +82,6 @@ class CoverImageWidget(QtWidgets.QWidget): with (ui_path / "coverimagewidget.ui").open(encoding="utf-8") as uifile: uic.loadUi(uifile, self) - reduce_widget_font_size(self.label) - self.cache_folder = cache_folder self.mode: int = mode self.page_loader: PageLoader | None = None diff --git a/comictaggerlib/fileselectionlist.py b/comictaggerlib/fileselectionlist.py index dacf9ea..f6b0e3c 100644 --- a/comictaggerlib/fileselectionlist.py +++ b/comictaggerlib/fileselectionlist.py @@ -30,7 +30,7 @@ from comictaggerlib.graphics import graphics_path from comictaggerlib.optionalmsgdialog import OptionalMessageDialog from comictaggerlib.settingswindow import linuxRarHelp, macRarHelp, windowsRarHelp from comictaggerlib.ui import ui_path -from comictaggerlib.ui.qtutils import center_window_on_parent, reduce_widget_font_size +from comictaggerlib.ui.qtutils import center_window_on_parent logger = logging.getLogger(__name__) @@ -56,8 +56,6 @@ class FileSelectionList(QtWidgets.QWidget): self.config = config - reduce_widget_font_size(self.twList) - self.twList.horizontalHeader().setMinimumSectionSize(50) self.twList.currentItemChanged.connect(self.current_item_changed_cb) diff --git a/comictaggerlib/issueselectionwindow.py b/comictaggerlib/issueselectionwindow.py index c84a01b..828b8d5 100644 --- a/comictaggerlib/issueselectionwindow.py +++ b/comictaggerlib/issueselectionwindow.py @@ -25,7 +25,7 @@ from comicapi.issuestring import IssueString from comictaggerlib.coverimagewidget import CoverImageWidget from comictaggerlib.ctsettings import ct_ns from comictaggerlib.ui import qtutils, ui_path -from comictaggerlib.ui.qtutils import new_web_view, reduce_widget_font_size +from comictaggerlib.ui.qtutils import new_web_view from comictalker.comictalker import ComicTalker, TalkerError logger = logging.getLogger(__name__) @@ -71,9 +71,6 @@ class IssueSelectionWindow(QtWidgets.QDialog): else: logger.info("failed to open QWebEngineView") - reduce_widget_font_size(self.twList) - reduce_widget_font_size(self.teDescription, 1) - self.setWindowFlags( QtCore.Qt.WindowType( self.windowFlags() diff --git a/comictaggerlib/matchselectionwindow.py b/comictaggerlib/matchselectionwindow.py index 305dd2c..fe334cc 100644 --- a/comictaggerlib/matchselectionwindow.py +++ b/comictaggerlib/matchselectionwindow.py @@ -26,7 +26,6 @@ from comictaggerlib.coverimagewidget import CoverImageWidget from comictaggerlib.ctsettings import ct_ns from comictaggerlib.resulttypes import IssueResult from comictaggerlib.ui import ui_path -from comictaggerlib.ui.qtutils import reduce_widget_font_size from comictalker.comictalker import ComicTalker logger = logging.getLogger(__name__) @@ -58,9 +57,6 @@ class MatchSelectionWindow(QtWidgets.QDialog): gridlayout.addWidget(self.archiveCoverWidget) gridlayout.setContentsMargins(0, 0, 0, 0) - reduce_widget_font_size(self.twList) - reduce_widget_font_size(self.teDescription, 1) - self.setWindowFlags( QtCore.Qt.WindowType( self.windowFlags() diff --git a/comictaggerlib/progresswindow.py b/comictaggerlib/progresswindow.py index 93e8531..da891a7 100644 --- a/comictaggerlib/progresswindow.py +++ b/comictaggerlib/progresswindow.py @@ -21,7 +21,6 @@ import logging from PyQt5 import QtCore, QtWidgets, uic from comictaggerlib.ui import ui_path -from comictaggerlib.ui.qtutils import reduce_widget_font_size logger = logging.getLogger(__name__) @@ -40,5 +39,3 @@ class IDProgressWindow(QtWidgets.QDialog): | QtCore.Qt.WindowType.WindowMaximizeButtonHint ) ) - - reduce_widget_font_size(self.textEdit) diff --git a/comictaggerlib/seriesselectionwindow.py b/comictaggerlib/seriesselectionwindow.py index 2bab075..9c5c194 100644 --- a/comictaggerlib/seriesselectionwindow.py +++ b/comictaggerlib/seriesselectionwindow.py @@ -35,7 +35,6 @@ from comictaggerlib.matchselectionwindow import MatchSelectionWindow from comictaggerlib.progresswindow import IDProgressWindow from comictaggerlib.resulttypes import IssueResult from comictaggerlib.ui import qtutils, ui_path -from comictaggerlib.ui.qtutils import new_web_view, reduce_widget_font_size from comictalker.comictalker import ComicTalker, TalkerError logger = logging.getLogger(__name__) @@ -127,13 +126,10 @@ class SeriesSelectionWindow(QtWidgets.QDialog): gridlayout.setContentsMargins(0, 0, 0, 0) self.teDetails: QtWidgets.QWidget - webengine = new_web_view(self) + webengine = qtutils.new_web_view(self) if webengine: self.teDetails = qtutils.replaceWidget(self.splitter, self.teDetails, webengine) - reduce_widget_font_size(self.teDetails, 1) - reduce_widget_font_size(self.twList) - self.setWindowFlags( QtCore.Qt.WindowType( self.windowFlags() diff --git a/comictaggerlib/taggerwindow.py b/comictaggerlib/taggerwindow.py index 8c8f0a3..b6c406a 100644 --- a/comictaggerlib/taggerwindow.py +++ b/comictaggerlib/taggerwindow.py @@ -61,7 +61,7 @@ from comictaggerlib.resulttypes import Action, MatchStatus, OnlineMatchResults, from comictaggerlib.seriesselectionwindow import SeriesSelectionWindow from comictaggerlib.settingswindow import SettingsWindow from comictaggerlib.ui import ui_path -from comictaggerlib.ui.qtutils import center_window_on_parent, enable_widget, reduce_widget_font_size +from comictaggerlib.ui.qtutils import center_window_on_parent, enable_widget from comictaggerlib.versionchecker import VersionChecker from comictalker.comictalker import ComicTalker, TalkerError @@ -269,14 +269,6 @@ class TaggerWindow(QtWidgets.QMainWindow): self.leAltIssueNum.setValidator(validator) self.leAltIssueCount.setValidator(validator) - # TODO set up an RE validator for issueNum that allows for all sorts of wacky things - - # tweak some control fonts - reduce_widget_font_size(self.lblFilename, 1) - reduce_widget_font_size(self.lblArchiveType) - reduce_widget_font_size(self.lblTagList) - reduce_widget_font_size(self.lblPageCount) - # make sure some editable comboboxes don't take drop actions self.cbFormat.lineEdit().setAcceptDrops(False) self.cbMaturityRating.lineEdit().setAcceptDrops(False) diff --git a/comictaggerlib/ui/qtutils.py b/comictaggerlib/ui/qtutils.py index 23d4e54..e79534b 100644 --- a/comictaggerlib/ui/qtutils.py +++ b/comictaggerlib/ui/qtutils.py @@ -92,12 +92,6 @@ if qt_available: def new_web_view(parent: QWidget) -> QWebEngineView: ... - def reduce_widget_font_size(widget: QtWidgets.QWidget, delta: int = 2) -> None: - f = widget.font() - if f.pointSize() > 10: - f.setPointSize(f.pointSize() - delta) - widget.setFont(f) - def center_window_on_screen(window: QtWidgets.QWidget) -> None: """Center the window on screen.