Board index » kylix » Modifying QTrayIcon.pas: Tool Tip Font Colour

Modifying QTrayIcon.pas: Tool Tip Font Colour


2004-09-30 03:11:03 PM
kylix0
Hi, folks.
I'm in need of a bit of help here as I frankly don't know what I'm
doing. :-D
I'm using Andreas Hausladen's excellent QTrayIcon.pas to help create a
KDE-like application. One of the issues I've run across is that the
component doesn't draw tips in KDE's default colours. I was able to
change the tip's background colour from clYellow to clInfoBk to better
match KDE, but I have yet to find a way to be able to change the font
colour used in the tool tip.
KDE's default font colour is black on a light yellow background. This
remains static regardless of the colour scheme used. Can somebody give
me a hint on how I can override the font colour? So far, my only
alternative has been to leave the hint background colour as default,
which then ensures that the tip itself is readable.
Why is this a problem at all? Some folks -- uh, like me -- really like
light-on-dark colour schemes, e.g., CDE. With such a scheme, the Kylix
app adopts the scheme's font colour, which can render the tip
unreadable. Using KDE's CDE colour scheme net's white text on a light
yellow background. Not workable.
Thanks for any ideas you can throw my way. (FWIW, this tool-tip text on
a light-yellow background is a bug in the Kylix IDE, too.)
trane
--
//------------------------------------------------------------
// Trane Francks XXXX@XXXXX.COM Tokyo, Japan
// Practice random kindness and senseless acts of beauty.
 
 

Re:Modifying QTrayIcon.pas: Tool Tip Font Colour

Trane Francks wrote:
Quote
I'm using Andreas Hausladen's excellent QTrayIcon.pas to help create a
KDE-like application.
There is a new version of QTrayIcon on www.kylix-patch.de.vu
The new version uses the QToolTip class that is not available through
Qt.pas. You can use the QToolTip for other widgets, too.
uses
QTrayIcon;
...
TToolTip.Add(MyControl, 'My hint text');
TToolTip.Remove(MyControl);
//------------
MyFont := TFont.Create;
try
MyFont.Assign(Font);
MyFont.Name := 'Times';
TToolTip.SetFont(MyFont);
finally
MyFont.Free;
end;
--
Regards,
Andreas Hausladen
(www.kylix-patch.de.vu - unofficial Kylix 3 patches)
(andy.jgknet.de/blog)
 

Re:Modifying QTrayIcon.pas: Tool Tip Font Colour

On 09/30/2004 10:52 PM +0900, Andreas Hausladen wrote:
Quote
Trane Francks wrote:

>I'm using Andreas Hausladen's excellent QTrayIcon.pas to help create a
>KDE-like application.

There is a new version of QTrayIcon on www.kylix-patch.de.vu
Hi, Andreas. This really works well. The default settings for font
colour and hint background colour are perfectly in tune with KDE. The
only different behaviour that I can see from the old version is that if
AutoShow is false and you Show the tray icon, tool tips won't work until
the user clicks on the icon once. Afterward, tips are fine. The
workaround for this is that if we decide we want to load the tray icon,
set AutoShow to true at runtime. Then the tool tip displays without
having to click on the tray icon.
Nice work. Many thanks! Borland should use this for the Kylix IDE, too.
trane
--
//------------------------------------------------------------
// Trane Francks XXXX@XXXXX.COM Tokyo, Japan
// Practice random kindness and senseless acts of beauty.
 

{smallsort}

Re:Modifying QTrayIcon.pas: Tool Tip Font Colour

Trane Francks wrote:
Quote
The only different behaviour that I can see from the old version is that
if
AutoShow is false and you Show the tray icon, tool tips won't work until
the user clicks on the icon once. Afterward, tips are fine. The
workaround for this is that if we decide we want to load the tray icon,
set AutoShow to true at runtime. Then the tool tip displays without
having to click on the tray icon.
Let's see what I can do. I have use the component only by source code
while testing. So the Loaded method was never executed and the AutoShow
property was not used at all.
Quote
Many thanks! Borland should use this for the Kylix IDE, too.
The Kylix IDE is VCL on WineLib, not CLX.
Andreas Hausladen
(www.kylix-patch.de.vu - unofficial Kylix 3 patches)
(andy.jgknet.de/blog)
 

Re:Modifying QTrayIcon.pas: Tool Tip Font Colour

Andreas Hausladen wrote:
Quote
>AutoShow is false and you Show the tray icon, tool tips won't work
>until the user clicks on the icon once.
Sorry, I cannot reproduce this under SuSE 9.1 Kernel 2.6.5-7.108-smp KDE
3.3.0
--
Regards,
Andreas Hausladen
(www.kylix-patch.de.vu - unofficial Kylix 3 patches)
(andy.jgknet.de/blog)
 

Re:Modifying QTrayIcon.pas: Tool Tip Font Colour

On 10/01/2004 02:11 AM +0900, Andreas Hausladen wrote:
Hi. I'm back from my business trip.
Quote
Andreas Hausladen wrote:

>>AutoShow is false and you Show the tray icon, tool tips won't work
>>until the user clicks on the icon once.

Sorry, I cannot reproduce this under SuSE 9.1 Kernel 2.6.5-7.108-smp KDE
3.3.0
Not to worry. I'll tinker with things and see whether I can figure out
the issue.
Cheers!
trane
--
//------------------------------------------------------------
// Trane Francks XXXX@XXXXX.COM Tokyo, Japan
// Practice random kindness and senseless acts of beauty.