qdiff: Need the way to configure color scheme

Bug #280041 reported by Alexander Belchenko
4
Affects Status Importance Assigned to Milestone
QBzr
Fix Released
Medium
Unassigned

Bug Description

I am using a dark colour scheme, and the colours qdiff chooses for the changes do not contrast enough with the scheme I'm using. Is it possible to configure them somehow?

Tags: qdiff dark-kde
Revision history for this message
Ohad Kammar (ohad-kammar) wrote :
Revision history for this message
Alexander Belchenko (bialix) wrote :

thank you for screenshot.

Changed in qbzr:
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
Alexander Belchenko (bialix) wrote :

If you have an inspiration you can try to find more suitable colors and change the code directly.
You need to change RGB values in the lib/diffview.py file, around 43 lines you should see following code:

colors = {
    'delete': (QtGui.QColor(255, 160, 180), QtGui.QColor(200, 60, 90)),
    'insert': (QtGui.QColor(180, 255, 180), QtGui.QColor(80, 210, 80)),
    'replace': (QtGui.QColor(206, 226, 250), QtGui.QColor(90, 130, 180)),
    'blank': (QtGui.QColor(240, 240, 240), QtGui.QColor(171, 171, 171)),
}

QtGui.QColor there are defined R,G,B values to mark different kind of changes. E.g. delete -- currently drawn in red, insert -- in green, replace -- in blue. Second value used to highlight interline changes (currently it's darker color). You can change these values and run qdiff again to see effect.

When you'll be happy with new colors, please attach a patch to this bug report.

Revision history for this message
Ohad Kammar (ohad-kammar) wrote :

After implementing the user defined colour configuration (see here: https://code.edge.launchpad.net/~ohad-kammar/qbzr/configurable-colours/+merge/1278 ), I played around a bit with the actual colours, and am pretty satisfied with these (taken from my configuration file):

[QDIFF COLOURS]
delete_fill = 82, 14, 168
insert_fill = 0, 0, 0
blank_fill = 22, 168, 235
blank_bound = 22, 168, 235
replace_fill = 33, 56, 64
replacement_text_background = 85, 55, 85

Attached is a screenshot.

Changed in qbzr:
status: Confirmed → Fix Released
tags: added: dark-kde
removed: color
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related questions

Remote bug watches

Bug watches keep track of this bug in other bug trackers.