From 926cb6f7d228b347db16a45e1f2632da475da1f0 Mon Sep 17 00:00:00 2001 From: Neil Date: Sun, 31 Jul 2022 15:51:53 +1000 Subject: Added change history which can display document changes (modified, saved, ...) in the margin or in the text. --- src/ViewStyle.cxx | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) (limited to 'src/ViewStyle.cxx') diff --git a/src/ViewStyle.cxx b/src/ViewStyle.cxx index 25a5f9cad..01b94cca1 100644 --- a/src/ViewStyle.cxx +++ b/src/ViewStyle.cxx @@ -104,6 +104,49 @@ ViewStyle::ViewStyle(size_t stylesSize_) : indicators[1] = Indicator(IndicatorStyle::TT, ColourRGBA(0, 0, 0xff)); indicators[2] = Indicator(IndicatorStyle::Plain, ColourRGBA(0xff, 0, 0)); + // Reverted to origin + constexpr ColourRGBA revertedToOrigin(0x40, 0xA0, 0xBF); + // Saved + constexpr ColourRGBA saved(0x0, 0xA0, 0x0); + // Modified + constexpr ColourRGBA modified(0xA0, 0xA0, 0x0); + // Reverted to change + constexpr ColourRGBA revertedToChange(0xFF, 0x80, 0x0); + + // Edition indicators + constexpr size_t indexHistory = static_cast(IndicatorNumbers::HistoryRevertedToOriginInsertion); + + indicators[indexHistory+0] = Indicator(IndicatorStyle::StraightBox, ColourRGBA(revertedToOrigin, 0x40)); + indicators[indexHistory+1] = Indicator(IndicatorStyle::Point, revertedToOrigin); + indicators[indexHistory+2] = Indicator(IndicatorStyle::StraightBox, ColourRGBA(saved, 0x40)); + indicators[indexHistory+3] = Indicator(IndicatorStyle::Point, saved); + indicators[indexHistory+4] = Indicator(IndicatorStyle::StraightBox, ColourRGBA(modified, 0x40)); + indicators[indexHistory+5] = Indicator(IndicatorStyle::Point, modified); + indicators[indexHistory+6] = Indicator(IndicatorStyle::StraightBox, ColourRGBA(revertedToChange, 0x40)); + indicators[indexHistory+7] = Indicator(IndicatorStyle::Point, revertedToChange); + + // Edition markers + // Reverted to origin + constexpr size_t indexHistoryRevertedToOrigin = static_cast(MarkerOutline::HistoryRevertedToOrigin); + markers[indexHistoryRevertedToOrigin].back = revertedToOrigin; + markers[indexHistoryRevertedToOrigin].fore = revertedToOrigin; + markers[indexHistoryRevertedToOrigin].markType = MarkerSymbol::LeftRect; + // Saved + constexpr size_t indexHistorySaved = static_cast(MarkerOutline::HistorySaved); + markers[indexHistorySaved].back = saved; + markers[indexHistorySaved].fore = saved; + markers[indexHistorySaved].markType = MarkerSymbol::LeftRect; + // Modified + constexpr size_t indexHistoryModified = static_cast(MarkerOutline::HistoryModified); + markers[indexHistoryModified].back = ColourRGBA(modified, 0x40); + markers[indexHistoryModified].fore = modified; + markers[indexHistoryModified].markType = MarkerSymbol::LeftRect; + // Reverted to change + constexpr size_t indexHistoryRevertedToModified = static_cast(MarkerOutline::HistoryRevertedToModified); + markers[indexHistoryRevertedToModified].back = revertedToChange; + markers[indexHistoryRevertedToModified].fore = revertedToChange; + markers[indexHistoryRevertedToModified].markType = MarkerSymbol::LeftRect; + technology = Technology::Default; indicatorsDynamic = false; indicatorsSetFore = false; -- cgit v1.2.3