Skip to content

Commit

Permalink
Minor improvements to view
Browse files Browse the repository at this point in the history
When an item is hovered, colour changes to grey.
Increase description box width
  • Loading branch information
juuz0 committed Jul 1, 2023
1 parent 98c9ab1 commit 85eee5d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
12 changes: 8 additions & 4 deletions resources/css/_contentManager.css
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
QTreeView::branch:open:has-children {
image: url(:/icons/caret-down-solid.svg);
margin: 7px;
padding: 7px;
}

QTreeView::branch:closed:has-children {
image: url(:/icons/caret-right-solid.svg);
margin: 7px;
padding: 7px;
}

QTreeView::item:has-children {
Expand All @@ -18,6 +18,10 @@ QTreeView {
border: none;
}

QTreeView::item:hover {
background-color: #eaecf0;
}

QHeaderView::section {
color: #666666;
background-color: #fff;
Expand All @@ -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 {
Expand Down
5 changes: 4 additions & 1 deletion src/contentmanagerdelegate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
1 change: 1 addition & 0 deletions src/contentmanagerview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
Expand Down

0 comments on commit 85eee5d

Please sign in to comment.