mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-02 10:52:34 +02:00
(Qt)
- 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:
parent
f4679373e8
commit
2b58d03bb8
@ -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;
|
||||
|
@ -38,6 +38,7 @@ end;
|
||||
------------------------------------------------------------------------------}
|
||||
destructor TQtWidgetSet.Destroy;
|
||||
begin
|
||||
DestroyGlobalCaret;
|
||||
|
||||
QtWidgetSet := nil;
|
||||
|
||||
|
@ -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 =
|
||||
|
@ -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;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user