Qt Sink : Allow for darker colors (for light background). (#2817)
Default are too bright if background is light(white).
This commit is contained in:
		@@ -71,7 +71,7 @@ template<typename Mutex>
 | 
				
			|||||||
class qt_color_sink : public base_sink<Mutex>
 | 
					class qt_color_sink : public base_sink<Mutex>
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
public:
 | 
					public:
 | 
				
			||||||
    qt_color_sink(QTextEdit *qt_text_edit, int max_lines)
 | 
					    qt_color_sink(QTextEdit *qt_text_edit, int max_lines, bool dark_colors=false)
 | 
				
			||||||
        : qt_text_edit_(qt_text_edit)
 | 
					        : qt_text_edit_(qt_text_edit)
 | 
				
			||||||
        , max_lines_(max_lines)
 | 
					        , max_lines_(max_lines)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
@@ -84,16 +84,16 @@ public:
 | 
				
			|||||||
        // set colors
 | 
					        // set colors
 | 
				
			||||||
        QTextCharFormat format;
 | 
					        QTextCharFormat format;
 | 
				
			||||||
        // trace
 | 
					        // trace
 | 
				
			||||||
        format.setForeground(Qt::gray);
 | 
					        format.setForeground(dark_colors ? Qt::darkGray : Qt::gray);
 | 
				
			||||||
        colors_.at(level::trace) = format;
 | 
					        colors_.at(level::trace) = format;
 | 
				
			||||||
        // debug
 | 
					        // debug
 | 
				
			||||||
        format.setForeground(Qt::cyan);
 | 
					        format.setForeground(dark_colors ? Qt::darkCyan : Qt::cyan);
 | 
				
			||||||
        colors_.at(level::debug) = format;
 | 
					        colors_.at(level::debug) = format;
 | 
				
			||||||
        // info
 | 
					        // info
 | 
				
			||||||
        format.setForeground(Qt::green);
 | 
					        format.setForeground(dark_colors ? Qt::darkGreen : Qt::green);
 | 
				
			||||||
        colors_.at(level::info) = format;
 | 
					        colors_.at(level::info) = format;
 | 
				
			||||||
        // warn
 | 
					        // warn
 | 
				
			||||||
        format.setForeground(Qt::yellow);
 | 
					        format.setForeground(dark_colors ? Qt::darkYellow : Qt::yellow);
 | 
				
			||||||
        colors_.at(level::warn) = format;
 | 
					        colors_.at(level::warn) = format;
 | 
				
			||||||
        // err
 | 
					        // err
 | 
				
			||||||
        format.setForeground(Qt::red);
 | 
					        format.setForeground(Qt::red);
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user