Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2012-09

Incorrect scrollbar theme in editor popup windows

11 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Graeme Geldenhuys

Hi,

I reported this only in 2011-04, but this bug has been around long before that. Sometimes I'm lazy to report bugs.

http://bugs.freepascal.org/view.php?id=19085

Anybody know why the scrollbar has a different theme (color) to all my other scrollbars in LCL-GTK2?

This happens in any editor popup windows. eg: Code Completion, Code Templates etc.

This is the only "ugly visual bit" in Lazarus 1.0 I can see.

Regards,
- Graeme -

Reply by email

Graeme Geldenhuys
to Graeme Geldenhuys

Anybody have a hint as to where I should look to fix this issue in the IDE. Isn't the editor popup window simply a TListBox with maybe some custom painting for each line? If so, when why is the scrollbar affected?

Anyway, this really bugs me, and the issue existed since the start of LCL-GTK2. So I don't mind scratching my own itch.

Regards,
- Graeme -

Graeme Geldenhuys wrote 18 lines
Hi, I reported this only in 2011-04, but this bug has been around long before that. Sometimes I'm lazy to report bugs. http://bugs.freepascal.org/view.php?id=19085 Anybody know why the scrollbar has a different theme (color) to all my other scrollbars in LCL-GTK2? This happens in any editor popup windows. eg: Code Completion, Code Templates etc. This is the only "ugly visual bit" in Lazarus 1.0 I can see. Regards, - Graeme -

Reply by email

Martin
to Graeme Geldenhuys
Graeme Geldenhuys wrote 6 lines
Anybody have a hint as to where I should look to fix this issue in the IDE. Isn't the editor popup window simply a TListBox with maybe some custom painting for each line? If so, when why is the scrollbar affected? Anyway, this really bugs me, and the issue existed since the start of LCL-GTK2. So I don't mind scratching my own itch.

It is a plain window (with no borders), and a TScrollbar

TSynBaseCompletionForm in components\synedit\syncompletion.pas

   Scroll := TScrollBar.Create(self);
   Scroll.Kind := sbVertical;
   Scroll.OnChange := @ScrollChange;
   Scroll.Parent := Self;
   Scroll.OnEnter := @ScrollGetFocus;
   Scroll.OnScroll := @ScrollScroll;
   Scroll.TabStop := False;
   Scroll.Visible := True;

SO it is probably TScrollBar that needs looking after?

Reply by email

Graeme Geldenhuys
to Martin
Martin wrote
SO it is probably TScrollBar that needs looking after?

That you very much for the pointers. I'll take a look, thanks.

My code editor has a black background, so the bug is very visible. Maybe if standard white background is used, the bug is less visible. I'll experiment with this.

Regards,
- Graeme -

Reply by email

Mattias Gaertner
to Martin: It is a plain window (with no borders), and a TScrollbar TSynBaseCompletionForm in…

Martin hat am 26. September 2012 um 12:36 geschrieben:

Show quoted text 23 lines
On 26/09/2012 11:29, Graeme Geldenhuys wrote: > Anybody have a hint as to where I should look to fix this issue in the > IDE. Isn't the editor popup window simply a TListBox with maybe some > custom painting for each line? If so, when why is the scrollbar affected? > > Anyway, this really bugs me, and the issue existed since the start of > LCL-GTK2. So I don't mind scratching my own itch. It is a plain window (with no borders), and a TScrollbar TSynBaseCompletionForm in components\synedit\syncompletion.pas Scroll := TScrollBar.Create(self); Scroll.Kind := sbVertical; Scroll.OnChange := @ScrollChange; Scroll.Parent := Self; Scroll.OnEnter := @ScrollGetFocus; Scroll.OnScroll := @ScrollScroll; Scroll.TabStop := False; Scroll.Visible := True; SO it is probably TScrollBar that needs looking after?

The TSynBaseCompletionForm paints on the form, the whole area. But the TScrollBar is not opaque, so syncompletion paints into the scrollbar. I fixed the background of items.
But there is still some non default background painting. Maybe the form color is set.

Mattias

Reply by email

Graeme Geldenhuys
to Mattias Gaertner
Mattias Gaertner wrote
The TSynBaseCompletionForm paints on the form, the whole area. But the TScrollBar is not opaque, so syncompletion paints into the scrollbar. I fixed the background of items.

Why is the TScrollBar not opaque? Is this a setting only for synedit, or for general LCL?

Or why doesn't the form painting simply not take the scrollbar into account. If the scrollbar is visible, reduce the client rectangle painting area and/or paint the client area behind the scrollbar as clForm color.

