diff --git a/ui/qt/packet_list.cpp b/ui/qt/packet_list.cpp index 60c8767b07..2a81d446c5 100644 --- a/ui/qt/packet_list.cpp +++ b/ui/qt/packet_list.cpp @@ -1188,6 +1188,8 @@ void PacketList::goNextPacket(void) // First visible packet. setCurrentIndex(indexAt(viewport()->rect().topLeft())); } + + scrollViewChanged(false); } void PacketList::goPreviousPacket(void) @@ -1209,18 +1211,24 @@ void PacketList::goPreviousPacket(void) goLastPacket(); } } + + scrollViewChanged(false); } void PacketList::goFirstPacket(void) { if (packet_list_model_->rowCount() < 1) return; setCurrentIndex(packet_list_model_->index(0, 0)); scrollTo(currentIndex()); + + scrollViewChanged(false); } void PacketList::goLastPacket(void) { if (packet_list_model_->rowCount() < 1) return; setCurrentIndex(packet_list_model_->index(packet_list_model_->rowCount() - 1, 0)); scrollTo(currentIndex()); + + scrollViewChanged(false); } // XXX We can jump to the wrong packet if a display filter is applied @@ -1230,6 +1238,8 @@ void PacketList::goToPacket(int packet) { if (row >= 0) { setCurrentIndex(packet_list_model_->index(row, 0)); } + + scrollViewChanged(false); } void PacketList::goToPacket(int packet, int hf_id) @@ -1599,8 +1609,13 @@ void PacketList::vScrollBarActionTriggered(int) // past the end. tail_at_end_ = (verticalScrollBar()->sliderPosition() >= verticalScrollBar()->maximum()); + scrollViewChanged(tail_at_end_); +} + +void PacketList::scrollViewChanged(bool at_end) +{ if (capture_in_progress_ && prefs.capture_auto_scroll) { - emit packetListScrolled(tail_at_end_); + emit packetListScrolled(at_end); } } diff --git a/ui/qt/packet_list.h b/ui/qt/packet_list.h index 280986efa5..6d416d33bd 100644 --- a/ui/qt/packet_list.h +++ b/ui/qt/packet_list.h @@ -146,6 +146,7 @@ private: void initHeaderContextMenu(); void drawCurrentPacket(); void applyRecentColumnWidths(); + void scrollViewChanged(bool at_end); signals: void packetDissectionChanged();