Commit 89a50de5 authored by con's avatar con
Browse files

Add missing visualizer of reg exp search option in find tool bar.


Reviewed-by: default avatarThorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com>
parent d8cca2b7
<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>
......@@ -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()
......
......@@ -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
......
src/plugins/find/images/casesensitively.png

182 Bytes | W: | H:

src/plugins/find/images/casesensitively.png

153 Bytes | W: | H:

src/plugins/find/images/casesensitively.png
src/plugins/find/images/casesensitively.png
src/plugins/find/images/casesensitively.png
src/plugins/find/images/casesensitively.png
  • 2-up
  • Swipe
  • Onion skin
src/plugins/find/images/wholewords.png

210 Bytes | W: | H:

src/plugins/find/images/wholewords.png

146 Bytes | W: | H:

src/plugins/find/images/wholewords.png
src/plugins/find/images/wholewords.png
src/plugins/find/images/wholewords.png
src/plugins/find/images/wholewords.png
  • 2-up
  • Swipe
  • Onion skin
src/plugins/find/images/wordandcase.png

158 Bytes | W: | H:

src/plugins/find/images/wordandcase.png

198 Bytes | W: | H:

src/plugins/find/images/wordandcase.png
src/plugins/find/images/wordandcase.png
src/plugins/find/images/wordandcase.png
src/plugins/find/images/wordandcase.png
  • 2-up
  • Swipe
  • Onion skin
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment