From dde1913e07d40f1a7f931c9ee4b1c7801e47d7a3 Mon Sep 17 00:00:00 2001 From: beville Date: Tue, 5 Feb 2013 04:49:44 +0000 Subject: [PATCH] Font tweaks git-svn-id: http://comictagger.googlecode.com/svn/trunk@421 6c5673fe-1810-88d6-992b-cd32ca31540c --- autotagmatchwindow.py | 3 +++ autotagmatchwindow.ui | 5 ----- autotagprogresswindow.py | 9 ++------- coverimagewidget.py | 13 ++++--------- fileselectionlist.py | 8 ++------ issueselectionwindow.py | 3 +++ issueselectionwindow.ui | 5 ----- matchselectionwindow.py | 3 +++ matchselectionwindow.ui | 5 ----- progresswindow.py | 9 ++------- taggerwindow.py | 25 +------------------------ taggerwindow.ui | 10 +++++----- todo.txt | 4 +++- utils.py | 14 ++++++++++++++ volumeselectionwindow.py | 4 ++++ volumeselectionwindow.ui | 10 ---------- 16 files changed, 46 insertions(+), 84 deletions(-) diff --git a/autotagmatchwindow.py b/autotagmatchwindow.py index 5cba397..2a0cab8 100644 --- a/autotagmatchwindow.py +++ b/autotagmatchwindow.py @@ -29,6 +29,7 @@ from settings import ComicTaggerSettings from options import MetaDataStyle from coverimagewidget import CoverImageWidget from comicvinetalker import ComicVineTalker +import utils class AutoTagMatchWindow(QtGui.QDialog): @@ -49,6 +50,8 @@ class AutoTagMatchWindow(QtGui.QDialog): gridlayout.addWidget( self.archiveCoverWidget ) gridlayout.setContentsMargins(0,0,0,0) + utils.reduceWidgetFontSize( self.twList ) + self.setWindowFlags(self.windowFlags() | QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowMaximizeButtonHint) diff --git a/autotagmatchwindow.ui b/autotagmatchwindow.ui index 6b2eecb..e19127c 100644 --- a/autotagmatchwindow.ui +++ b/autotagmatchwindow.ui @@ -39,11 +39,6 @@ - - - 9 - - QAbstractItemView::SingleSelection diff --git a/autotagprogresswindow.py b/autotagprogresswindow.py index 058bb32..eeee9e2 100644 --- a/autotagprogresswindow.py +++ b/autotagprogresswindow.py @@ -22,7 +22,7 @@ import sys from PyQt4 import QtCore, QtGui, uic import os from settings import ComicTaggerSettings - +import utils class AutoTagProgressWindow(QtGui.QDialog): @@ -39,12 +39,7 @@ class AutoTagProgressWindow(QtGui.QDialog): QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowMaximizeButtonHint) - # we can't specify relative font sizes in the UI designer, so - # make font for scroll window a smidge smaller - f = self.textEdit.font() - if f.pointSize() > 10: - f.setPointSize( f.pointSize() - 2 ) - self.textEdit.setFont( f ) + utils.reduceWidgetFontSize( self.textEdit ) def setArchiveImage( self, img_data): self.setCoverImage( img_data, self.lblArchive ) diff --git a/coverimagewidget.py b/coverimagewidget.py index c2f4d42..be3da17 100644 --- a/coverimagewidget.py +++ b/coverimagewidget.py @@ -31,6 +31,7 @@ from comicvinetalker import ComicVineTalker, ComicVineTalkerException from imagefetcher import ImageFetcher from pageloader import PageLoader from imagepopup import ImagePopup +import utils # helper func to allow a label to be clickable def clickable(widget): @@ -64,10 +65,7 @@ class CoverImageWidget(QWidget): uic.loadUi(os.path.join(ComicTaggerSettings.baseDir(), 'coverimagewidget.ui' ), self ) - f = self.label.font() - if f.pointSize() > 10: - f.setPointSize( f.pointSize() - 2 ) - self.label.setFont( f ) + utils.reduceWidgetFontSize( self.label ) self.mode = mode self.comicVine = ComicVineTalker() @@ -202,12 +200,9 @@ class CoverImageWidget(QWidget): if self.imageIndex == -1 or self.imageCount == 1: self.label.setText("") elif self.mode == CoverImageWidget.AltCoverMode: - if self.imageIndex == 0: - self.label.setText("Primary Cover") - else: - self.label.setText("Alt. Cover {0}".format(self.imageIndex)) + self.label.setText("Cover {0} ( of {1} )".format(self.imageIndex+1, self.imageCount)) else: - self.label.setText("Page {0}".format(self.imageIndex+1)) + self.label.setText("Page {0} ( of {1} )".format(self.imageIndex+1, self.imageCount)) def loadURL( self ): self.loadDefault() diff --git a/fileselectionlist.py b/fileselectionlist.py index b832e2f..1304d38 100644 --- a/fileselectionlist.py +++ b/fileselectionlist.py @@ -31,6 +31,7 @@ from settings import ComicTaggerSettings from comicarchive import ComicArchive from genericmetadata import GenericMetadata, PageType from options import MetaDataStyle +import utils class FileTableWidget( QTableWidget ): @@ -74,12 +75,7 @@ class FileSelectionList(QWidget): self.settings = settings - # we can't specify relative font sizes in the UI designer, so - # make font a smidge smaller - f = self.twList.font() - if f.pointSize() > 10: - f.setPointSize( f.pointSize() - 2 ) - self.twList.setFont( f ) + utils.reduceWidgetFontSize( self.twList ) self.twList.currentItemChanged.connect( self.currentItemChangedCB ) diff --git a/issueselectionwindow.py b/issueselectionwindow.py index 04d7008..92641b4 100644 --- a/issueselectionwindow.py +++ b/issueselectionwindow.py @@ -30,6 +30,7 @@ from imagefetcher import ImageFetcher from settings import ComicTaggerSettings from issuestring import IssueString from coverimagewidget import CoverImageWidget +import utils class IssueSelectionWindow(QtGui.QDialog): @@ -45,6 +46,8 @@ class IssueSelectionWindow(QtGui.QDialog): gridlayout.addWidget( self.coverWidget ) gridlayout.setContentsMargins(0,0,0,0) + utils.reduceWidgetFontSize( self.twList ) + self.setWindowFlags(self.windowFlags() | QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowMaximizeButtonHint) diff --git a/issueselectionwindow.ui b/issueselectionwindow.ui index a718b7c..45a88b2 100644 --- a/issueselectionwindow.ui +++ b/issueselectionwindow.ui @@ -20,11 +20,6 @@ - - - 9 - - QAbstractItemView::SingleSelection diff --git a/matchselectionwindow.py b/matchselectionwindow.py index 3741245..109b73e 100644 --- a/matchselectionwindow.py +++ b/matchselectionwindow.py @@ -29,6 +29,7 @@ from settings import ComicTaggerSettings from options import MetaDataStyle from coverimagewidget import CoverImageWidget from comicvinetalker import ComicVineTalker +import utils class MatchSelectionWindow(QtGui.QDialog): @@ -49,6 +50,8 @@ class MatchSelectionWindow(QtGui.QDialog): gridlayout.addWidget( self.archiveCoverWidget ) gridlayout.setContentsMargins(0,0,0,0) + utils.reduceWidgetFontSize( self.twList ) + self.setWindowFlags(self.windowFlags() | QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowMaximizeButtonHint) diff --git a/matchselectionwindow.ui b/matchselectionwindow.ui index 6b2eecb..e19127c 100644 --- a/matchselectionwindow.ui +++ b/matchselectionwindow.ui @@ -39,11 +39,6 @@ - - - 9 - - QAbstractItemView::SingleSelection diff --git a/progresswindow.py b/progresswindow.py index 5ddab2c..b6aa847 100644 --- a/progresswindow.py +++ b/progresswindow.py @@ -22,7 +22,7 @@ import sys from PyQt4 import QtCore, QtGui, uic import os from settings import ComicTaggerSettings - +import utils class IDProgressWindow(QtGui.QDialog): @@ -36,12 +36,7 @@ class IDProgressWindow(QtGui.QDialog): QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowMaximizeButtonHint) - # we can't specify relative font sizes in the UI designer, so - # make font for scroll window a smidge smaller - f = self.textEdit.font() - if f.pointSize() > 10: - f.setPointSize( f.pointSize() - 2 ) - self.textEdit.setFont( f ) + utils.reduceWidgetFontSize( self.textEdit ) \ No newline at end of file diff --git a/taggerwindow.py b/taggerwindow.py index 2ac23d9..f6ddff4 100644 --- a/taggerwindow.py +++ b/taggerwindow.py @@ -1,6 +1,6 @@ # coding=utf-8 """ -The main window of the comictagger app +The main window of the ComicTagger app """ """ @@ -76,28 +76,6 @@ class MultipleMatch(): # this reads the environment and inits the right locale locale.setlocale(locale.LC_ALL, "") -# helper func to allow a label to be clickable -def clickable(widget): - - class Filter(QtCore.QObject): - - dblclicked = pyqtSignal() - - def eventFilter(self, obj, event): - - if obj == widget: - if event.type() == QtCore.QEvent.MouseButtonDblClick: - self.dblclicked.emit() - return True - - return False - - filter = Filter(widget) - widget.installEventFilter(filter) - return filter.dblclicked - - - class TaggerWindow( QtGui.QMainWindow): appName = "ComicTagger" @@ -141,7 +119,6 @@ class TaggerWindow( QtGui.QMainWindow): f.setPointSize( f.pointSize() - 2 ) f.setItalic( True ) child.setFont( f ) - self.scrollAreaWidgetContents.adjustSize() diff --git a/taggerwindow.ui b/taggerwindow.ui index e108044..d363c75 100644 --- a/taggerwindow.ui +++ b/taggerwindow.ui @@ -211,14 +211,14 @@ - 220 - 330 + 230 + 380 - 220 - 330 + 230 + 380 @@ -1092,7 +1092,7 @@ 0 0 1096 - 28 + 21 diff --git a/todo.txt b/todo.txt index ffbfc6e..bb92d3e 100644 --- a/todo.txt +++ b/todo.txt @@ -12,6 +12,7 @@ Docs: Look into using libarchive +Page left and right icons ----------------------------------------------------- Bugs @@ -26,7 +27,8 @@ Big Future Features GCD scraper or DB reader -Form Mode: Single vs Batch +Batch Edit + Form Mode: Single vs Batch ----------------------------------------------------- Small(er) Future Feature diff --git a/utils.py b/utils.py index 5b58e04..e1c558a 100644 --- a/utils.py +++ b/utils.py @@ -520,3 +520,17 @@ def getLanguageFromISO( iso ): else: return lang_dict[ iso ] + +try: + from PyQt4 import QtGui + qt_available = True +except ImportError: + qt_available = False + +if qt_available: + def reduceWidgetFontSize( widget , delta = 2): + f = widget.font() + if f.pointSize() > 10: + f.setPointSize( f.pointSize() - delta ) + widget.setFont( f ) + diff --git a/volumeselectionwindow.py b/volumeselectionwindow.py index a90d7d8..4bcd1f7 100644 --- a/volumeselectionwindow.py +++ b/volumeselectionwindow.py @@ -35,6 +35,7 @@ from progresswindow import IDProgressWindow from settings import ComicTaggerSettings from matchselectionwindow import MatchSelectionWindow from coverimagewidget import CoverImageWidget +import utils class SearchThread( QtCore.QThread): @@ -95,6 +96,9 @@ class VolumeSelectionWindow(QtGui.QDialog): gridlayout = QtGui.QGridLayout( self.imageContainer ) gridlayout.addWidget( self.imageWidget ) gridlayout.setContentsMargins(0,0,0,0) + + utils.reduceWidgetFontSize( self.teDetails, 1 ) + utils.reduceWidgetFontSize( self.twList ) self.setWindowFlags(self.windowFlags() | QtCore.Qt.WindowSystemMenuHint | diff --git a/volumeselectionwindow.ui b/volumeselectionwindow.ui index 309b7f9..698e162 100644 --- a/volumeselectionwindow.ui +++ b/volumeselectionwindow.ui @@ -55,11 +55,6 @@ 250 - - - 9 - - QAbstractItemView::SingleSelection @@ -118,11 +113,6 @@ 200 - - - 9 - - true