mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-22 16:19:36 +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
|
||||
Widget := gtk_hscale_new(Adjustment)
|
||||
else
|
||||
begin
|
||||
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);
|
||||
end;
|
||||
@ -307,9 +311,22 @@ var
|
||||
begin
|
||||
if not WSCheckHandleAllocated(ATrackBar, 'ApplyChanges') then
|
||||
Exit;
|
||||
|
||||
with ATrackBar do
|
||||
begin
|
||||
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)));
|
||||
// min >= max causes crash
|
||||
Adjustment^.lower := Min;
|
||||
|
Loading…
Reference in New Issue
Block a user