forked from qt-creator/qt-creator
Show more info about a search and move UI for replacing
Change-Id: I6e024583c0d778a65007eb4590118c4329b2118a Reviewed-on: http://codereview.qt-project.org/4554 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com> Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
This commit is contained in:
@@ -33,6 +33,7 @@
|
||||
#include "findtoolbar.h"
|
||||
#include "findplugin.h"
|
||||
#include "textfindconstants.h"
|
||||
#include "ifindfilter.h"
|
||||
|
||||
#include <coreplugin/coreconstants.h>
|
||||
#include <coreplugin/icontext.h>
|
||||
@@ -79,9 +80,6 @@ FindToolBar::FindToolBar(FindPlugin *plugin, CurrentDocumentFind *currentDocumen
|
||||
m_replaceAction(0),
|
||||
m_replaceNextAction(0),
|
||||
m_replacePreviousAction(0),
|
||||
m_casesensitiveIcon(":/find/images/casesensitively.png"),
|
||||
m_regexpIcon(":/find/images/regexp.png"),
|
||||
m_wholewordsIcon(":/find/images/wholewords.png"),
|
||||
m_findIncrementalTimer(this), m_findStepTimer(this),
|
||||
m_useFakeVim(false),
|
||||
m_eventFiltersInstalled(false)
|
||||
@@ -539,33 +537,17 @@ void FindToolBar::updateIcons()
|
||||
bool casesensitive = effectiveFlags & Find::FindCaseSensitively;
|
||||
bool wholewords = effectiveFlags & Find::FindWholeWords;
|
||||
bool regexp = effectiveFlags & Find::FindRegularExpression;
|
||||
int width = 0;
|
||||
if (casesensitive) width += 6;
|
||||
if (wholewords) width += 6;
|
||||
if (regexp) width += 6;
|
||||
if (width == 0) width = 18;
|
||||
--width;
|
||||
QPixmap pixmap(width, 17);
|
||||
pixmap.fill(Qt::transparent);
|
||||
QPainter painter(&pixmap);
|
||||
int x = 0;
|
||||
|
||||
if (casesensitive) {
|
||||
painter.drawPixmap(x - 6, 0, m_casesensitiveIcon);
|
||||
x += 6;
|
||||
}
|
||||
if (wholewords) {
|
||||
painter.drawPixmap(x - 6, 0, m_wholewordsIcon);
|
||||
x += 6;
|
||||
}
|
||||
if (regexp) {
|
||||
painter.drawPixmap(x - 6, 0, m_regexpIcon);
|
||||
}
|
||||
if (!casesensitive && !wholewords && !regexp) {
|
||||
QPixmap pixmap(17, 17);
|
||||
pixmap.fill(Qt::transparent);
|
||||
QPainter painter(&pixmap);
|
||||
QPixmap mag(Core::Constants::ICON_MAGNIFIER);
|
||||
painter.drawPixmap(0, (pixmap.height() - mag.height()) / 2, mag);
|
||||
m_ui.findEdit->setButtonPixmap(Utils::FancyLineEdit::Left, pixmap);
|
||||
} else {
|
||||
m_ui.findEdit->setButtonPixmap(Utils::FancyLineEdit::Left,
|
||||
IFindFilter::pixmapForFindFlags(effectiveFlags));
|
||||
}
|
||||
m_ui.findEdit->setButtonPixmap(Utils::FancyLineEdit::Left, pixmap);
|
||||
}
|
||||
|
||||
Find::FindFlags FindToolBar::effectiveFindFlags()
|
||||
|
||||
Reference in New Issue
Block a user