]> git.lyx.org Git - features.git/commitdiff
Fix bug 5629: http://bugzilla.lyx.org/show_bug.cgi?id=5629.
authorVincent van Ravesteijn <vfr@lyx.org>
Mon, 9 Feb 2009 20:47:32 +0000 (20:47 +0000)
committerVincent van Ravesteijn <vfr@lyx.org>
Mon, 9 Feb 2009 20:47:32 +0000 (20:47 +0000)
Hard to distinguish between added and deleted text.

* Changes.cpp/h: add a merge_color for deletions and change the return type to Color.

* ColorCode.h/Color.cpp: add a new customizable color that indicates the merge color for deletion.

See:
http://thread.gmane.org/gmane.editors.lyx.devel/114189

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@28423 a592a061-630c-0410-9148-cb99ea01b6c8

src/Changes.cpp
src/Changes.h
src/Color.cpp
src/ColorCode.h
src/rowpainter.cpp

index b49f2551509ee921b8af5db1e07b6817c8c154b1..8ea11399ea6648b34bc3beac239c3004aae2433c 100644 (file)
@@ -54,9 +54,9 @@ bool Change::isSimilarTo(Change const & change) const
 }
 
 
-ColorCode Change::color() const
+Color Change::color() const
 {
-       ColorCode color = Color_none;
+       Color color = Color_none;
        switch (author % 5) {
                case 0:
                        color = Color_changedtextauthor1;
@@ -74,6 +74,10 @@ ColorCode Change::color() const
                        color = Color_changedtextauthor5;
                        break;
        }
+
+       if (deleted())
+               color.mergeColor = Color_deletedtextmodifier;
+
        return color;
 }
 
index 09ac0aa0fe7d3dd52271f2a1574ab23693d9a432..643a7fae38029be72a5051ccdb07548d0c1e8230 100644 (file)
@@ -15,7 +15,7 @@
 #ifndef CHANGES_H
 #define CHANGES_H
 
-#include "ColorCode.h"
+#include "Color.h"
 
 #include "support/strfwd.h"
 #include "support/types.h"
@@ -45,7 +45,7 @@ public:
        /// is the change similar to the given change such that both can be merged?
        bool isSimilarTo(Change const & change) const;
        /// The color of this change on screen
-       ColorCode color() const;
+       Color color() const;
        ///
        bool changed() const { return type != UNCHANGED; }
        ///
index 6c6e32481fbdccbb67eb7b387169128f7648c28e..a8c583d5a8e6b181afab020b880999a83fc12604 100644 (file)
@@ -203,6 +203,7 @@ ColorSet::ColorSet()
        { Color_changedtextauthor3, N_("changed text 3rd author"), "changedtextauthor3", "#ff0000", "changedtextauthor3" },
        { Color_changedtextauthor4, N_("changed text 4th author"), "changedtextauthor4", "#aa00ff", "changedtextauthor4" },
        { Color_changedtextauthor5, N_("changed text 5th author"), "changedtextauthor5", "#55aa00", "changedtextauthor5" },
+       { Color_deletedtextmodifier, N_("deleted text modifier"), "deletedtextmodifier", "white", "deletedtextmodifier" },
        { Color_added_space, N_("added space markers"), "added_space", "Brown", "added_space" },
        { Color_topline, N_("top/bottom line"), "topline", "Brown", "topline" },
        { Color_tabularline, N_("table line"), "tabularline", "black", "tabularline" },
index 46eeb1c26a4df0184f60c073a6ac5bbe0bef7b8d..16e0ba33ec1bd19d239a002f710478aaeec1f376 100644 (file)
@@ -130,12 +130,12 @@ enum ColorCode
        /// Math line color
        Color_mathline,
 
-       /// caption frame color
+       /// Caption frame color
        Color_captionframe,
 
-       /// collapsable insets text
+       /// Collapsable insets text
        Color_collapsable,
-       /// collapsable insets frame
+       /// Collapsable insets frame
        Color_collapsableframe,
 
        /// Inset marker background color
@@ -151,22 +151,24 @@ enum ColorCode
        Color_added_space,
        /// Appendix marker color
        Color_appendix,
-       /// changebar color
+       /// Changebar color
        Color_changebar,
-       /// deleted text color
+       /// Deleted text color
        Color_deletedtext,
-       /// added text color
+       /// Added text color
        Color_addedtext,
-       /// changed text color author 1
+       /// Changed text color author 1
        Color_changedtextauthor1,
-       /// changed text color author 2
+       /// Changed text color author 2
        Color_changedtextauthor2,
-       /// changed text color author 3
+       /// Changed text color author 3
        Color_changedtextauthor3,
-       /// changed text color author 4
+       /// Changed text color author 4
        Color_changedtextauthor4,
-       /// changed text color author 5
+       /// Changed text color author 5
        Color_changedtextauthor5,
+       /// Deleted text modifying color
+       Color_deletedtextmodifier,
        /// Top and bottom line color
        Color_topline,
        /// Table line color
index 4de10afe2d96fbe8a92738d73f96f827968d7827..f23451560798998eed015a16f456db70873898f4 100644 (file)
@@ -595,7 +595,7 @@ void RowPainter::paintLast()
                FontMetrics const & fm =
                        theFontMetrics(pi_.base.bv->buffer().params().getFont());
                int const length = fm.maxAscent() / 2;
-               ColorCode col = change.color();
+               Color col = change.color();
 
                pi_.pain.line(int(x_) + 1, yo_ + 2, int(x_) + 1, yo_ + 2 - length, col,
                           Painter::line_solid, Painter::line_thick);