Anyway, I'll take a look at the code now to try and get a better understand of what all the painting does.

Regards,
- Graeme -

Reply by email

zeljko
to Graeme Geldenhuys
Graeme Geldenhuys wrote 7 lines
On 2012-09-26 12:22, Mattias Gaertner wrote: > The TSynBaseCompletionForm paints on the form, the whole area. But the > TScrollBar is not opaque, so syncompletion paints into the scrollbar. > I fixed the background of items. Why is the TScrollBar not opaque? Is this a setting only for synedit, or for general LCL?

WS decides about opacity of scrollbar. LCL does not paint it at all.

Or why doesn't the form painting simply not take the scrollbar into account. If the scrollbar is visible, reduce the client rectangle painting area and/or paint the client area behind the scrollbar as clForm color.

Paint method of that forms should take into account scrollbar and reduce it's rect (so not FillRect() and others below scrollbar.

zeljko

Reply by email

Graeme Geldenhuys
to Martin: It is a plain window (with no borders), and a TScrollbar TSynBaseCompletionForm in…
Martin wrote
SO it is probably TScrollBar that needs looking after?

It seems you are right, and it looks like a TScrollBar bug. Very easy to reproduce. Simply place one vertical and one horizontal scrollbar on a Form. Set the Form.Color to clBlack. Poof, your scrollbars disappear (strangely enough except for the left and top scroll button). All GTK2 theme painting of the scrollbar is ignored by LCL.

Looking at TCustomScrollBar, it seems they do lots of odd WinAPI-style trickering in just creating the component, so I have no clue what's actually going on. But I'll play around some more.

Regards,
- Graeme -

-------------- next part --------------
A non-text attachment was scrubbed...
Name: screenshot.png
Type: image/png
Size: 1813 bytes
Desc: not available
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20120926/22def10b/attachment.png>

Reply by email

Mattias Gaertner
to zeljko: WS decides about opacity of scrollbar. LCL does not paint it at all. Paint method of that…

zeljko hat am 26. September 2012 um 14:10 geschrieben:

Show quoted text 18 lines
On Wednesday 26 of September 2012 13:34:34 Graeme Geldenhuys wrote: > On 2012-09-26 12:22, Mattias Gaertner wrote: > > The TSynBaseCompletionForm paints on the form, the whole area. But the > > TScrollBar is not opaque, so syncompletion paints into the scrollbar. > > I fixed the background of items. > > Why is the TScrollBar not opaque? Is this a setting only for synedit, > or for general LCL? WS decides about opacity of scrollbar. LCL does not paint it at all. > Or why doesn't the form painting simply not take the scrollbar into > account. If the scrollbar is visible, reduce the client rectangle > painting area and/or paint the client area behind the scrollbar as > clForm color. Paint method of that forms should take into account scrollbar and reduce it's rect (so not FillRect() and others below scrollbar.

Or exclude the clip rect or add csOpaque to the scrollbar controlstyle.

Mattias
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20120926/6adbc979/attachment-0001.html>

Reply by email

Graeme Geldenhuys
to Mattias Gaertner
Mattias Gaertner wrote
Or exclude the clip rect or add csOpaque to the scrollbar controlstyle.

It seems we found a bug here. TScrollbar is Opaque, but LCL-GTK2 seems to ignore that ControlStyle setting.

The code from TCustomScrollbar.Create()

   ControlStyle := ControlStyle + [csFramed, csDoubleClicks, csOpaque]
                                - [csAcceptsControls, csDoubleClicks,
                                   csCaptureMouse, csSetCaption];

Regards,
- Graeme -

Reply by email

Mattias Gaertner
to Graeme Geldenhuys

Graeme Geldenhuys hat am 26. September 2012 um 14:33 geschrieben:

Show quoted text 7 lines
On 2012-09-26 13:17, Mattias Gaertner wrote: > > Or exclude the clip rect or add csOpaque to the scrollbar controlstyle. It seems we found a bug here. TScrollbar is Opaque, but LCL-GTK2 seems to ignore that ControlStyle setting.

csOpaque is not a widgetset settings, but a LCL one. It excludes the area by clipping when calling Paint and effects how Mouse hits are handled.

Show quoted text 6 lines
The code from TCustomScrollbar.Create() ControlStyle := ControlStyle + [csFramed, csDoubleClicks, csOpaque] - [csAcceptsControls, csDoubleClicks, csCaptureMouse, csSetCaption];

Right. Then maybe I guessed wrong and something else is painting the background.

Mattias
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20120926/b79137eb/attachment.html>

Reply by email