mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-16 18:49:19 +02:00
Gtk2: fixed vertical TTrackBar behaviour, start value should be at bottom not at top. fixes #17703
git-svn-id: trunk@27846 -
This commit is contained in:
parent
867da8c06b
commit
e00ff67049
@ -279,7 +279,11 @@ begin
|
|||||||
if (Orientation = trHorizontal) then
|
if (Orientation = trHorizontal) then
|
||||||
Widget := gtk_hscale_new(Adjustment)
|
Widget := gtk_hscale_new(Adjustment)
|
||||||
else
|
else
|
||||||
|
begin
|
||||||
Widget := gtk_vscale_new(Adjustment);
|
Widget := gtk_vscale_new(Adjustment);
|
||||||
|
if not gtk_range_get_inverted(PGtkRange(Widget)) then
|
||||||
|
gtk_range_set_inverted(PGtkRange(Widget), True);
|
||||||
|
end;
|
||||||
|
|
||||||
gtk_scale_set_digits(PGtkScale(Widget), 0);
|
gtk_scale_set_digits(PGtkScale(Widget), 0);
|
||||||
end;
|
end;
|
||||||
@ -307,9 +311,22 @@ var
|
|||||||
begin
|
begin
|
||||||
if not WSCheckHandleAllocated(ATrackBar, 'ApplyChanges') then
|
if not WSCheckHandleAllocated(ATrackBar, 'ApplyChanges') then
|
||||||
Exit;
|
Exit;
|
||||||
|
|
||||||
with ATrackBar do
|
with ATrackBar do
|
||||||
begin
|
begin
|
||||||
wHandle := Handle;
|
wHandle := Handle;
|
||||||
|
|
||||||
|
if Orientation = trHorizontal then
|
||||||
|
begin
|
||||||
|
if gtk_range_get_inverted(PGtkRange(wHandle)) then
|
||||||
|
gtk_range_set_inverted(PGtkRange(wHandle), False);
|
||||||
|
end else
|
||||||
|
begin
|
||||||
|
if not gtk_range_get_inverted(PGtkRange(wHandle)) then
|
||||||
|
gtk_range_set_inverted(PGtkRange(wHandle), False);
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
Adjustment := gtk_range_get_adjustment(GTK_RANGE(Pointer(wHandle)));
|
Adjustment := gtk_range_get_adjustment(GTK_RANGE(Pointer(wHandle)));
|
||||||
// min >= max causes crash
|
// min >= max causes crash
|
||||||
Adjustment^.lower := Min;
|
Adjustment^.lower := Min;
|
||||||
|
Loading…
Reference in New Issue
Block a user