diff --git a/src/plugins/find/find.qrc b/src/plugins/find/find.qrc index db9017c2366cf9adf85f5053b4c17548cc758c2a..8466feef2467d83efe95e303005e78ae2610b63a 100644 --- a/src/plugins/find/find.qrc +++ b/src/plugins/find/find.qrc @@ -1,13 +1,7 @@ <RCC> <qresource prefix="/find" > - <file>images/all.png</file> <file>images/casesensitively.png</file> - <file>images/empty.png</file> - <file>images/expand.png</file> - <file>images/next.png</file> - <file>images/previous.png</file> - <file>images/replace_all.png</file> <file>images/wholewords.png</file> - <file>images/wordandcase.png</file> + <file>images/regexp.png</file> </qresource> </RCC> diff --git a/src/plugins/find/findtoolbar.cpp b/src/plugins/find/findtoolbar.cpp index cedfbbaf9a5c19bd6bc2dd927d5b9b33020703de..313d229ceb869d7f4bf30df3c825c1f60a0472eb 100644 --- a/src/plugins/find/findtoolbar.cpp +++ b/src/plugins/find/findtoolbar.cpp @@ -68,7 +68,10 @@ FindToolBar::FindToolBar(FindPlugin *plugin, CurrentDocumentFind *currentDocumen m_findNextAction(0), m_findPreviousAction(0), m_replaceNextAction(0), - m_widget(new QWidget) + m_widget(new QWidget), + m_casesensitiveIcon(":/find/images/casesensitively.png"), + m_regexpIcon(":/find/images/regexp.png"), + m_wholewordsIcon(":/find/images/wholewords.png") { //setup ui m_ui.setupUi(m_widget); @@ -215,6 +218,7 @@ FindToolBar::FindToolBar(FindPlugin *plugin, CurrentDocumentFind *currentDocumen lineEditMenu->addAction(m_wholeWordAction); m_regularExpressionAction = new QAction(tr("Use Regular Expressions"), this); + m_regularExpressionAction->setIcon(QIcon(":/find/images/regexp.png")); m_regularExpressionAction->setCheckable(true); m_regularExpressionAction->setChecked(false); cmd = am->registerAction(m_regularExpressionAction, Constants::REGULAR_EXPRESSIONS, globalcontext); @@ -435,21 +439,30 @@ void FindToolBar::findFlagsChanged() void FindToolBar::updateIcons() { - bool casesensitive = m_findFlags & QTextDocument::FindCaseSensitively; - bool wholewords = m_findFlags & QTextDocument::FindWholeWords; - - if (casesensitive && wholewords) { - QPixmap image = QPixmap(":/find/images/wordandcase.png"); - m_ui.findEdit->setPixmap(image); - } else if (casesensitive) { - QPixmap image = QPixmap(":/find/images/casesensitively.png"); - m_ui.findEdit->setPixmap(image); - } else if (wholewords) { - QPixmap image = QPixmap(":/find/images/wholewords.png"); - m_ui.findEdit->setPixmap(image); - } else { - m_ui.findEdit->setPixmap(QPixmap(Core::Constants::ICON_MAGNIFIER)); + bool casesensitive = m_findFlags & IFindSupport::FindCaseSensitively; + bool wholewords = m_findFlags & IFindSupport::FindWholeWords; + bool regexp = m_findFlags & IFindSupport::FindRegularExpression; + QPixmap pixmap(17, 17); + QPainter painter(&pixmap); + painter.eraseRect(0, 0, 17, 17); + int x = 16; + + if (casesensitive) { + painter.drawPixmap(x-10, 0, m_casesensitiveIcon); + x -= 6; } + if (wholewords) { + painter.drawPixmap(x-10, 0, m_wholewordsIcon); + x -= 6; + } + if (regexp) { + painter.drawPixmap(x-10, 0, m_regexpIcon); + } + if (!casesensitive && !wholewords && !regexp) { + QPixmap mag(Core::Constants::ICON_MAGNIFIER); + painter.drawPixmap(0, (pixmap.height() - mag.height()) / 2, mag); + } + m_ui.findEdit->setPixmap(pixmap); } void FindToolBar::updateFlagMenus() diff --git a/src/plugins/find/findtoolbar.h b/src/plugins/find/findtoolbar.h index 0e5d86bc9005f797ff4a5b86286380509add5c7c..11e6d1a717eb46fde365ec6d87ebaf3d5923099a 100644 --- a/src/plugins/find/findtoolbar.h +++ b/src/plugins/find/findtoolbar.h @@ -114,6 +114,10 @@ private: QAction *m_regularExpressionAction; QWidget *m_widget; IFindSupport::FindFlags m_findFlags; + + QPixmap m_casesensitiveIcon; + QPixmap m_regexpIcon; + QPixmap m_wholewordsIcon; }; } // namespace Internal diff --git a/src/plugins/find/images/casesensitively.png b/src/plugins/find/images/casesensitively.png index 93038c0523c51da7b04ea8de4bc91e8bcef52d06..029b41faa4da49c90f294d7bcb5930fd3105242f 100644 Binary files a/src/plugins/find/images/casesensitively.png and b/src/plugins/find/images/casesensitively.png differ diff --git a/src/plugins/find/images/wholewords.png b/src/plugins/find/images/wholewords.png index 0187023ada3c42321bdde22f1981e22946ba370d..0ffcecd963ceb70b16f9b2ed558cb649eba62d4d 100644 Binary files a/src/plugins/find/images/wholewords.png and b/src/plugins/find/images/wholewords.png differ diff --git a/src/plugins/find/images/wordandcase.png b/src/plugins/find/images/wordandcase.png index 3a34cbea83b5289c0c735b57b0a8620b8b93d62f..34c0ac319088ea57b7cbebab2974bacfa6057d77 100644 Binary files a/src/plugins/find/images/wordandcase.png and b/src/plugins/find/images/wordandcase.png differ