]> sigrok.org Git - pulseview.git/commitdiff
Improve icon/theme handling.
authorUwe Hermann <redacted>
Sun, 30 Apr 2017 20:44:33 +0000 (22:44 +0200)
committerUwe Hermann <redacted>
Fri, 5 May 2017 21:41:27 +0000 (23:41 +0200)
Only use QIcon::fromTheme() for icons which are included in the
freedesktop.org icon naming specification:

https://standards.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html

For all others there will be no icon to use from the theme and we always
want our own icons to be used unconditionally in those cases anyway.

HACKING
pv/toolbars/mainbar.cpp
pv/views/trace/standardbar.cpp

diff --git a/HACKING b/HACKING
index 17183ed147be9749b375bf4a7d7d32c3c85885a6..d539681c38026150e448da04f490c4e64fca3790 100644 (file)
--- a/HACKING
+++ b/HACKING
@@ -67,6 +67,9 @@ Random notes
    and the final @return line. The @param lines themselves (if there is more
    than one) are not separated by empty lines.
 
    and the final @return line. The @param lines themselves (if there is more
    than one) are not separated by empty lines.
 
+ - Use QIcon::fromTheme() for icons that are included in the freedesktop.org
+   icon naming specification. Do NOT use it for all other icons.
+
 
 Release engineering
 -------------------
 
 Release engineering
 -------------------
index e1a666b11ce9ea28c9e83dab427d25d485a10857..a3b722cc3dcfa041f6bc913c451d6f4e4fec8410 100644 (file)
@@ -199,8 +199,7 @@ MainBar::MainBar(Session &session, QWidget *parent,
        connect(menu_decoders_add_, SIGNAL(decoder_selected(srd_decoder*)),
                this, SLOT(add_decoder(srd_decoder*)));
 
        connect(menu_decoders_add_, SIGNAL(decoder_selected(srd_decoder*)),
                this, SLOT(add_decoder(srd_decoder*)));
 
-       add_decoder_button_->setIcon(QIcon::fromTheme("add-decoder",
-               QIcon(":/icons/add-decoder.svg")));
+       add_decoder_button_->setIcon(QIcon(":/icons/add-decoder.svg"));
        add_decoder_button_->setPopupMode(QToolButton::InstantPopup);
        add_decoder_button_->setMenu(menu_decoders_add_);
        add_decoder_button_->setToolTip(tr("Add low-level, non-stacked protocol decoder"));
        add_decoder_button_->setPopupMode(QToolButton::InstantPopup);
        add_decoder_button_->setMenu(menu_decoders_add_);
        add_decoder_button_->setToolTip(tr("Add low-level, non-stacked protocol decoder"));
@@ -220,8 +219,7 @@ MainBar::MainBar(Session &session, QWidget *parent,
                QIcon(":/icons/preferences-system.png")));
 
        channels_button_.setToolTip(tr("Configure Channels"));
                QIcon(":/icons/preferences-system.png")));
 
        channels_button_.setToolTip(tr("Configure Channels"));
-       channels_button_.setIcon(QIcon::fromTheme("channels",
-               QIcon(":/icons/channels.svg")));
+       channels_button_.setIcon(QIcon(":/icons/channels.svg"));
 
        add_toolbar_widgets();
 
 
        add_toolbar_widgets();
 
index 1a77edaa7594f7546a6d582114e44b78435f84e0..6d8f97e6f266dc9f7eaabf4cf317c969fcd22aad 100644 (file)
@@ -78,8 +78,7 @@ StandardBar::StandardBar(Session &session, QWidget *parent,
                this, SLOT(on_actionViewZoomOneToOne_triggered()));
 
        action_view_show_cursors_->setCheckable(true);
                this, SLOT(on_actionViewZoomOneToOne_triggered()));
 
        action_view_show_cursors_->setCheckable(true);
-       action_view_show_cursors_->setIcon(QIcon::fromTheme("show-cursors",
-               QIcon(":/icons/show-cursors.svg")));
+       action_view_show_cursors_->setIcon(QIcon(":/icons/show-cursors.svg"));
        action_view_show_cursors_->setShortcut(QKeySequence(Qt::Key_C));
        connect(action_view_show_cursors_, SIGNAL(triggered(bool)),
                this, SLOT(on_actionViewShowCursors_triggered()));
        action_view_show_cursors_->setShortcut(QKeySequence(Qt::Key_C));
        connect(action_view_show_cursors_, SIGNAL(triggered(bool)),
                this, SLOT(on_actionViewShowCursors_triggered()));