diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-05-22 23:49:15 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-05-22 23:49:15 +0000 |
commit | b4d61b2271d14e5e73a54eddae16502d30e2825e (patch) | |
tree | e40c5e9ad9a10e28f4a28ff6fbbddaaeec8441a9 /NxWidgets/libnxwidgets/src | |
parent | 7f085e8bf5f5bdf0cc2b8e39123db7bfa9a0742a (diff) | |
download | nuttx-b4d61b2271d14e5e73a54eddae16502d30e2825e.tar.gz nuttx-b4d61b2271d14e5e73a54eddae16502d30e2825e.tar.bz2 nuttx-b4d61b2271d14e5e73a54eddae16502d30e2825e.zip |
Hack for font background when we cannot read from the LCD; Candidate fix for ILI9325 LCD
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4763 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'NxWidgets/libnxwidgets/src')
-rw-r--r-- | NxWidgets/libnxwidgets/src/cbuttonarray.cxx | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/NxWidgets/libnxwidgets/src/cbuttonarray.cxx b/NxWidgets/libnxwidgets/src/cbuttonarray.cxx index 642a0a562..28f14062b 100644 --- a/NxWidgets/libnxwidgets/src/cbuttonarray.cxx +++ b/NxWidgets/libnxwidgets/src/cbuttonarray.cxx @@ -519,9 +519,25 @@ void CButtonArray::drawButton(CGraphicsPort *port, int column, int row, bool use pos.x = x + alignX; pos.y = y + alignY; - // And draw the button text + // Set the CGraphicsControl background to match the selected background color. + // This is only necessary if we cannot read from the LCD. If we cannot read + // from then the font background is set to this background color. + // REVISIT: This begs for a more generalized solution. + +#ifdef CONFIG_NX_WRITEONLY + nxgl_mxpixel_t saveColor = port->getBackColor(); + port->setBackColor(backColor); +#endif + + // And draw the button text. port->drawText(&pos, &rect, getFont(), *text, 0, text->getLength(), textColor); + + // Restore the default background color + +#ifdef CONFIG_NX_WRITEONLY + port->setBackColor(saveColor); +#endif } /** |