Skip to content

Commit

Permalink
Update icons
Browse files Browse the repository at this point in the history
  • Loading branch information
haraisao committed Feb 5, 2019
1 parent dbf4075 commit 461fee7
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 15 deletions.
19 changes: 10 additions & 9 deletions src/rqt_console/console_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import os

from python_qt_binding import loadUi
from python_qt_binding.QtGui import QCursor, QIcon
from python_qt_binding.QtGui import QCursor, QIcon, QPixmap
from python_qt_binding.QtWidgets import (QApplication, QFileDialog, QHeaderView,
QMenu, QMessageBox, QTableView, QWidget)
from python_qt_binding.QtCore import QRegExp, Qt, qWarning
Expand Down Expand Up @@ -111,24 +111,25 @@ def update_sort_indicator(logical_index, order):
self.table_view.horizontalHeader().setSortIndicatorShown(logical_index != 0)
self.table_view.horizontalHeader().sortIndicatorChanged.connect(update_sort_indicator)

self.add_exclude_button.setIcon(QIcon.fromTheme('list-add'))
self.add_highlight_button.setIcon(QIcon.fromTheme('list-add'))
self.pause_button.setIcon(QIcon.fromTheme('media-playback-pause'))
icon_dir = os.path.join(self._rospack.get_path('rqt_gui'), 'resource', 'icons')
self.add_exclude_button.setIcon(QIcon.fromTheme('list-add', QIcon(QPixmap(os.path.join(icon_dir, 'list-add.png')))))
self.add_highlight_button.setIcon(QIcon.fromTheme('list-add', QIcon(QPixmap(os.path.join(icon_dir, 'list-add.png')))))
self.pause_button.setIcon(QIcon.fromTheme('media-playback-pause', QIcon(QPixmap(os.path.join(icon_dir, 'media-playback-pause.png'))))
if not self.pause_button.icon().isNull():
self.pause_button.setText('')
self.record_button.setIcon(QIcon.fromTheme('media-record'))
self.record_button.setIcon(QIcon.fromTheme('media-record', QIcon(QPixmap(os.path.join(icon_dir, 'media-record.png'))))
if not self.record_button.icon().isNull():
self.record_button.setText('')
self.load_button.setIcon(QIcon.fromTheme('document-open'))
self.load_button.setIcon(QIcon.fromTheme('document-open', QIcon(QPixmap(os.path.join(icon_dir, 'document-open.png'))))
if not self.load_button.icon().isNull():
self.load_button.setText('')
self.save_button.setIcon(QIcon.fromTheme('document-save'))
self.save_button.setIcon(QIcon.fromTheme('document-save', QIcon(QPixmap(os.path.join(icon_dir, 'document-save.png'))))
if not self.save_button.icon().isNull():
self.save_button.setText('')
self.clear_button.setIcon(QIcon.fromTheme('edit-clear'))
self.clear_button.setIcon(QIcon.fromTheme('edit-clear', QIcon(QPixmap(os.path.join(icon_dir, 'edit-clear.png'))))
if not self.clear_button.icon().isNull():
self.clear_button.setText('')
self.highlight_exclude_button.setIcon(QIcon.fromTheme('format-text-strikethrough'))
self.highlight_exclude_button.setIcon(QIcon.fromTheme('format-text-strikethrough', QIcon(QPixmap(os.path.join(icon_dir, 'format-text-strikethrough.png'))))

self.pause_button.clicked[bool].connect(self._handle_pause_clicked)
self.record_button.clicked[bool].connect(self._handle_record_clicked)
Expand Down
4 changes: 2 additions & 2 deletions src/rqt_console/filters/filter_wrapper_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
import rospkg

from python_qt_binding import loadUi
from python_qt_binding.QtGui import QIcon
from python_qt_binding.QtGui import QIcon, QPixmap
from python_qt_binding.QtWidgets import QWidget


Expand All @@ -56,7 +56,7 @@ def __init__(self, widget, filter_name):
rp.get_path('rqt_console'), 'resource/filters', 'filter_wrapper_widget.ui')
loadUi(ui_file, self)
self.setObjectName('FilterWrapperWidget')
self.delete_button.setIcon(QIcon.fromTheme('list-remove'))
self.delete_button.setIcon(QIcon.fromTheme('list-remove',QIcon(QPixmap(os.path.join(rp.get_path('rqt_gui'), 'resource/icons/list-remove.png')))))
self._widget = widget

# Replace the placeholder QWidget with the passed in object
Expand Down
10 changes: 6 additions & 4 deletions src/rqt_console/message_data_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
import rospkg

from python_qt_binding.QtCore import QAbstractTableModel, QModelIndex, Qt, qWarning
from python_qt_binding.QtGui import QBrush, QIcon
from python_qt_binding.QtGui import QBrush, QIcon, QPixmap

from .message import Message
from .message_list import MessageList
Expand All @@ -54,9 +55,10 @@ def __init__(self):
super(MessageDataModel, self).__init__()
self._messages = MessageList()
self._message_limit = 20000
self._info_icon = QIcon.fromTheme('dialog-information')
self._warning_icon = QIcon.fromTheme('dialog-warning')
self._error_icon = QIcon.fromTheme('dialog-error')
rp=rospkg.RosPack()
self._info_icon = QIcon.fromTheme('dialog-information', QIcon(QPixmap(os.path.join(rp.get_path('rqt_gui'), 'resource/icons/dialog-information.png'))))
self._warning_icon = QIcon.fromTheme('dialog-warning', QIcon(QPixmap(os.path.join(rp.get_path('rqt_gui'), 'resource/icons/dialog-warning.png'))))
self._error_icon = QIcon.fromTheme('dialog-error', QIcon(QPixmap(os.path.join(rp.get_path('rqt_gui'), 'resource/icons/dialog-error.png'))))

# BEGIN Required implementations of QAbstractTableModel functions

Expand Down

0 comments on commit 461fee7

Please sign in to comment.