[Bug?] SetGadgetFont() on TreeGadget() with icons
Posted: Wed Dec 28, 2016 12:32 pm
Hi,
when using the TreeGadget with icons and a custom set font / font size I observed a small thing: the text is not centered vertically with regard to the icons anymore. It's not a big thing, but it looks somehow ... ugly. (PB 5.51 x64 on macOS Sierra 10.12)
Here is a small example code:
Is this a bug or do I overlook something? Does anyone have an idea for a simple workaround?
Thanks and best regards,
Christian
when using the TreeGadget with icons and a custom set font / font size I observed a small thing: the text is not centered vertically with regard to the icons anymore. It's not a big thing, but it looks somehow ... ugly. (PB 5.51 x64 on macOS Sierra 10.12)
Here is a small example code:
Code: Select all
EnableExplicit
Define WindowEvent.q
LoadFont(0, "Verdana", 12)
If OpenWindow(0, 0, 0, 200, 500, "TreeGadget", #PB_Window_ScreenCentered)
TreeGadget(0, 10, 10, WindowWidth(0) - 20, WindowHeight(0) - 20)
SetGadgetFont(0, FontID(0))
CreateImage(0, 16, 16)
If StartDrawing(ImageOutput(0))
Box(0, 0, OutputWidth(), OutputHeight(), $CC3299)
StopDrawing()
EndIf
CreateImage(1, 16, 16)
If StartDrawing(ImageOutput(1))
Box(0, 0, OutputWidth(), OutputHeight(), $7A96E9)
StopDrawing()
EndIf
AddGadgetItem(0, -1, "Item", ImageID(0))
AddGadgetItem(0, -1, "Subitem", ImageID(1), 1)
SetGadgetItemState(0, 0, #PB_Tree_Expanded)
Repeat
WindowEvent = WaitWindowEvent()
Select WindowEvent
EndSelect
Until WindowEvent = #PB_Event_CloseWindow
EndIf
Thanks and best regards,
Christian