mirror of https://gitlab.com/basile.b/dexed.git
messages, force auto scrolling to bottom when a category is changed
This commit is contained in:
parent
87c2d4a5ff
commit
a142f2f881
|
@ -1,3 +1,9 @@
|
||||||
|
# v3.9.4-dev
|
||||||
|
|
||||||
|
## Bugs fixed
|
||||||
|
|
||||||
|
- Messages: force auto scrolling to bottom once and if the messages context is modified.
|
||||||
|
|
||||||
# v3.9.3
|
# v3.9.3
|
||||||
|
|
||||||
## Enhancements
|
## Enhancements
|
||||||
|
|
|
@ -115,6 +115,7 @@ type
|
||||||
fBtns: array[TAppMessageCtxt] of TToolButton;
|
fBtns: array[TAppMessageCtxt] of TToolButton;
|
||||||
fFiltering: boolean;
|
fFiltering: boolean;
|
||||||
fMustScrollToBack: boolean;
|
fMustScrollToBack: boolean;
|
||||||
|
fJustChangedContext: boolean;
|
||||||
function itemShouldBeVisible(item: TTreeNode; aCtxt: TAppMessageCtxt): boolean;
|
function itemShouldBeVisible(item: TTreeNode; aCtxt: TAppMessageCtxt): boolean;
|
||||||
procedure filterMessages(aCtxt: TAppMessageCtxt);
|
procedure filterMessages(aCtxt: TAppMessageCtxt);
|
||||||
procedure clearOutOfRangeMessg;
|
procedure clearOutOfRangeMessg;
|
||||||
|
@ -535,10 +536,12 @@ procedure TMessagesWidget.selCtxtClick(Sender: TObject);
|
||||||
var
|
var
|
||||||
btn: TToolButton;
|
btn: TToolButton;
|
||||||
i: Integer;
|
i: Integer;
|
||||||
|
o: TAppMessageCtxt;
|
||||||
begin
|
begin
|
||||||
if sender.isNil then
|
if sender.isNil then
|
||||||
exit;
|
exit;
|
||||||
//
|
//
|
||||||
|
o := fCtxt;
|
||||||
fCtxt := amcAll;
|
fCtxt := amcAll;
|
||||||
btn := TToolButton(Sender);
|
btn := TToolButton(Sender);
|
||||||
for i := 0 to toolbar.ButtonCount-1 do
|
for i := 0 to toolbar.ButtonCount-1 do
|
||||||
|
@ -553,6 +556,8 @@ begin
|
||||||
fCtxt := amcApp
|
fCtxt := amcApp
|
||||||
else if btn = btnSelMisc then
|
else if btn = btnSelMisc then
|
||||||
fCtxt := amcMisc;
|
fCtxt := amcMisc;
|
||||||
|
if o <> fCtxt then
|
||||||
|
fJustChangedContext := true;
|
||||||
filterMessages(fCtxt);
|
filterMessages(fCtxt);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -1077,8 +1082,16 @@ procedure TMessagesWidget.checkIfMustScrollToBack();
|
||||||
var
|
var
|
||||||
i: TTreeNode;
|
i: TTreeNode;
|
||||||
begin
|
begin
|
||||||
i := List.BottomItem;
|
if fJustChangedContext then
|
||||||
fMustScrollToBack := i.isNotNil and i.IsVisible;
|
begin
|
||||||
|
fMustScrollToBack := true;
|
||||||
|
fJustChangedContext := false;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
i := List.BottomItem;
|
||||||
|
fMustScrollToBack := i.isNotNil and i.IsVisible;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TMessagesWidget.scrollToBack;
|
procedure TMessagesWidget.scrollToBack;
|
||||||
|
|
Loading…
Reference in New Issue