TListView: Reduce space between images. lazarus / 31-LCL ---------------------------------------------------------------------- GAN · 2018-02-23 22:06 Is there a way to reduce it?, because I don't use caption. SmallImages used and ViewStyle := vsSmallIcon. Best regards. ---------------------------------------------------------------------- jamie · 2018-02-23 22:31 Look in the "Columns" Array and set the Maxwidth for First column ? Columns is an array of TlistColumn  which has MaxWidth and MinWidth or even Width.. ---------------------------------------------------------------------- GAN · 2018-02-23 23:14 Sorry, I was referring to the vertical space between images. I'm not using columns because I only need a list of images. Thanks anyway. ---------------------------------------------------------------------- wp · 2018-02-23 23:20 The green envelope looks as if your images are not square. What is the Width and Height in the ImageList associated to the ListView? For square images, both values must be equal. ---------------------------------------------------------------------- GAN · 2018-02-23 23:32 No, the green envelope is because the empty caption. TImageList 32x32 and TListView.SmallImages are 32x32 too. I need to hide the caption of the items to solve this. (I think...) ---------------------------------------------------------------------- wp · 2018-02-23 23:43 Working fine for me, the icons practically touch. Can you post a little demo to play with? (only .pas, .lfm, .lpr, and .lpi files, all packed into a common zip which you can upload under "Attachments and other options". No big project, please, this effect should be reproducible for you in a little stand-alone demo - otherwise the bug is somewhere else). ---------------------------------------------------------------------- GAN · 2018-02-23 23:59 Zip file atached. I also include .res because the images. I made a new proyect with only the TListView a TImageList. May be a GTK2 limitation? ---------------------------------------------------------------------- GAN · 2018-02-24 00:36 Works fine on Windows, so the problem is only with GTK widget. ---------------------------------------------------------------------- wp · 2018-02-24 00:48 Thank you. On Windows the icons are close together, like I see it in my own demo. On Linux I see the same wide vertical spacing as you. I switched from gtk2 to qt4 - same result. It looks as if Linux reserves the space for the text and ignores that there is no text at all. But just to draw icons, a TListview maybe is "overkill". Can't you try to paint them yourself on a Paintbox which you insert into a Scrollbox? Use its OnPaint event, call ImageList.Draw(Canvas, x,y, ImgIndex) to draw the image. See attached demo (quick and dirty, could be improved to draw only the visible images, which certainly will be much faster than the overloaded ListView). ---------------------------------------------------------------------- GAN · 2018-02-24 03:08 Compilar proyecto, Objetivo: project1: Código de salida 256, Errores: 1 project1.lpr(17,15) Error: identifier idents no member "Scaled" Anyway, I know nothing about paintbox, scrollbox and canvas. I'm new in the world of graphical programation, I come from Clipper.... I need lot of time to study the LCL components. Also this program will be used on Windows, so there's not real problem. Thank you for your help and "sorry" for my english  Best Regards. ---------------------------------------------------------------------- wp · 2018-02-24 09:30 Quote from: GAN on February 24, 2018, 04:08:26 amproject1.lpr(17,15) Error: identifier idents no member "Scaled" That problem again! It is because I am switching between Laz trunk and 1.8. Just remove this line in project1.lpr. ---------------------------------------------------------------------- zeljko · 2018-02-24 10:57 Quote from: wp on February 24, 2018, 01:48:14 amThank you. On Windows the icons are close together, like I see it in my own demo. On Linux I see the same wide vertical spacing as you. I switched from gtk2 to qt4 - same result. It looks as if Linux reserves the space for the text and ignores that there is no text at all. But just to draw icons, a TListview maybe is "overkill". Can't you try to paint them yourself on a Paintbox which you insert into a Scrollbox? Use its OnPaint event, call ImageList.Draw(Canvas, x,y, ImgIndex) to draw the image. See attached demo (quick and dirty, could be improved to draw only the visible images, which certainly will be much faster than the overloaded ListView). Linux does not have anything todo with spacing in TListView. It's up to widgetset, so better fill bug report against gtk2 and qt and attach simple example project. ---------------------------------------------------------------------- wp · 2018-02-24 12:40 You're right. I should try to use more precise words.