jvcllaz: Improved cross-platform layout of TimeLineDemo. Fix some issues in TJvTimeLine.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6959 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2019-05-27 16:34:26 +00:00
parent 7e09fbeea1
commit 1208e21319
4 changed files with 259 additions and 146 deletions

View File

@ -420,8 +420,10 @@ type
published
property Align;
property AutoSize;
property BorderSpacing;
property BorderStyle;
property Color;
property Constraints;
property Cursor;
property DragCursor;
property DragLine;
@ -493,6 +495,7 @@ implementation
{$R ..\..\resource\jvtimeline.res}
uses
InterfaceBase, LCLPlatformDef,
Math, Types, DateUtils, Themes,
JvJCLUtils, JvJVCLUtils;
@ -831,13 +834,16 @@ const
var
Button: TThemedScrollBar;
Details: TThemedElementDetails;
useThemedBtn: Boolean;
begin
if TimeLine = nil then
Exit;
if not Visible then
Exit;
if ThemeServices.ThemesEnabled then
useThemedBtn := ThemeServices.ThemesEnabled and not (WidgetSet.LCLPlatform in [lpQT, lpGTK2]);
if useThemedBtn then
begin
if FPushed then
Button := tsArrowBtnLeftPressed
@ -1155,7 +1161,8 @@ begin
else
FArrows[I].UpdatePlacement;
end;
FItemHeight := Canvas.TextHeight('Tg') + ITEM_MARGIN;
if FItemHeight = 0 then
FItemHeight := Canvas.TextHeight('Tg') + ITEM_MARGIN;
end;
procedure TJvCustomTimeLine.UpdateOffset;
@ -2033,8 +2040,7 @@ begin
ACanvas.Pen.Color := Item.TextColor;
if (Length(Item.Caption) > 0) then
begin
R.Bottom := Min(R.Top + ACanvas.TextHeight(Item.Caption), R.Bottom);
R.Bottom := R.Top + ACanvas.TextHeight(Item.Caption) + 2;
ACanvas.Rectangle(R);
R.Left := R.Left + 2;
SetBkMode(ACanvas.Handle, TRANSPARENT);