diff --git a/resources/default_tweaks.py b/resources/default_tweaks.py index 2075391da4..aaeb992151 100644 --- a/resources/default_tweaks.py +++ b/resources/default_tweaks.py @@ -72,9 +72,4 @@ gui_pubdate_display_format = 'MMM yyyy' # without changing anything is sufficient to change the sort. title_series_sorting = 'library_order' -# How to render average rating in the tag browser. -# There are two rendering methods available. The first is to show a partial -# star, and the second is to show a partially filled rectangle. The first is -# better looking, but uses more screen space than the second. -# Values are 'star' or 'rectangle' -render_avg_rating_using='star' + diff --git a/resources/images/series.svg b/resources/images/series.svg index c26d1ef7a2..f2eb87b709 100644 --- a/resources/images/series.svg +++ b/resources/images/series.svg @@ -1,1096 +1,1071 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file + id="linearGradient6642"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + 2007-06-23 + + + Lapo Calamandrei + + + + + address + book + contact + + + + + + + Andreas Nilsson + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/resources/images/user_profile.svg b/resources/images/user_profile.svg index 5a51783d7c..2fc0eea150 100644 --- a/resources/images/user_profile.svg +++ b/resources/images/user_profile.svg @@ -1,4750 +1,312 @@ + + version="1.1"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + inkscape:grid-bbox="true" + inkscape:document-units="px" + fill="#9db029" + stroke="#727e0a" + inkscape:window-width="1330" + inkscape:window-height="815" + inkscape:window-x="202" + inkscape:window-y="68" + inkscape:window-maximized="0" /> + id="metadata4"> image/svg+xml + + + + Jakub Steiner + + + http://jimmac.musichall.cz + + + user + person + + + + + + + + + + + - - + inkscape:label="cipek" + inkscape:groupmode="layer" + style="display:inline"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + style="opacity:1;color:#000000;fill:url(#linearGradient1372);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:round;stroke-linejoin:round;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible" + d="M 13.365469,24.850231 L 19.043607,24.850231 L 15.731361,21.774572 L 15.021593,22.720929 L 14.311825,22.011162 L 13.365469,24.850231 z " + id="path4173" /> - + sodipodi:nodetypes="cccc" + id="path4370" + d="M 19.882923,32.490544 C 21.530768,31.712992 22.297815,29.810737 22.297815,29.810737 C 21.014177,24.39981 16.976336,20.652646 16.976336,20.652646 C 16.976336,20.652646 20.274824,29.141269 19.882923,32.490544 z " + style="opacity:0.22784807;color:#000000;fill:url(#linearGradient1366);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:round;stroke-linejoin:round;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible" /> + id="layer2" + inkscape:label="dalsi cipek" + style="display:inline"> + + + + + + + + + diff --git a/src/calibre/gui2/tag_view.py b/src/calibre/gui2/tag_view.py index c3c5e8954d..6cb3c70b92 100644 --- a/src/calibre/gui2/tag_view.py +++ b/src/calibre/gui2/tag_view.py @@ -13,11 +13,10 @@ from functools import partial from PyQt4.Qt import Qt, QTreeView, QApplication, pyqtSignal, QCheckBox, \ QFont, QSize, QIcon, QPoint, QVBoxLayout, QComboBox, \ QAbstractItemModel, QVariant, QModelIndex, QMenu, \ - QPushButton, QWidget, QItemDelegate, QString, QPen, \ - QColor, QLinearGradient, QBrush + QPushButton, QWidget, QItemDelegate from calibre.gui2 import config, NONE -from calibre.utils.config import prefs, tweaks +from calibre.utils.config import prefs from calibre.library.field_metadata import TagsIcons from calibre.utils.search_query_parser import saved_searches from calibre.gui2 import error_dialog @@ -38,55 +37,25 @@ class TagDelegate(QItemDelegate): QItemDelegate.paint(self, painter, option, index) return r = option.rect - # Paint the decoration icon - icon = self._parent.model().data(index, Qt.DecorationRole).toPyObject() - icon.paint(painter, r, Qt.AlignLeft) - - # Paint the rating, if any. The decoration icon is assumed to be square, - # filling the row top to bottom. The three is arbitrary, there to - # provide a little space between the icon and what follows - r.setLeft(r.left()+r.height()+3) - rating = item.tag.avg_rating - if config['show_avg_rating'] and item.tag.avg_rating is not None: - painter.save() - if tweaks['render_avg_rating_using'] == 'star': - painter.setClipRect(r.left(), r.top(), - int(r.height()*(rating/5.0)), r.height()) - self.icon.paint(painter, r, Qt.AlignLeft | Qt.AlignVCenter) - r.setLeft(r.left() + r.height()) - else: - painter.translate(r.left(), r.top()) - # Compute factor so sizes can be expressed in percentages of the - # box defined by the row height - factor = r.height()/100. - width = 20 - height = 80 - left_offset = 5 - top_offset = 10 - if r > 0.0: - color = QColor(100, 100, 255) #medium blue, less glare - pen = QPen(color, 5, Qt.SolidLine, Qt.RoundCap, Qt.RoundJoin) - painter.setPen(pen) - painter.scale(factor, factor) - painter.drawRect(left_offset, top_offset, width, height) - fill_height = height*(rating/5.0) - gradient = QLinearGradient(0, 0, 0, 100) - gradient.setColorAt(0.0, color) - gradient.setColorAt(1.0, color) - painter.setBrush(QBrush(gradient)) - painter.drawRect(left_offset, top_offset+(height-fill_height), - width, fill_height) - # The '3' is arbitrary, there because we need a little space - # between the rectangle and the text. - r.setLeft(r.left() + ((width+left_offset*2)*factor) + 3) - painter.restore() - # Paint the text - if item.tag.count == 0: - painter.drawText(r, Qt.AlignLeft|Qt.AlignVCenter, - QString('%s'%(item.tag.name))) + model = self._parent.model() + icon = model.data(index, Qt.DecorationRole).toPyObject() + painter.save() + if item.tag.state != 0 or not config['show_avg_rating'] or \ + item.tag.avg_rating is None: + icon.paint(painter, r, Qt.AlignLeft) else: - painter.drawText(r, Qt.AlignLeft|Qt.AlignVCenter, - QString('[%d] %s'%(item.tag.count, item.tag.name))) + icon.paint(painter, r, Qt.AlignLeft, mode=QIcon.Disabled) + rating = item.tag.avg_rating + painter.setClipRect(r.left(), r.bottom()-int(r.height()*(rating/5.0)), + r.width(), r.height()) + icon.paint(painter, r, Qt.AlignLeft) + painter.setClipRect(r) + + # Paint the text + r.setLeft(r.left()+r.height()+3) + painter.drawText(r, Qt.AlignLeft|Qt.AlignVCenter, + model.data(index, Qt.DisplayRole).toString()) + painter.restore() class TagsView(QTreeView): # {{{ @@ -377,11 +346,7 @@ class TagTreeItem(object): # {{{ if self.tag.count == 0: return QVariant('%s'%(self.tag.name)) else: - if self.tag.avg_rating is None: - return QVariant('[%d] %s'%(self.tag.count, self.tag.name)) - else: - return QVariant('[%d][%3.1f] %s'%(self.tag.count, - self.tag.avg_rating, self.tag.name)) + return QVariant('[%d] %s'%(self.tag.count, self.tag.name)) if role == Qt.EditRole: return QVariant(self.tag.name) if role == Qt.DecorationRole: