From fd4168c9ec2ec702c099f4bc3927cdf66a8f5e52 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 15 Jun 2017 10:17:07 +0530 Subject: [PATCH] Restore labels to the TB buttons --- manual/gui.rst | 4 ++-- src/calibre/gui2/tag_browser/ui.py | 11 +++++------ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/manual/gui.rst b/manual/gui.rst index e760c220a9..a280f0611c 100644 --- a/manual/gui.rst +++ b/manual/gui.rst @@ -534,7 +534,7 @@ The first click on an item will restrict the list of books to those that contain Items in the Tag browser have their icons partially colored. The amount of color depends on the average rating of the books in that category. So for example if the books by Isaac Asimov have an average of four stars, the icon for Isaac Asimov in the Tag browser will be 4/5th colored. You can hover your mouse over the icon to see the average rating. -The outer-level items in the :guilabel:`Tag browser`, such as Authors and Series, are called categories. You can create your own categories, called :guilabel:`User categories`, which are useful for organizing items. For example, you can use the :guilabel:`User categories editor` (click the configure button at the lower-left of the :guilabel:`Tag browser` and choose :guilabel:`Manage authors, series, etc->User categories`) to create a user category called Favorite Authors, then put the items for your favorites into the category. User categories can have sub-categories. For example, the user category Favorites.Authors is a sub-category of Favorites. You might also have Favorites.Series, in which case there will be two sub-categories under Favorites. Sub-categories can be created by right-clicking on a user category, choosing :guilabel:`Add sub-category to...`, and entering the sub-category name; or by using the :guilabel:`User categories editor` by entering names like the Favorites example above. +The outer-level items in the :guilabel:`Tag browser`, such as Authors and Series, are called categories. You can create your own categories, called :guilabel:`User categories`, which are useful for organizing items. For example, you can use the :guilabel:`User categories editor` (click the :guilabel:`Configure` button at the lower-left of the :guilabel:`Tag browser` and choose :guilabel:`Manage authors, series, etc->User categories`) to create a user category called Favorite Authors, then put the items for your favorites into the category. User categories can have sub-categories. For example, the user category Favorites.Authors is a sub-category of Favorites. You might also have Favorites.Series, in which case there will be two sub-categories under Favorites. Sub-categories can be created by right-clicking on a user category, choosing :guilabel:`Add sub-category to...`, and entering the sub-category name; or by using the :guilabel:`User categories editor` by entering names like the Favorites example above. You can search user categories in the same way as built-in categories, by clicking on them. There are four different searches cycled through by clicking: 1. "everything matching an item in the category" indicated by a single green plus sign. @@ -550,7 +550,7 @@ You can drag and drop items in the Tag browser onto user categories to add them You can easily find any item in the Tag browser by clicking the search button at the lower-right corner. In addition, you can right click on any item and choose one of several operations. Some examples are to hide it, rename it, or open a "Manage x" dialog that allows you to manage items of that kind. For example, the "Manage Authors" dialog allows you to rename authors and control how their names are sorted. -You can control how items are sorted in the Tag browser via the configure button at the lower-left of the Tag browser. You can choose to sort by name, average rating or popularity (popularity is the number of books with an item in your library; for example, the popularity of Isaac Asimov is the number of books in your library by Isaac Asimov). +You can control how items are sorted in the Tag browser via the :guilabel:`Configure` button at the lower-left of the Tag browser. You can choose to sort by name, average rating or popularity (popularity is the number of books with an item in your library; for example, the popularity of Isaac Asimov is the number of books in your library by Isaac Asimov). .. raw:: html epub diff --git a/src/calibre/gui2/tag_browser/ui.py b/src/calibre/gui2/tag_browser/ui.py index 3a2c5929d1..6665931ea6 100644 --- a/src/calibre/gui2/tag_browser/ui.py +++ b/src/calibre/gui2/tag_browser/ui.py @@ -367,6 +367,7 @@ class TagBrowserBar(QWidget): # {{{ l.setContentsMargins(0, 0, 0, 0) self.alter_tb = parent.alter_tb = b = QToolButton(self) b.setAutoRaise(True) + b.setText(_('Configure')), b.setToolButtonStyle(Qt.ToolButtonTextBesideIcon) b.setCursor(Qt.PointingHandCursor) b.setPopupMode(b.InstantPopup) b.setToolTip(textwrap.fill(_( @@ -378,9 +379,6 @@ class TagBrowserBar(QWidget): # {{{ b.m = QMenu() b.setMenu(b.m) - self.label = la = QLabel(self) - la.setText(_('Tag browser')) - self.item_search = FindBox(parent) self.item_search.setMinimumContentsLength(5) self.item_search.setSizeAdjustPolicy(self.item_search.AdjustToMinimumContentsLengthWithIcon) @@ -414,6 +412,7 @@ class TagBrowserBar(QWidget): # {{{ self.toggle_search_button = b = QToolButton(self) le = self.item_search.lineEdit() le.addAction(QIcon(I('window-close.png')), le.LeadingPosition).triggered.connect(self.close_find_box) + b.setText(_('Find')), b.setToolButtonStyle(Qt.ToolButtonTextBesideIcon) b.setCursor(Qt.PointingHandCursor) b.setIcon(QIcon(I('search.png'))) b.setCheckable(True) @@ -436,7 +435,6 @@ class TagBrowserBar(QWidget): # {{{ def update_searchbar_state(self): find_shown = self.toggle_search_button.isChecked() self.toggle_search_button.setVisible(not find_shown) - self.label.setVisible(not find_shown) self.search_button.setVisible(find_shown) self.item_search.setVisible(find_shown) l = self.layout() @@ -444,13 +442,14 @@ class TagBrowserBar(QWidget): # {{{ tuple(map(l.removeItem, items)) if find_shown: l.addWidget(self.alter_tb) + self.alter_tb.setToolButtonStyle(Qt.ToolButtonIconOnly) l.addWidget(self.item_search, 10) l.addWidget(self.search_button) self.item_search.setFocus(Qt.OtherFocusReason) else: l.addWidget(self.alter_tb) + self.alter_tb.setToolButtonStyle(Qt.ToolButtonTextBesideIcon) l.addStretch(10) - l.addWidget(self.label) l.addStretch(10) l.addWidget(self.toggle_search_button) # }}} @@ -509,7 +508,7 @@ class TagBrowserWidget(QFrame): # {{{ ac = QAction(parent) parent.addAction(ac) parent.keyboard.register_shortcut('tag browser alter', - _('Change Tag browser'), default_keys=(), + _('Configure Tag browser'), default_keys=(), action=ac, group=_('Tag browser')) ac.triggered.connect(l.showMenu)