mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-23 18:49:30 +02:00
Gtk2: fixed TGtk2WSCustomListView.GetDisplayRect, also fixed cell renderer which sent wrong item id to owner drawn list view.issue #23094
git-svn-id: trunk@39030 -
This commit is contained in:
parent
84ee0a7b04
commit
48d57049f6
@ -124,6 +124,7 @@ begin
|
||||
exit;
|
||||
|
||||
ItemIndex := GetItemIndex(PLCLIntfCellRenderer(cell), Widget);
|
||||
|
||||
if ItemIndex < 0 then
|
||||
ItemIndex := 0;
|
||||
|
||||
@ -180,6 +181,7 @@ begin
|
||||
AreaRect := Bounds(background_area^.x, background_area^.y,
|
||||
background_area^.Width, background_area^.Height);
|
||||
|
||||
|
||||
ItemIndex := GetItemIndex(PLCLIntfCellRenderer(cell), Widget);
|
||||
|
||||
if ItemIndex < 0 then
|
||||
@ -189,7 +191,10 @@ begin
|
||||
LVTarget := dtSubItem
|
||||
else
|
||||
LVTarget := dtItem;
|
||||
LVSubItem := ColumnIndex-1;
|
||||
if AWinControl.FCompStyle = csListView then
|
||||
LVSubItem := ColumnIndex
|
||||
else
|
||||
LVSubItem := ColumnIndex - 1;
|
||||
LVStage := cdPrePaint;
|
||||
LVState := GtkCellRendererStateToListViewDrawState(flags);
|
||||
DCWidget:=Widget;
|
||||
|
@ -1078,7 +1078,9 @@ begin
|
||||
begin
|
||||
Column := gtk_tree_view_get_column(PGtkTreeView(MainView), ASubItem);
|
||||
gtk_tree_view_get_cell_area(PGtkTreeView(MainView), Path, Column, @ItemRect);
|
||||
if gtk_tree_view_get_headers_visible(PGtkTreeView(MainView)) then
|
||||
// do not make any offset for drLabel and drIcon. issue #23094
|
||||
if not (ACode in [drIcon, drLabel]) and
|
||||
gtk_tree_view_get_headers_visible(PGtkTreeView(MainView)) then
|
||||
begin
|
||||
gtk_tree_view_column_cell_get_size(gtk_tree_view_get_column(PGtkTreeView(MainView), 0),
|
||||
@ARect, @L, @T, @W, @H);
|
||||
|
Loading…
Reference in New Issue
Block a user