patch: colour hightliighting when selecting a TOC and field elements

From: Jordi Mas <jmas_at_softcatala.org>
Date: Sun Aug 21 2005 - 19:37:23 CEST

Hello folks,

When inserting a TOC and then selecting the TOC element in the document we do
change the colour of the background to indicate selection, but instead of just
using the standard background selection colour we do get the colour and then
subtract the getColorFieldOffset color and ignore the foreground colour. The
same when selecting field elements.

On most Win32 boxes the default selection colour is dark blue that after the
substation becomes yellow, and that a pretty non-standard colour to indicate
selection in Win32.

I have put together a patch that makes TOC and field elements when selected to
be highlighted in the same way that regular text does in Abword using the
highlight fore and back colours.

I hope that nobody has objections to this patch.

Jordi,

-- 
Jordi Mas i Hernāndez, HomePage http://www.softcatala.org/~jmas/
Bloc personal http://www.softcatala.org/~jmas/bloc/
Planeta Softcatalā: http://www.softcatala.org/planet/

? fp_Run.good
? out
? tocpatch.diff
? vc60.pdb
? vc70.pdb
Index: fp_Run.cpp
===================================================================
RCS file: /cvsroot/abi/src/text/fmt/xp/fp_Run.cpp,v
retrieving revision 1.438
diff -u -r1.438 fp_Run.cpp
--- fp_Run.cpp 7 Jul 2005 03:24:01 -0000 1.438
+++ fp_Run.cpp 21 Aug 2005 17:31:51 -0000
@@ -4184,19 +4184,20 @@
                         && (iSel2 > iRunBase)))
                         )
                 {
- UT_RGBColor color(_getView()->getColorSelBackground());
- color -= _getView()->getColorFieldOffset();
+ UT_RGBColor color(_getView()->getColorSelBackground());
+ pG->setColor(_getView()->getColorSelForeground());
                         painter.fillRect(color, pDA->xoff, iFillTop, getWidth(), iFillHeight);
 
                 }
                 else
                 {
- Fill(getGraphics(),pDA->xoff, iFillTop, getWidth(), iFillHeight);
+ Fill(getGraphics(),pDA->xoff, iFillTop, getWidth(), iFillHeight);
+ pG->setColor(_getColorFG());
                 }
         }
 
         pG->setFont(_getFont());
- pG->setColor(_getColorFG());
+
 
         UT_GrowBufElement aCharWidths[FPFIELD_MAX_LENGTH];
         UT_uint32 len = UT_UCS4_strlen(m_sFieldValue);
Received on Sun Aug 21 19:40:36 2005

This archive was generated by hypermail 2.1.8 : Sun Aug 21 2005 - 19:40:37 CEST