mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 02:29:21 +02:00
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:
parent
d3db3fcfbb
commit
b9d8f1fc2f
@ -1,4 +1,8 @@
|
|||||||
{******************************************************************************
|
{******************************************************************************
|
||||||
Centralized includefile for some common qt defines
|
Centralized includefile for some common qt defines
|
||||||
******************************************************************************}
|
******************************************************************************}
|
||||||
|
{$IFNDEF QTOPIA}
|
||||||
|
{$IF DEFINED(LINUX) or DEFINED(FREEBSD) or DEFINED(NETBSD)}
|
||||||
|
{$DEFINE HASX11}
|
||||||
|
{$ENDIF}
|
||||||
|
{$ENDIF}
|
||||||
|
@ -214,7 +214,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TQtWidgetSet.AppMinimize;
|
procedure TQtWidgetSet.AppMinimize;
|
||||||
{$IFDEF LINUX}
|
{$IFDEF HASX11}
|
||||||
var
|
var
|
||||||
i: Integer;
|
i: Integer;
|
||||||
AForm: TCustomForm;
|
AForm: TCustomForm;
|
||||||
@ -223,7 +223,7 @@ var
|
|||||||
begin
|
begin
|
||||||
if (Application.MainForm <> nil) and (Application.MainForm.HandleAllocated) then
|
if (Application.MainForm <> nil) and (Application.MainForm.HandleAllocated) then
|
||||||
begin
|
begin
|
||||||
{$IFDEF LINUX}
|
{$IFDEF HASX11}
|
||||||
for i := 0 to Screen.CustomFormZOrderCount-1 do
|
for i := 0 to Screen.CustomFormZOrderCount-1 do
|
||||||
begin
|
begin
|
||||||
AForm := Screen.CustomFormsZOrdered[i];
|
AForm := Screen.CustomFormsZOrdered[i];
|
||||||
@ -248,7 +248,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TQtWidgetSet.AppRestore;
|
procedure TQtWidgetSet.AppRestore;
|
||||||
{$IFDEF LINUX}
|
{$IFDEF HASX11}
|
||||||
var
|
var
|
||||||
i: Integer;
|
i: Integer;
|
||||||
AForm: TCustomForm;
|
AForm: TCustomForm;
|
||||||
@ -257,7 +257,7 @@ var
|
|||||||
begin
|
begin
|
||||||
if (Application.MainForm <> nil) and (Application.MainForm.HandleAllocated) then
|
if (Application.MainForm <> nil) and (Application.MainForm.HandleAllocated) then
|
||||||
begin
|
begin
|
||||||
{$IFDEF LINUX}
|
{$IFDEF HASX11}
|
||||||
if Screen = nil then exit;
|
if Screen = nil then exit;
|
||||||
for i := Screen.CustomFormZOrderCount-1 downto 0 do
|
for i := Screen.CustomFormZOrderCount-1 downto 0 do
|
||||||
begin
|
begin
|
||||||
@ -423,7 +423,7 @@ begin
|
|||||||
lcDragDockStartOnTitleClick: Result :=
|
lcDragDockStartOnTitleClick: Result :=
|
||||||
{$ifdef MSWINDOWS} LCL_CAPABILITY_YES {$else} LCL_CAPABILITY_NO {$endif};
|
{$ifdef MSWINDOWS} LCL_CAPABILITY_YES {$else} LCL_CAPABILITY_NO {$endif};
|
||||||
lcNeedMininimizeAppWithMainForm: Result :=
|
lcNeedMininimizeAppWithMainForm: Result :=
|
||||||
{$ifdef LINUX} LCL_CAPABILITY_YES {$else} LCL_CAPABILITY_NO {$endif};
|
{$ifdef HASX11} LCL_CAPABILITY_YES {$else} LCL_CAPABILITY_NO {$endif};
|
||||||
else
|
else
|
||||||
Result := inherited GetLCLCapability(ACapability);
|
Result := inherited GetLCLCapability(ACapability);
|
||||||
end;
|
end;
|
||||||
|
@ -4546,7 +4546,7 @@ begin
|
|||||||
QMdiSubWindowH(Widget))
|
QMdiSubWindowH(Widget))
|
||||||
else
|
else
|
||||||
inherited Activate;
|
inherited Activate;
|
||||||
{$IFDEF LINUX}
|
{$IFDEF HASX11}
|
||||||
// qt X11 bug ? activates window but it's not in
|
// qt X11 bug ? activates window but it's not in
|
||||||
// front of others.
|
// front of others.
|
||||||
{$note TQtWidget.Activate: Check this with next qt version (>=4.7)}
|
{$note TQtWidget.Activate: Check this with next qt version (>=4.7)}
|
||||||
@ -5015,13 +5015,11 @@ var
|
|||||||
TopMargin: Integer;
|
TopMargin: Integer;
|
||||||
RightMargin: Integer;
|
RightMargin: Integer;
|
||||||
BottomMargin: Integer;
|
BottomMargin: Integer;
|
||||||
{$IFDEF LINUX}
|
{$IFDEF HASX11}
|
||||||
{$IFNDEF QTOPIA}
|
|
||||||
Font: QFontH;
|
Font: QFontH;
|
||||||
FontMetrics: QFontMetricsH;
|
FontMetrics: QFontMetricsH;
|
||||||
FontHeight: Integer;
|
FontHeight: Integer;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
{$ENDIF}
|
|
||||||
begin
|
begin
|
||||||
if ALayout = nil then
|
if ALayout = nil then
|
||||||
exit;
|
exit;
|
||||||
@ -5031,9 +5029,7 @@ begin
|
|||||||
{if contentsMargins TopMargin is huge then we must rethink about TopMargin
|
{if contentsMargins TopMargin is huge then we must rethink about TopMargin
|
||||||
size (eg.oxygen theme have 32 top margin while plastique have 19
|
size (eg.oxygen theme have 32 top margin while plastique have 19
|
||||||
with same font height) }
|
with same font height) }
|
||||||
{$IFDEF LINUX}
|
{$IFDEF HASX11}
|
||||||
{$IFNDEF QTOPIA}
|
|
||||||
|
|
||||||
Font := QWidget_font(AWidget);
|
Font := QWidget_font(AWidget);
|
||||||
FontMetrics := QFontMetrics_create(Font);
|
FontMetrics := QFontMetrics_create(Font);
|
||||||
try
|
try
|
||||||
@ -5048,9 +5044,8 @@ begin
|
|||||||
TopMargin := TopMargin - BottomMargin - 3;
|
TopMargin := TopMargin - BottomMargin - 3;
|
||||||
BottomMargin := 0;
|
BottomMargin := 0;
|
||||||
end;
|
end;
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
{$ENDIF}
|
|
||||||
{$ENDIF}
|
|
||||||
QLayout_setContentsMargins(ALayout, LeftMargin, TopMargin, RightMargin, BottomMargin);
|
QLayout_setContentsMargins(ALayout, LeftMargin, TopMargin, RightMargin, BottomMargin);
|
||||||
QLayout_invalidate(ALayout);
|
QLayout_invalidate(ALayout);
|
||||||
|
|
||||||
|
@ -185,7 +185,7 @@ begin
|
|||||||
begin
|
begin
|
||||||
if fsModal in TForm(AWinControl).FormState then
|
if fsModal in TForm(AWinControl).FormState then
|
||||||
begin
|
begin
|
||||||
{$ifdef linux}
|
{$ifdef HASX11}
|
||||||
QWidget_setParent(Widget.Widget, QApplication_activeWindow());
|
QWidget_setParent(Widget.Widget, QApplication_activeWindow());
|
||||||
QWidget_setWindowFlags(Widget.Widget, QtDialog);
|
QWidget_setWindowFlags(Widget.Widget, QtDialog);
|
||||||
{$endif}
|
{$endif}
|
||||||
|
@ -171,7 +171,7 @@ begin
|
|||||||
(Application.MainForm <> AWinControl) then
|
(Application.MainForm <> AWinControl) then
|
||||||
begin
|
begin
|
||||||
if (TCustomForm(AWinControl).ShowInTaskBar in [stDefault, stNever])
|
if (TCustomForm(AWinControl).ShowInTaskBar in [stDefault, stNever])
|
||||||
{$ifdef linux}
|
{$ifdef HASX11}
|
||||||
{QtTool have not minimize button !}
|
{QtTool have not minimize button !}
|
||||||
and not (TCustomForm(AWinControl).BorderStyle in [bsSizeToolWin, bsToolWindow])
|
and not (TCustomForm(AWinControl).BorderStyle in [bsSizeToolWin, bsToolWindow])
|
||||||
{$endif} then
|
{$endif} then
|
||||||
|
Loading…
Reference in New Issue
Block a user