changeset 23472:c8722519330a

remove color highlight of error messages in gui console * Filter.h: removed obsolete Error hotspot type * QUnixTerminalImpl (initialize): removed filter for Error hotspot type * TerminalView.cpp (paintFilters): ErrorLinks are underlined in red and not highlighted wit a box, removed handling of Error hotspots
author Torsten <mttl@mailbox.org>
date Sun, 07 May 2017 14:00:50 +0200
parents 7308cdea0c2b
children 55916f99b8b6
files libgui/qterminal/libqterminal/unix/Filter.h libgui/qterminal/libqterminal/unix/QUnixTerminalImpl.cpp libgui/qterminal/libqterminal/unix/TerminalView.cpp
diffstat 3 files changed, 10 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/libgui/qterminal/libqterminal/unix/Filter.h	Thu May 04 23:25:36 2017 -0400
+++ b/libgui/qterminal/libqterminal/unix/Filter.h	Sun May 07 14:00:50 2017 +0200
@@ -79,7 +79,7 @@
       Link,
       // this hotspot represents a marker
       Marker,
-      Error,
+      // this hotspot represents a clickable link to an erroneous file
       ErrorLink
     };
 
--- a/libgui/qterminal/libqterminal/unix/QUnixTerminalImpl.cpp	Thu May 04 23:25:36 2017 -0400
+++ b/libgui/qterminal/libqterminal/unix/QUnixTerminalImpl.cpp	Sun May 07 14:00:50 2017 +0200
@@ -48,10 +48,6 @@
     UrlFilter *url_filter = new UrlFilter();
     m_terminalView->filterChain ()->addFilter (url_filter);
 
-    RegExpFilter *error_filter = new RegExpFilter (Filter::Type::Error);
-    error_filter->setRegExp (QRegExp ("error:"));
-    m_terminalView->filterChain ()->addFilter (error_filter);
-
     UrlFilter *file_filter = new UrlFilter (Filter::Type::ErrorLink);
     m_terminalView->filterChain ()->addFilter (file_filter);
 
--- a/libgui/qterminal/libqterminal/unix/TerminalView.cpp	Thu May 04 23:25:36 2017 -0400
+++ b/libgui/qterminal/libqterminal/unix/TerminalView.cpp	Sun May 07 14:00:50 2017 +0200
@@ -1205,23 +1205,22 @@
               // find the position of the underline below that
               int underlinePos = baseline + metrics.underlinePos();
 
-              if ( r.contains( mapFromGlobal(QCursor::pos()) ) )
-                painter.drawLine( r.left() , underlinePos ,
-                                  r.right() , underlinePos );
+              if (r.contains (mapFromGlobal(QCursor::pos())))
+                {
+                  if (spot->type () == Filter::ErrorLink)
+                    painter.setPen (QColor (255,0,0));
+                  painter.drawLine (r.left(), underlinePos,
+                                    r.right(), underlinePos);
+                }
             }
           // Marker hotspots simply have a transparent rectanglular shape
           // drawn on top of them
-          else if ( spot->type() == Filter::Error )
+          else if ( spot->type() == Filter::Marker )
             {
               //TODO - Do not use a hardcoded colour for this
-              painter.fillRect(r,QBrush(QColor(255,0,0,96)));
+              painter.fillRect(r,QBrush(QColor(255,0,0,120)));
             }
 
-          if ( spot->type() == Filter::ErrorLink )
-            {
-              //TODO - Do not use a hardcoded colour for this
-              painter.fillRect(r,QBrush(QColor(255,0,0,96)));
-            }
         }
     }
 }