Also change text of highlight button when changing icon

This commit is contained in:
Kovid Goyal 2017-06-13 09:21:20 +05:30
parent 5c94fe50b2
commit 0dd9de8aae
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 6 additions and 2 deletions

View File

@ -249,6 +249,7 @@ class SearchBar(QFrame): # {{{
x = parent.highlight_only_button = QToolButton(self)
x.setAutoRaise(True)
x.setText(_('Highlight'))
x.setCursor(Qt.PointingHandCursor)
x.setToolButtonStyle(Qt.ToolButtonTextBesideIcon)
x.setIcon(QIcon(I('arrow-down.png')))
l.addWidget(x)

View File

@ -492,10 +492,13 @@ class SearchBoxMixin(object): # {{{
self.focus_to_library()
def set_highlight_only_button_icon(self):
b = self.highlight_only_button
if config['highlight_search_matches']:
self.highlight_only_button.setIcon(QIcon(I('highlight_only_on.png')))
b.setIcon(QIcon(I('highlight_only_on.png')))
b.setText(_('Filter'))
else:
self.highlight_only_button.setIcon(QIcon(I('highlight_only_off.png')))
b.setIcon(QIcon(I('highlight_only_off.png')))
b.setText(_('Highlight'))
self.highlight_only_button.setVisible(gprefs['show_highlight_toggle_button'])
self.library_view.model().set_highlight_only(config['highlight_search_matches'])