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

List:       kde-commits
Subject:    [lokalize/Applications/16.04] src: mark unbreakable space with more contrast
From:       Nick Shaforostoff <shafff () ukr ! net>
Date:       2016-04-25 20:41:34
Message-ID: E1aunK2-000297-Ok () scm ! kde ! org
[Download RAW message or body]

Git commit d48e53790185da58196640f937ae3a1a50c2e048 by Nick Shaforostoff.
Committed on 25/04/2016 at 20:40.
Pushed by shaforo into branch 'Applications/16.04'.

mark unbreakable space with more contrast

BUG: 327320
BUG: 361670

M  +7    -3    src/syntaxhighlighter.cpp

http://commits.kde.org/lokalize/d48e53790185da58196640f937ae3a1a50c2e048

diff --git a/src/syntaxhighlighter.cpp b/src/syntaxhighlighter.cpp
index 87a765d..3ace470 100644
--- a/src/syntaxhighlighter.cpp
+++ b/src/syntaxhighlighter.cpp
@@ -108,7 +108,7 @@ SyntaxHighlighter::SyntaxHighlighter(QTextEdit *parent)
 
 void SyntaxHighlighter::settingsChanged()
 {
-    QRegExp re(QStringLiteral(" +$|^ +|.?")%QChar(0x0000AD)%(".?")); //soft hyphen
+    QRegExp re(" +$|^ +|.?"%QChar(0x0000AD)%".?"); //soft hyphen
     if (Settings::highlightSpaces() && highlightingRules.last().pattern!=re)
     {
         HighlightingRule rule;
@@ -117,14 +117,18 @@ void SyntaxHighlighter::settingsChanged()
 #ifndef NOKDE
         KColorScheme colorScheme(QPalette::Normal);
         //nbsp
-        rule.format.setBackground(colorScheme.background(KColorScheme::AlternateBackground));
+        //rule.format.setBackground(colorScheme.background(KColorScheme::NegativeBackground));
+        rule.format.setBackground(colorScheme.foreground(KColorScheme::InactiveText));
 #else
         rule.format.setBackground(QApplication::palette().alternateBase());
 #endif
-        rule.pattern = QRegExp(QChar(0x00a0U));
+        rule.format.setFontLetterSpacing(200);
+
+        rule.pattern = QRegExp(QChar(0x00a0U), Qt::CaseSensitive, QRegExp::FixedString);
         highlightingRules.append(rule);
 
         //usual spaces at the end
+        rule.format.setFontLetterSpacing(100);
 #ifndef NOKDE
         rule.format.setBackground(colorScheme.background(KColorScheme::ActiveBackground));
 #else
[prev in list] [next in list] [prev in thread] [next in thread] 

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