diff --git a/resources/css/_contentManager.css b/resources/css/_contentManager.css index 9d801b5c0..608fb8ecc 100644 --- a/resources/css/_contentManager.css +++ b/resources/css/_contentManager.css @@ -1,11 +1,11 @@ QTreeView::branch:open:has-children { image: url(:/icons/caret-down-solid.svg); - margin: 7px; + padding: 6px; } QTreeView::branch:closed:has-children { image: url(:/icons/caret-right-solid.svg); - margin: 7px; + padding: 7px; } QTreeView::item:has-children { @@ -18,6 +18,10 @@ QTreeView { border: none; } +QTreeView::item:hover { + background-color: #eaecf0; +} + QHeaderView::section { color: #666666; background-color: #fff; @@ -38,12 +42,12 @@ QHeaderView::section:checked QHeaderView::down-arrow { image: url(:/icons/caret-down-solid.svg); - margin: 5px; + padding: 5px; } QHeaderView::up-arrow { image: url(:/icons/caret-up-solid.svg); - margin: 5px; + padding: 5px; } QMenu { diff --git a/src/contentmanagerdelegate.cpp b/src/contentmanagerdelegate.cpp index b6d84f1ad..01eeade2d 100644 --- a/src/contentmanagerdelegate.cpp +++ b/src/contentmanagerdelegate.cpp @@ -165,7 +165,10 @@ void ContentManagerDelegate::paint(QPainter *painter, const QStyleOptionViewItem QStyleOptionViewItem eOpt = option; if (index.data(Qt::UserRole+1) != QVariant()) { // additional info role - QStyledItemDelegate::paint(painter, option, index); + QRect nRect = r; + auto viewWidth = KiwixApp::instance()->getContentManager()->getView()->getView()->width(); + nRect.setWidth(viewWidth); + painter->drawText(nRect, Qt::AlignLeft | Qt::AlignVCenter, index.data(Qt::UserRole+1).toString()); return; } if (index.column() == 5) { diff --git a/src/contentmanagerview.cpp b/src/contentmanagerview.cpp index 796ca9e83..f040d4a55 100644 --- a/src/contentmanagerview.cpp +++ b/src/contentmanagerview.cpp @@ -14,6 +14,7 @@ ContentManagerView::ContentManagerView(QWidget *parent) QString styleSheet = QString(file.readAll()); mp_ui->m_view->setStyleSheet(styleSheet); mp_ui->m_view->setContextMenuPolicy(Qt::CustomContextMenu); + mp_ui->m_view->setCursor(Qt::PointingHandCursor); auto searcher = mp_ui->searcher; searcher->setPlaceholderText(gt("search-files")); @@ -25,6 +26,17 @@ ContentManagerView::ContentManagerView(QWidget *parent) connect(searcher, &QLineEdit::textChanged, [searcher](){ KiwixApp::instance()->getContentManager()->setSearch(searcher->text()); }); + connect(mp_ui->m_view, &QTreeView::clicked, [=](QModelIndex index) { + if (index.column() == (mp_ui->m_view->model()->columnCount() - 1)) + return; + + auto zeroColIndex = index.siblingAtColumn(0); + if (mp_ui->m_view->isExpanded(zeroColIndex)) { + mp_ui->m_view->collapse(zeroColIndex); + } else { + mp_ui->m_view->expand(zeroColIndex); + } + }); } ContentManagerView::~ContentManagerView()