mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-31 13:20:23 +02:00
IDE, ToolbarConfig: Make the ListView work with both QT and OSX. Requires IFDEFs. Issue #27603, Patch from Balázs Székely.
git-svn-id: trunk@48581 -
This commit is contained in:
parent
8599779fa6
commit
7ee1e908fb
@ -155,7 +155,6 @@ object ToolBarConfig: TToolBarConfig
|
||||
Width = 314
|
||||
end>
|
||||
HideSelection = False
|
||||
OwnerDraw = True
|
||||
ReadOnly = True
|
||||
ScrollBars = ssAutoBoth
|
||||
ShowColumnHeaders = False
|
||||
|
@ -118,6 +118,10 @@ const
|
||||
procedure TToolBarConfig.FormCreate(Sender: TObject);
|
||||
begin
|
||||
inherited;
|
||||
//we have to ownerdraw the listview on qt
|
||||
{$IFDEF LCLQT}
|
||||
lvToolbar.OwnerDraw := True;
|
||||
{$ENDIF}
|
||||
pnlButtons.Color := clBtnFace;
|
||||
// load button images
|
||||
btnAdd.LoadGlyphFromResourceName(HInstance, 'arrow_right');
|
||||
@ -277,12 +281,13 @@ begin
|
||||
lvItem := lvToolbar.Items.Add;
|
||||
lvItem.Caption := ACaption;
|
||||
lvItem.Data := n.Data;
|
||||
{
|
||||
{$IF not DEFINED(LCLQt)}
|
||||
if n.ImageIndex > -1 then
|
||||
lvItem.ImageIndex := n.ImageIndex
|
||||
else
|
||||
lvItem.ImageIndex := defImageIndex;
|
||||
}
|
||||
{$ENDIF}
|
||||
//lvItem.SubItems.Add(IntToStr(CurrProfile));
|
||||
if anIndex > -1 then begin
|
||||
// clear previous selection to avoid double sel in Qt
|
||||
lvToolbar.Selected := nil;
|
||||
@ -387,7 +392,10 @@ begin
|
||||
lvItem := lvToolbar.Items.Add;
|
||||
lvItem.Selected := False;
|
||||
lvItem.Caption:= cDivider;
|
||||
//lvItem.ImageIndex:= divImageIndex;
|
||||
{$IF not DEFINED(LCLQt)}
|
||||
lvItem.ImageIndex:= divImageIndex;
|
||||
{$ENDIF}
|
||||
//lvItem.SubItems.Add(IntToStr(CurrProfile));
|
||||
if lvToolbar.ItemIndex > -1 then
|
||||
InsertMainListItem(lvItem,lvToolbar.Items[anIndex])
|
||||
else
|
||||
@ -541,10 +549,12 @@ begin
|
||||
lvItem := lvToolbar.Items.Add;
|
||||
lvItem.Caption:= ACaption;
|
||||
lvItem.Data:= Item;
|
||||
{if Item.ImageIndex > -1 then
|
||||
{$IF not DEFINED(LCLQt)}
|
||||
if Item.ImageIndex > -1 then
|
||||
lvItem.ImageIndex:= Item.ImageIndex
|
||||
else
|
||||
lvItem.ImageIndex:= defImageIndex;}
|
||||
lvItem.ImageIndex:= defImageIndex;
|
||||
{$ENDIF}
|
||||
// lvItem.SubItems.Add(IntToStr(PMask));
|
||||
n:= TV.Items.FindNodeWithData(Item);
|
||||
n.Visible:= False;
|
||||
@ -557,7 +567,9 @@ var
|
||||
begin
|
||||
lvItem := lvToolbar.Items.Add;
|
||||
lvItem.Caption:= cDivider;
|
||||
//lvItem.ImageIndex:= divImageIndex;
|
||||
{$IF not DEFINED(LCLQt)}
|
||||
lvItem.ImageIndex:= divImageIndex;
|
||||
{$ENDIF}
|
||||
// lvItem.SubItems.Add(IntToStr(PMask));
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user