diff --git a/components/tvplanit/source/vpevnteditdlg.lfm b/components/tvplanit/source/vpevnteditdlg.lfm index 94acb14e3..a7a6c76f1 100644 --- a/components/tvplanit/source/vpevnteditdlg.lfm +++ b/components/tvplanit/source/vpevnteditdlg.lfm @@ -286,13 +286,11 @@ object DlgEventEdit: TDlgEventEdit end object Category: TComboBox Left = 484 - Height = 21 + Height = 23 Top = 40 Width = 180 ItemHeight = 15 OnDrawItem = CategoryDrawItem - ReadOnly = True - Style = csOwnerDrawFixed TabOrder = 2 end object RecurringType: TComboBox diff --git a/components/tvplanit/source/vpevnteditdlg.pas b/components/tvplanit/source/vpevnteditdlg.pas index fe57a67e0..c2b84f627 100644 --- a/components/tvplanit/source/vpevnteditdlg.pas +++ b/components/tvplanit/source/vpevnteditdlg.pas @@ -199,6 +199,8 @@ end; { TDlgEventEdit } procedure TDlgEventEdit.FormCreate(Sender: TObject); +var + h: Integer; begin {$IFDEF LCL} StartTime := TTimeEdit.Create(self); @@ -246,7 +248,13 @@ begin end; IntervalUpDown.Associate := FCustomInterval; - Category.ItemHeight := LocationEdit.Height - 6; + // This is needed as workaround for the combobox height at higher dpi. + // We design it with Style csDropdown where the height is correct, and then + // use the corresponding, correct ItemHeight after switching to csOwnerDrawFixed + // (which is needed to draw the color boxes). + h := Category.ItemHeight; + Category.Style := csOwnerDrawFixed; + Category.ItemHeight := h; end; {=====}