diff --git a/lcl/interfaces/qt/qtdefines.inc b/lcl/interfaces/qt/qtdefines.inc index 50c7b7ec6e..1a168b264f 100644 --- a/lcl/interfaces/qt/qtdefines.inc +++ b/lcl/interfaces/qt/qtdefines.inc @@ -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} diff --git a/lcl/interfaces/qt/qtobject.inc b/lcl/interfaces/qt/qtobject.inc index 5125884378..11ed92c7a7 100644 --- a/lcl/interfaces/qt/qtobject.inc +++ b/lcl/interfaces/qt/qtobject.inc @@ -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; diff --git a/lcl/interfaces/qt/qtwidgets.pas b/lcl/interfaces/qt/qtwidgets.pas index ccbd467cb2..877697eb2f 100644 --- a/lcl/interfaces/qt/qtwidgets.pas +++ b/lcl/interfaces/qt/qtwidgets.pas @@ -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); diff --git a/lcl/interfaces/qt/qtwscontrols.pp b/lcl/interfaces/qt/qtwscontrols.pp index d8337cbe1d..1054e8db44 100644 --- a/lcl/interfaces/qt/qtwscontrols.pp +++ b/lcl/interfaces/qt/qtwscontrols.pp @@ -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} diff --git a/lcl/interfaces/qt/qtwsforms.pp b/lcl/interfaces/qt/qtwsforms.pp index 97544ef079..7f22131d47 100644 --- a/lcl/interfaces/qt/qtwsforms.pp +++ b/lcl/interfaces/qt/qtwsforms.pp @@ -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