Page 1 of 1

Possible bug with icon columns in ListView

Posted: Thu Jul 04, 2019 12:03 pm
by Clyde
There seems to be a visual bug when I use an icon column if that column is not the first column of the list view.

This is my code:

Code: Select all

@REQUIRE "RapaGUI"

xml$=[[<?xml version="1.0" encoding="iso-8859-1"?>
    <application id="app">
        <window>
            <vgroup>
		<listview id="listview1">
            	  <column title="Value 1"  />
            	  <column title="Value 2"/>
            	  <column title="Value 3"/>
            	  <column title="Value 4"/>
            	  <column title="Color" icon="True" />
        	</listview>
	   </vgroup>
        </window>
    </application>]]

moai.CreateApp(xml$)

Local brushID = 1
CreateBrush(brushID, 60, 20, #RED)

moai.DoMethod("listview1","insert","bottom", "a", "b", "c", "d", brushID, "e")

Repeat
   WaitEvent
Forever
The icon column is the last column. If you run this code you see that the content of the first column seems to be right aligned, while it should be left aligned like the other columns.
The problem is that the content is not really right aligned but it is moved 60 px to the right which is the width of my brush of the last column! So in this case you don't see that the first column has content until you resize the column. If you decrease the width of the icon brush (let's say to 20) you see the content of the first column but still moved 20 px to the right.

Here are screenshots of the problem:

Image
Image

Tested on Windows 10

Re: Possible bug with icon columns in ListView

Posted: Thu Jul 04, 2019 12:24 pm
by airsoftsoftwair
Does the problem also occur in dataview mode? i.e. create the listview like this:

Code: Select all

<listview id="listview1" forcemode="dataview">

Re: Possible bug with icon columns in ListView

Posted: Thu Jul 04, 2019 10:50 pm
by Clyde
Nope, in dataview mode it works correctly! So thanks a lot for this nice workaround! But it should also work in normal mode, right?

Re: Possible bug with icon columns in ListView

Posted: Sat Jul 06, 2019 11:55 am
by airsoftsoftwair
Clyde wrote:
Thu Jul 04, 2019 10:50 pm
Nope, in dataview mode it works correctly! So thanks a lot for this nice workaround! But it should also work in normal mode, right?
Yes, it should. I'll see what's wrong there.

Re: Possible bug with icon columns in ListView

Posted: Sat Jul 06, 2019 10:58 pm
by Clyde
Great, thank you!