mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-16 09:59:23 +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
|
begin
|
||||||
opt := QStyleOptionFrame_create();
|
opt := QStyleOptionFrame_create();
|
||||||
end;
|
end;
|
||||||
|
QStylePE_FrameLineEdit:
|
||||||
|
begin
|
||||||
|
opt := QStyleOptionFrame_create();
|
||||||
|
end;
|
||||||
QStylePE_IndicatorBranch:
|
QStylePE_IndicatorBranch:
|
||||||
begin
|
begin
|
||||||
|
|
||||||
@ -622,6 +626,9 @@ begin
|
|||||||
Context.save;
|
Context.save;
|
||||||
try
|
try
|
||||||
Context.SetBkMode(TRANSPARENT);
|
Context.SetBkMode(TRANSPARENT);
|
||||||
|
if Details.State = TREIS_DISABLED then
|
||||||
|
QPalette_setCurrentColorGroup(Palette, QPaletteDisabled)
|
||||||
|
else
|
||||||
if Details.State = TREIS_SELECTEDNOTFOCUS then
|
if Details.State = TREIS_SELECTEDNOTFOCUS then
|
||||||
QPalette_setCurrentColorGroup(Palette, QPaletteInactive)
|
QPalette_setCurrentColorGroup(Palette, QPaletteInactive)
|
||||||
else
|
else
|
||||||
@ -698,6 +705,12 @@ begin
|
|||||||
OffsetRect(R, -R.Left, -R.Top);
|
OffsetRect(R, -R.Left, -R.Top);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
if (Details.Element = teEdit) then
|
||||||
|
begin
|
||||||
|
if IsDisabled(Details) then
|
||||||
|
QPalette_setCurrentColorGroup(Palette, QPaletteDisabled);
|
||||||
|
end;
|
||||||
|
|
||||||
QStyle_drawItemText(Style, Context.Widget, @R,
|
QStyle_drawItemText(Style, Context.Widget, @R,
|
||||||
DTFlagsToQtFlags(Flags), Palette,
|
DTFlagsToQtFlags(Flags), Palette,
|
||||||
not IsDisabled(Details), @W, ATextPalette);
|
not IsDisabled(Details), @W, ATextPalette);
|
||||||
@ -831,6 +844,20 @@ begin
|
|||||||
Result := Result or QStyleState_Active or QStyleState_HasFocus or QStyleState_MouseOver;
|
Result := Result or QStyleState_Active or QStyleState_HasFocus or QStyleState_MouseOver;
|
||||||
end;
|
end;
|
||||||
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
|
if (Details.Element = teWindow) then
|
||||||
begin
|
begin
|
||||||
if Details.Part in [WP_SMALLCAPTION,
|
if Details.Part in [WP_SMALLCAPTION,
|
||||||
@ -1090,6 +1117,12 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
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:
|
teSpin:
|
||||||
begin
|
begin
|
||||||
Result.DrawVariant := qdvComplexControl;
|
Result.DrawVariant := qdvComplexControl;
|
||||||
|
Loading…
Reference in New Issue
Block a user