QT: implement TColorDialog.Options cdNoButtons and cdDontUseNativeDialog.

This commit is contained in:
Bart 2024-12-14 16:38:30 +01:00
parent 1408958bc6
commit 4360b24b70
2 changed files with 7 additions and 1 deletions
lcl

View File

@ -293,7 +293,9 @@ type
cdShowHelp, // Causes the dialog box to display the Help button.
cdSolidColor, // Causes the dialog box to display only solid colors in the set of basic colors.
cdAnyColor, // Causes the dialog box to display all available colors in the set of basic colors.
cdShowAlphaChannel // Shows the AlphaChannel control (GTK2, QT, QT5, QT6)
cdShowAlphaChannel, // Shows the AlphaChannel control (GTK2, QT, QT5, QT6)
cdNoButtons, // Removes the buttons from the dialog (QT, QT5, QT6)
cdDontUseNativeDialog // Use QT dialog, not the dialog of the OS (QT, QT5, Qt6)
);
TColorDialogOptions = set of TColorDialogOption;

View File

@ -897,6 +897,10 @@ begin
AOptions := 0; // here we add possible options from ColorDialog.Options, see QColorDialogColorDialogOptions for possible options.
if (cdShowAlphaChannel in ColorDialog.Options) then
AOptions := AOptions or QColorDialogShowAlphaChannel;
if (cdNoButtons in ColorDialog.Options) then
AOptions := AOptions or QColorDialogNoButtons;
if (cdDontUseNativeDialog in ColorDialog.Options) then
AOptions := AOptions or QColorDialogDontUseNativeDialog;
QColorDialog_getColor(PQColor(@AQColorRet), PQColor(@AQColor), TQtWSCommonDialog.GetDialogParent(ACommonDialog), @ATitle, AOptions);
ReturnBool := AQColorRet.ColorSpec <> 0;