Skip to content

Commit 5edd884

Browse files
committed
🚧 conf-window: explicitly highlight options on hover
fixes #69
1 parent 9fd9d46 commit 5edd884

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

‎src/conf-options-page.hpp‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,18 @@ class ConfOptionsPage final : public QWidget {
5454
Q_DISABLE_COPY_MOVE(ConfOptionsPage)
5555
public:
5656
explicit ConfOptionsPage(QWidget* parent = nullptr)
57-
: QWidget(parent) { m_ui->setupUi(this); }
57+
: QWidget(parent) {
58+
m_ui->setupUi(this);
59+
60+
// Enable row hover highlighting for easier navigation
61+
// NOTE: https://github.com/CachyOS/kernel-manager/issues/69
62+
const auto children = m_ui->scroll_area_widgets->findChildren<QWidget*>(QString(), Qt::FindDirectChildrenOnly);
63+
for (auto* child : children) {
64+
child->setAttribute(Qt::WA_StyledBackground, true);
65+
}
66+
m_ui->scroll_area_widgets->setStyleSheet(
67+
QStringLiteral("#scroll_area_widgets > QWidget:hover { background-color: palette(midlight); border-radius: 4px; }"));
68+
}
5869
~ConfOptionsPage() = default;
5970

6071
Ui::ConfOptionsPage* get_ui_obj() noexcept { return m_ui.get(); }

0 commit comments

Comments
 (0)