Skip to content

Commit

Permalink
final fix of RL
Browse files Browse the repository at this point in the history
  • Loading branch information
heropj committed Dec 1, 2024
1 parent b08ef5e commit 02957cf
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 40 deletions.
91 changes: 56 additions & 35 deletions resources/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -344,16 +344,14 @@ QTabBar::scroller {
}

#categorySelector QScrollBar,
#languageSelector QScrollBar,
#readinglistbar QScrollBar {
#languageSelector QScrollBar{
width: 5px;
border: none;
outline: none;
}

#categorySelector QScrollBar::handle,
#languageSelector QScrollBar::handle,
#readinglistbar QScrollBar {
#languageSelector QScrollBar::handle{
background-color: grey;
}

Expand All @@ -369,37 +367,6 @@ ContentTypeFilter {
spacing: 10;
}

#readinglistbar QLabel {
font-size: 24px;
font-weight: bold;
padding: 5px;
}

#readinglistbar QListWidget {
show-decoration-selected: 0;
border: none;
padding: 5px;
}

#readinglistbar QListWidget::item {
font-size: 16px;
margin-bottom: 10px;
}

#readinglistbar QPushButton {
margin-left: 4px;
}

#readinglistbar QPushButton::hover {
border: 1px solid #3366CC;
background-color: #D9E9FF;
border-radius: 3px;
}

#readinglistbar QPushButton::menu-indicator {
width: 0;
height: 0;
}

#tableofcontentbar {
background-color: white;
Expand Down Expand Up @@ -463,6 +430,60 @@ ContentTypeFilter {
background-color: grey;
}

#readinglistbar QPushButton::menu-indicator {
width: 0;
height: 0;
}

#readinglistbar QTreeWidget,
#readinglistbar QLabel,
#readinglistbar QFrame,
#readinglistbar QListWidget,
#readinglistbar QPushButton {
background-color: white;
}

#readinglistbar QPushButton{
margin: 13px 10px 10px;
}

#readinglistbar QListWidget {
outline: none;
}

#readinglistbar QListWidget::item,
#readinglistbar QListWidget::item:selected{
height: 26px;
padding: 0px 10px;
outline: none;
border-top: 1px solid transparent;
border-bottom: 1px solid transparent;
color: black;
}

#readinglistbar QListWidget::item:hover {
outline: none;
border-top: 1px solid #3366CC;
border-bottom: 1px solid #3366CC;
background-color: #D9E9FF;
color: black;
}

#readinglistbar #titleLabel {
padding: 0px;
margin: 10px;
}

#readinglistbar QScrollBar {
width: 5px;
border: none;
outline: none;
}

#readinglistbar QScrollBar::handle {
background-color: grey;
}

/* ----------------------------------------
Text to Speech Page
*/
Expand Down
1 change: 1 addition & 0 deletions src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ void MainWindow::tableOfContentToggled(bool state)
if (state) {
checkActionNoSignal(KiwixApp::ToggleReadingListAction, false);
mp_ui->sideBar->setCurrentWidget(mp_ui->tableofcontentbar);
mp_ui->sideBar->setStyleSheet("background-color: white;");
mp_ui->sideBar->show();
}
else {
Expand Down
11 changes: 10 additions & 1 deletion src/readinglistbar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@ ReadingListBar::ReadingListBar(QWidget *parent) :
ui(new Ui::readinglistbar)
{
ui->setupUi(this);

//to remove gap between RL components
if (layout()) {
layout()->setContentsMargins(0, 0, 0, 0);
layout()->setSpacing(0);
}

ui->titleLabel->setFont(QFont("Selawik", 18, QFont::Weight::Medium));
ui->titleLabel->setText(gt("reading-list"));

connect(KiwixApp::instance()->getLibrary(), &Library::bookmarksChanged,
this, &ReadingListBar::setupList);
connect(ui->listWidget, &QListWidget::itemClicked,
Expand All @@ -37,7 +47,6 @@ ReadingListBar::ReadingListBar(QWidget *parent) :
auto importAction = app->getAction(KiwixApp::ImportReadingListAction);
connect(exportAction, &QAction::triggered, this, &ReadingListBar::onExport);
connect(importAction, &QAction::triggered, this, &ReadingListBar::onImport);
ui->label->setText(gt("reading-list-title"));

QMenu *portMenu = new QMenu(this);
portMenu->addAction(exportAction);
Expand Down
15 changes: 11 additions & 4 deletions src/readinglistbar.ui
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label">
<widget class="QLabel" name="titleLabel">
<property name="font">
<font>
<pointsize>16</pointsize>
Expand Down Expand Up @@ -64,8 +64,8 @@
</property>
<property name="iconSize">
<size>
<width>30</width>
<height>30</height>
<width>25</width>
<height>25</height>
</size>
</property>
<property name="flat">
Expand All @@ -74,6 +74,13 @@
</widget>
</item>
</layout>
</item>
<item>
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<widget class="QListWidget" name="listWidget">
Expand All @@ -90,7 +97,7 @@
<enum>QAbstractScrollArea::AdjustToContents</enum>
</property>
<property name="textElideMode">
<enum>Qt::ElideNone</enum>
<enum>Qt::ElideRight</enum>
</property>
<property name="isWrapping" stdset="0">
<bool>false</bool>
Expand Down

0 comments on commit 02957cf

Please sign in to comment.