Qt: added internal HASX11 define.It is used internally in qtlcl instead of IFDEF LINUX since X11 can be on FreeBsd or NetBsd.

git-svn-id: trunk@25456 -
This commit is contained in:
zeljko 2010-05-16 10:50:38 +00:00
parent d3db3fcfbb
commit b9d8f1fc2f
5 changed files with 16 additions and 17 deletions

View File

@ -1,4 +1,8 @@
{******************************************************************************
Centralized includefile for some common qt defines
******************************************************************************}
{$IFNDEF QTOPIA}
{$IF DEFINED(LINUX) or DEFINED(FREEBSD) or DEFINED(NETBSD)}
{$DEFINE HASX11}
{$ENDIF}
{$ENDIF}

View File

@ -214,7 +214,7 @@ begin
end;
procedure TQtWidgetSet.AppMinimize;
{$IFDEF LINUX}
{$IFDEF HASX11}
var
i: Integer;
AForm: TCustomForm;
@ -223,7 +223,7 @@ var
begin
if (Application.MainForm <> nil) and (Application.MainForm.HandleAllocated) then
begin
{$IFDEF LINUX}
{$IFDEF HASX11}
for i := 0 to Screen.CustomFormZOrderCount-1 do
begin
AForm := Screen.CustomFormsZOrdered[i];
@ -248,7 +248,7 @@ begin
end;
procedure TQtWidgetSet.AppRestore;
{$IFDEF LINUX}
{$IFDEF HASX11}
var
i: Integer;
AForm: TCustomForm;
@ -257,7 +257,7 @@ var
begin
if (Application.MainForm <> nil) and (Application.MainForm.HandleAllocated) then
begin
{$IFDEF LINUX}
{$IFDEF HASX11}
if Screen = nil then exit;
for i := Screen.CustomFormZOrderCount-1 downto 0 do
begin
@ -423,7 +423,7 @@ begin
lcDragDockStartOnTitleClick: Result :=
{$ifdef MSWINDOWS} LCL_CAPABILITY_YES {$else} LCL_CAPABILITY_NO {$endif};
lcNeedMininimizeAppWithMainForm: Result :=
{$ifdef LINUX} LCL_CAPABILITY_YES {$else} LCL_CAPABILITY_NO {$endif};
{$ifdef HASX11} LCL_CAPABILITY_YES {$else} LCL_CAPABILITY_NO {$endif};
else
Result := inherited GetLCLCapability(ACapability);
end;

View File

@ -4546,7 +4546,7 @@ begin
QMdiSubWindowH(Widget))
else
inherited Activate;
{$IFDEF LINUX}
{$IFDEF HASX11}
// qt X11 bug ? activates window but it's not in
// front of others.
{$note TQtWidget.Activate: Check this with next qt version (>=4.7)}
@ -5015,13 +5015,11 @@ var
TopMargin: Integer;
RightMargin: Integer;
BottomMargin: Integer;
{$IFDEF LINUX}
{$IFNDEF QTOPIA}
{$IFDEF HASX11}
Font: QFontH;
FontMetrics: QFontMetricsH;
FontHeight: Integer;
{$ENDIF}
{$ENDIF}
begin
if ALayout = nil then
exit;
@ -5031,9 +5029,7 @@ begin
{if contentsMargins TopMargin is huge then we must rethink about TopMargin
size (eg.oxygen theme have 32 top margin while plastique have 19
with same font height) }
{$IFDEF LINUX}
{$IFNDEF QTOPIA}
{$IFDEF HASX11}
Font := QWidget_font(AWidget);
FontMetrics := QFontMetrics_create(Font);
try
@ -5048,9 +5044,8 @@ begin
TopMargin := TopMargin - BottomMargin - 3;
BottomMargin := 0;
end;
{$ENDIF}
{$ENDIF}
{$ENDIF}
QLayout_setContentsMargins(ALayout, LeftMargin, TopMargin, RightMargin, BottomMargin);
QLayout_invalidate(ALayout);

View File

@ -185,7 +185,7 @@ begin
begin
if fsModal in TForm(AWinControl).FormState then
begin
{$ifdef linux}
{$ifdef HASX11}
QWidget_setParent(Widget.Widget, QApplication_activeWindow());
QWidget_setWindowFlags(Widget.Widget, QtDialog);
{$endif}

View File

@ -171,7 +171,7 @@ begin
(Application.MainForm <> AWinControl) then
begin
if (TCustomForm(AWinControl).ShowInTaskBar in [stDefault, stNever])
{$ifdef linux}
{$ifdef HASX11}
{QtTool have not minimize button !}
and not (TCustomForm(AWinControl).BorderStyle in [bsSizeToolWin, bsToolWindow])
{$endif} then