- better handling of BorderStyle property
- Destroy GlobalCaret in QtWidgetset destructor
- fix possible problems with splitter painting under linux

git-svn-id: trunk@11561 -
This commit is contained in:
paul 2007-07-18 00:54:42 +00:00
parent f4679373e8
commit 2b58d03bb8
5 changed files with 28 additions and 9 deletions

View File

@ -87,6 +87,7 @@ function SetCaretPos(X, Y: Integer): Boolean;
function GetCaretPos(var Pt: TPoint): Boolean;
function DestroyCaret: Boolean;
procedure DrawCaret;
procedure DestroyGlobalCaret;
implementation
@ -119,6 +120,12 @@ begin
end;
end;
procedure DestroyGlobalCaret;
begin
GlobalCaret.Free;
GlobalCaret := nil;
end;
function CreateCaret(Widget: TQtWidget; Pixmap: QPixmapH; Width, Height: Integer): Boolean;
begin
GlobalCaretNeeded;

View File

@ -38,6 +38,7 @@ end;
------------------------------------------------------------------------------}
destructor TQtWidgetSet.Destroy;
begin
DestroyGlobalCaret;
QtWidgetSet := nil;

View File

@ -46,6 +46,7 @@ type
procedure InternalDrawParentBackground(Window: HWND; Target: HDC; Bounds: PRect); override;
function GetControlState(Details: TThemedElementDetails): QStyleState;
function GetDetailSize(Details: TThemedElementDetails): Integer; override;
function GetDrawElement(Details: TThemedElementDetails): TQtDrawElement;
property Style: QStyleH read GetStyle;
public
@ -226,6 +227,17 @@ begin
Result := Result or QStyleState_Horizontal;
end;
function TQtThemeServices.GetDetailSize(Details: TThemedElementDetails): Integer;
begin
case Details.Element of
teRebar :
if Details.Part in [RP_GRIPPER, RP_GRIPPERVERT] then
Result := -1;
else
Result := inherited;
end;
end;
function TQtThemeServices.GetDrawElement(Details: TThemedElementDetails): TQtDrawElement;
const
ButtonMap: array[BP_PUSHBUTTON..BP_USERBUTTON] of QStyleControlElement =

View File

@ -5137,8 +5137,6 @@ begin
FViewPortWidget := NiL;
Parent := TQtWidget(LCLObject.Parent.Handle).GetContainerWidget;
Result := QAbstractScrollArea_create(Parent);
// remove default shape
QFrame_setFrameShape(QFrameH(Result), QFrameNoFrame);
end;
{------------------------------------------------------------------------------

View File

@ -121,6 +121,12 @@ type
implementation
const
TBorderStyleToQtFrameShapeMap: array[TBorderStyle] of QFrameShape =
(
{bsNone} QFrameNoFrame,
{bsSingle} QFrameStyledPanel
);
{------------------------------------------------------------------------------
Method: TQtWSCustomControl.CreateHandle
@ -137,10 +143,11 @@ begin
{$endif}
QtAbstractScrollArea := TQtAbstractScrollArea.Create(AWinControl, AParams);
QtAbstractScrollArea.setFrameShape(TBorderStyleToQtFrameShapeMap[TCustomControl(AWinControl).BorderStyle]);
QtAbstractScrollArea.AttachEvents;
QtAbstractScrollArea.viewportNeeded;
Result := THandle(QtAbstractScrollArea);
{$ifdef VerboseQt}
WriteLn('< TQtWSCustomControl.CreateHandle for ',dbgsname(AWinControl),' Result: ', dbgHex(Result));
{$endif}
@ -443,12 +450,6 @@ end;
class procedure TQtWSWinControl.SetBorderStyle(const AWinControl: TWinControl;
const ABorderStyle: TBorderStyle);
const
TBorderStyleToQtFrameShapeMap: array[TBorderStyle] of QFrameShape =
(
{bsNone} QFrameNoFrame,
{bsSingle} QFrameStyledPanel
);
var
Widget: TQtWidget;
begin