Skip to content

Commit

Permalink
Use static icons for the search toolbar, and use an icon that looks more
Browse files Browse the repository at this point in the history
like a menu for the search options menu button.
  • Loading branch information
zrax committed Mar 7, 2024
1 parent 53a1623 commit 2610fd1
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
3 changes: 2 additions & 1 deletion src/appsettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ class QTextPadSettings
};

/* Helper for loading theme icons */
#define ICON(name) QIcon::fromTheme(QStringLiteral(name))
#define ICON(name) QIcon::fromTheme(QStringLiteral(name))
#define ICON_S16(name) QIcon(QStringLiteral(":/icons/qtextpad/16x16/actions/" name ".png"))

#endif // QTEXTPAD_APPSETTINGS_H
Binary file removed src/icons/qtextpad/22x22/actions/go-down.png
Binary file not shown.
Binary file removed src/icons/qtextpad/22x22/actions/go-up.png
Binary file not shown.
3 changes: 1 addition & 2 deletions src/qtextpad.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

<!-- Oxygen icons for Win/Mac and Unixes that don't have a usable theme -->
<file>icons/qtextpad/index.theme</file>
<file>icons/qtextpad/16x16/actions/application-menu.png</file>
<file>icons/qtextpad/16x16/actions/document-new.png</file>
<file>icons/qtextpad/16x16/actions/document-open.png</file>
<file>icons/qtextpad/16x16/actions/document-preview.png</file>
Expand Down Expand Up @@ -54,9 +55,7 @@
<file>icons/qtextpad/22x22/actions/edit-paste.png</file>
<file>icons/qtextpad/22x22/actions/edit-redo.png</file>
<file>icons/qtextpad/22x22/actions/edit-undo.png</file>
<file>icons/qtextpad/22x22/actions/go-down.png</file>
<file>icons/qtextpad/22x22/actions/go-jump.png</file>
<file>icons/qtextpad/22x22/actions/go-up.png</file>
<file>icons/qtextpad/22x22/actions/help-about.png</file>
<file>icons/qtextpad/22x22/actions/view-fullscreen.png</file>
<file>icons/qtextpad/22x22/actions/view-refresh.png</file>
Expand Down
7 changes: 4 additions & 3 deletions src/searchdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,9 @@ SearchWidget::SearchWidget(QTextPadWindow *parent)
auto tbMenu = new QToolButton(this);
tbMenu->setAutoRaise(true);
tbMenu->setIconSize(QSize(16, 16));
tbMenu->setIcon(ICON("edit-find"));
tbMenu->setIcon(ICON_S16("application-menu"));
tbMenu->setToolTip(tr("Search Settings"));
tbMenu->setStyleSheet(QStringLiteral("QToolButton::menu-indicator { image: none; }"));

auto settingsMenu = new QMenu(this);
m_caseSensitive = settingsMenu->addAction(tr("Match ca&se"));
Expand Down Expand Up @@ -82,13 +83,13 @@ SearchWidget::SearchWidget(QTextPadWindow *parent)
auto tbNext = new QToolButton(this);
tbNext->setAutoRaise(true);
tbNext->setIconSize(QSize(16, 16));
tbNext->setIcon(ICON("go-down"));
tbNext->setIcon(ICON_S16("go-down"));
tbNext->setToolTip(tr("Find Next"));

auto tbPrev = new QToolButton(this);
tbPrev->setAutoRaise(true);
tbPrev->setIconSize(QSize(16, 16));
tbPrev->setIcon(ICON("go-up"));
tbPrev->setIcon(ICON_S16("go-up"));
tbPrev->setToolTip(tr("Find Previous"));

auto layout = new QHBoxLayout(this);
Expand Down

0 comments on commit 2610fd1

Please sign in to comment.