Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » Look and Chameleon Technology » RichTextView and Chameleon with a dark background.
RichTextView and Chameleon with a dark background. [message #35925] Wed, 04 April 2012 17:54 Go to next message
rxantos is currently offline  rxantos
Messages: 72
Registered: October 2011
Member
If I use a dark background theme the colors on a formated text are ignored. For example a "[@R= Red] [@G = Green] [@B Blue]" will all be showing white instead of Red-Green-Blue.

I found the reason in:

uppsrc/CtrlLib/RichTextView.cpp

Color c = SColorPaper();
if(Grayscale(c) < 100)
  pi.coloroverride = true;


Which basically tells the control to override the all the colors of the text.

Is there a way to tell the control not to clobber the text colors when the background is dark?
Re: RichTextView and Chameleon with a dark background. [message #35927 is a reply to message #35925] Thu, 05 April 2012 07:03 Go to previous messageGo to next message
sergeynikitin is currently offline  sergeynikitin
Messages: 748
Registered: January 2008
Location: Moscow, Russia
Contributor

Use .Trasparent() with RichtextView and Paint to any color under RichTextView (color rectangle or chameleonized Ctrl).

SergeyNikitin<U++>( linux, wine )
{
    under( Ubuntu || Debian || Raspbian );
}
Re: RichTextView and Chameleon with a dark background. [message #35941 is a reply to message #35927] Sat, 07 April 2012 11:48 Go to previous message
rxantos is currently offline  rxantos
Messages: 72
Registered: October 2011
Member
Thanks for responding

Unfortunately, setting the control background to trasparent did not work.

Here is a minimum example that shows the problem.

#include <CtrlLib/CtrlLib.h>
using namespace Upp;

struct TestBug : public TopWindow {
  Upp::RichTextCtrl rt;

  TestBug(const char *szTitle) {
    Title(szTitle);
    SetRect(0, 0, 200, 50);
    rt.Transparent();
    rt = "Normal [@R Red ][@G Green ][@B Blue ]";
    Add(rt.SizePos());
  }
};

GUI_APP_MAIN {
  {
    TestBug tb("Before Paper Color Change");
    tb.Run();
  }

  SColorPaper_Write(Black());

  {
    TestBug tb("After Paper Color Change");
    tb.Run();
  }
}


Its result is:
index.php?t=getfile&id=3724&private=0

In the mean time, I just commented out code at uppsrc/CtrlLib/RichTextView.cpp. It works, except that the default text in the control is black (instead of taking it from SColorText). Trying to figure out where the control takes this default color.

[Updated on: Sat, 07 April 2012 12:33]

Report message to a moderator

Previous Topic: Unable to locate theme engine
Next Topic: Bug: Ctrl::NoLayoutZoom() has no effect
Goto Forum:
  


Current Time: Thu Mar 28 14:17:11 CET 2024

Total time taken to generate the page: 0.01474 seconds