[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdelibs/kate/utils
From:       Joseph Wenninger <kde () jowenn ! at>
Date:       2008-12-01 1:02:10
Message-ID: 1228093330.999318.8007.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 891034 by jowenn:

First half of bug 173840, If the entered incremental search string does not match \
anymore, the already highlighted regions are removed (highlight  all matches mode)


 M  +24 -2     katesearchbar.cpp  
 M  +1 -0      katesearchbar.h  


--- trunk/KDE/kdelibs/kate/utils/katesearchbar.cpp #891033:891034
@@ -249,6 +249,19 @@
 }
 
 
+void KateSearchBar::neutralMatch() {
+    if (m_incUi != NULL) {
+        QPalette background(m_incUi->pattern->palette());
+        KColorScheme::adjustBackground(background, KColorScheme::NeutralBackground);
+        m_incUi->pattern->setPalette(background);
+    } else {
+        QLineEdit * const lineEdit = m_powerUi->pattern->lineEdit();
+        Q_ASSERT(lineEdit != NULL);
+        QPalette background(lineEdit->palette());
+        KColorScheme::adjustBackground(background, KColorScheme::NeutralBackground);
+        lineEdit->setPalette(background);
+    }
+}
 
 void KateSearchBar::indicateMatch(bool wrapped) {
     if (m_incUi != NULL) {
@@ -520,9 +533,16 @@
         }
 
         // Highlight all
-        if (found && isChecked(m_incMenuHighlightAll)) {
-            highlightAllMatches(pattern, enabledOptions);
+        if (isChecked(m_incMenuHighlightAll)) {
+            if (found ) {
+                highlightAllMatches(pattern, enabledOptions);
+            } else {
+                resetHighlights();
+            }
         }
+        if (!found) {
+          view()->setSelection(Range::invalid());
+        }
     }
 }
 
@@ -1920,3 +1940,5 @@
 
 
 #include "katesearchbar.moc"
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
--- trunk/KDE/kdelibs/kate/utils/katesearchbar.h #891033:891034
@@ -123,6 +123,7 @@
     void highlightAllMatches(const QString & pattern,
             KTextEditor::Search::SearchOptions searchOptions);
     void adjustBackground(QPalette & palette, KColorScheme::BackgroundRole newRole);
+    void neutralMatch();
     void indicateMatch(bool wrapped);
     void indicateMismatch();
     void indicateNothing();


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic