Skip to content

Commit

Permalink
Styles for headers
Browse files Browse the repository at this point in the history
Added new styles for headers
  • Loading branch information
juuz0 committed Jun 22, 2023
1 parent 76b5370 commit 9fed218
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 0 deletions.
46 changes: 46 additions & 0 deletions resources/css/_contentManager.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
QTreeView::branch:open:has-children {
image: url(:/icons/caret-down-solid.svg);
margin: 7px;
}

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

QTreeView::item:has-children {
border-bottom: 1px solid #b7bec9;
}

QTreeView {
font-family: 'Selawik';
padding: 4px;
}

QHeaderView::section {
color: grey;
background-color: #fff;
border-width: 0px 0px 2px 0px;

Check warning on line 23 in resources/css/_contentManager.css

View check run for this annotation

codefactor.io / CodeFactor

resources/css/_contentManager.css#L23

Expected "0px 0px 2px 0px" to be "0px 0px 2px" (shorthand-property-no-redundant-values)
border-color: black;
border-style: plain;
font-size: 16px;
font-family: 'Selawik';
padding: 4px;
}

QHeaderView::section:checked
{
color: black;
font-weight: bold;
background-color: #5589E8;
}

QHeaderView::down-arrow {
image: url(:/icons/caret-down-solid.svg);
margin: 5px;
}

QHeaderView::up-arrow {
image: url(:/icons/caret-up-solid.svg);
margin: 5px;
}
1 change: 1 addition & 0 deletions resources/icons/caret-down-solid.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions resources/icons/caret-right-solid.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions resources/icons/caret-up-solid.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions resources/kiwix.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,8 @@
<file>icons/library-icon.svg</file>
<file>icons/open-file.svg</file>
<file>js/tools.js</file>
<file>icons/caret-down-solid.svg</file>
<file>icons/caret-right-solid.svg</file>
<file>icons/caret-up-solid.svg</file>
</qresource>
</RCC>
3 changes: 3 additions & 0 deletions src/contentmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ ContentManager::ContentManager(Library* library, kiwix::Downloader* downloader,
header->setSectionsClickable(true);
header->setHighlightSections(true);
mp_view->setWordWrap(true);
mp_view->resizeColumnToContents(4);
mp_view->setColumnWidth(0, 80);
// TODO: set width for all columns based on viewport

setCurrentLanguage(QLocale().name().split("_").at(0));
connect(mp_library, &Library::booksChanged, this, [=]() {emit(this->booksChanged());});
Expand Down

0 comments on commit 9fed218

Please sign in to comment.