TButton invisible when 'GtkButton' does not support property named 'inner-border'
Original Reporter info from Mantis: Bart @flyingsheep
-
Reporter name: Bart Broersma
Original Reporter info from Mantis: Bart @flyingsheep
- Reporter name: Bart Broersma
Description:
On older gtk2 versions, that do not support property named 'inner-border' for GtkButton, all TButtons are invisible, both in IDE and in compiled program.
Tested on Suse 10.0 with gtk2 version gtk2-2.8.3-4
Additional information:
in /lcl/interfaces/gtk2/gtk2wsstdctrls.pp
procedure Gtk2WSButton_SizeAllocate(widget: PGtkWidget; allocation: PGtkAllocation; user_data: gpointer); cdecl;
width := width + 2 * xthickness;
gtk_widget_style_get (widget, 'inner-border', @inner_border, nil);
if inner_border <> nil then
begin
x := x - inner_border^.left;
width := width + inner_border^.left + inner_border^.right;
This (if inner_border <> nil) will always evaluate to true, because the local variable inner_border is not initialized to nil
Changing it to
width := width + 2 * xthickness;
inner_border := nil;
gtk_widget_style_get (widget, 'inner-border', @inner_border, nil);
if inner_border <> nil then
begin
x := x - inner_border^.left;
width := width + inner_border^.left + inner_border^.right;
Will solve the issue (for me at least).
I attached a diff for it.
Mantis conversion info:
- Mantis ID: 15949
- OS: Suse Linux
- OS Build: 10.0
- Build: r23919
- Platform: i386
- Version: 0.9.29 (SVN)
- Fixed in version: 0.9.30
- Fixed in revision: 23925 (#3a1ec8ca)
- Target version: 0.9.30