mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-12 00:55:59 +02:00
Qt: implemented themed draw of teEdit
git-svn-id: trunk@62222 -
This commit is contained in:
parent
2cf4155cc7
commit
5973af4f9d
@ -440,6 +440,10 @@ begin
|
||||
begin
|
||||
opt := QStyleOptionFrame_create();
|
||||
end;
|
||||
QStylePE_FrameLineEdit:
|
||||
begin
|
||||
opt := QStyleOptionFrame_create();
|
||||
end;
|
||||
QStylePE_IndicatorBranch:
|
||||
begin
|
||||
|
||||
@ -622,6 +626,9 @@ begin
|
||||
Context.save;
|
||||
try
|
||||
Context.SetBkMode(TRANSPARENT);
|
||||
if Details.State = TREIS_DISABLED then
|
||||
QPalette_setCurrentColorGroup(Palette, QPaletteDisabled)
|
||||
else
|
||||
if Details.State = TREIS_SELECTEDNOTFOCUS then
|
||||
QPalette_setCurrentColorGroup(Palette, QPaletteInactive)
|
||||
else
|
||||
@ -698,6 +705,12 @@ begin
|
||||
OffsetRect(R, -R.Left, -R.Top);
|
||||
end;
|
||||
|
||||
if (Details.Element = teEdit) then
|
||||
begin
|
||||
if IsDisabled(Details) then
|
||||
QPalette_setCurrentColorGroup(Palette, QPaletteDisabled);
|
||||
end;
|
||||
|
||||
QStyle_drawItemText(Style, Context.Widget, @R,
|
||||
DTFlagsToQtFlags(Flags), Palette,
|
||||
not IsDisabled(Details), @W, ATextPalette);
|
||||
@ -831,6 +844,20 @@ begin
|
||||
Result := Result or QStyleState_Active or QStyleState_HasFocus or QStyleState_MouseOver;
|
||||
end;
|
||||
end;
|
||||
if (Details.Element = teEdit) and (Details.Part in [EP_EDITTEXT, EP_BACKGROUND, EP_BACKGROUNDWITHBORDER]) then
|
||||
begin
|
||||
if Details.State = ETS_FOCUSED then
|
||||
Result := Result or QStyleState_Active or QStyleState_Enabled or QStyleState_HasFocus;
|
||||
|
||||
if Details.State = ETS_HOT then
|
||||
Result := Result or QStyleState_MouseOver
|
||||
else
|
||||
if Details.State = ETS_READONLY then
|
||||
Result := Result or QStyleState_ReadOnly
|
||||
else
|
||||
if Details.State = ETS_SELECTED then
|
||||
Result := Result or QStyleState_Selected;
|
||||
end;
|
||||
if (Details.Element = teWindow) then
|
||||
begin
|
||||
if Details.Part in [WP_SMALLCAPTION,
|
||||
@ -1090,6 +1117,12 @@ begin
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
teEdit:
|
||||
begin
|
||||
Result.DrawVariant := qdvPrimitive;
|
||||
if Details.Part in [0, EP_EDITTEXT, EP_CARET, EP_BACKGROUND, EP_BACKGROUNDWITHBORDER] then
|
||||
Result.PrimitiveElement := QStylePE_FrameLineEdit;
|
||||
end;
|
||||
teSpin:
|
||||
begin
|
||||
Result.DrawVariant := qdvComplexControl;
|
||||
|
Loading…
Reference in New Issue
Block a user