Skip to content

Commit

Permalink
gui: center on selected item when changing quick search
Browse files Browse the repository at this point in the history
Signed-off-by: Bartłomiej Burdukiewicz <[email protected]>
  • Loading branch information
dev-0x7C6 committed Jul 2, 2024
1 parent 0ab93f8 commit 8906efe
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main-window.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "main-window.hpp"
#include "fdt/fdt-parser-tokens.hpp"
#include "fdt/fdt-property-types.hpp"
#include "qabstractitemview.h"
#include "ui_main-window.h"

#include <QAction>
Expand Down Expand Up @@ -72,6 +73,9 @@ MainWindow::MainWindow(QWidget *parent)
});

update_view();

if (!m_ui->treeWidget->selectedItems().empty())
m_ui->treeWidget->scrollToItem(m_ui->treeWidget->selectedItems().first(), QAbstractItemView::PositionAtCenter);
});

connect(m_menu.get(), &menu_manager::quit, this, &MainWindow::close);
Expand Down

0 comments on commit 8906efe

Please sign in to comment.