From 3a2c90794d05cbbc3d3ae09f5d119daec67fdf72 Mon Sep 17 00:00:00 2001 From: Nicolas Mailloux Date: Mon, 21 Jun 2021 07:19:14 -0400 Subject: [PATCH] Replace some labels with icons --- eink.qrc | 1 + reader.cpp | 16 ++++++++++++---- reader.ui | 3 +++ resources/info.png | Bin 0 -> 3563 bytes 4 files changed, 16 insertions(+), 4 deletions(-) create mode 100644 resources/info.png diff --git a/eink.qrc b/eink.qrc index be6cef4..d279313 100644 --- a/eink.qrc +++ b/eink.qrc @@ -43,5 +43,6 @@ resources/settings-inverted.png resources/kobox-icon.png resources/X11.png + resources/info.png diff --git a/reader.cpp b/reader.cpp index f8619b8..56db373 100644 --- a/reader.cpp +++ b/reader.cpp @@ -29,7 +29,6 @@ reader::reader(QWidget *parent) : if(global::reader::bookIsEpub == true) { is_epub = true; } - mupdf::epubPageNumber = 22; wordwidgetLock = false; ui->setupUi(this); @@ -72,6 +71,10 @@ reader::reader(QWidget *parent) : ui->brightnessDecBtn->setIcon(QIcon(":/resources/minus.png")); ui->brightnessIncBtn->setText(""); ui->brightnessIncBtn->setIcon(QIcon(":/resources/plus.png")); + ui->homeBtn->setText(""); + ui->homeBtn->setIcon(QIcon(":/resources/home.png")); + ui->aboutBtn->setText(""); + ui->aboutBtn->setIcon(QIcon(":/resources/info.png")); // Style misc. ui->bookInfoLabel->setStyleSheet("font-style: italic"); @@ -88,7 +91,7 @@ reader::reader(QWidget *parent) : // Font string_checkconfig(".config/04-book/font"); if(checkconfig_str_val == "") { - ui->fontChooser->setCurrentText(checkconfig_str_val); + ui->fontChooser->setCurrentText("Source Serif Pro"); ui->text->setFont(QFont("Source Serif Pro")); } else { @@ -403,6 +406,13 @@ reader::reader(QWidget *parent) : QString infoLabelContent = bookCreator; infoLabelContent.append(" ― "); infoLabelContent.append(bookTitle); + int infoLabelLength = infoLabelContent.length(); + if(infoLabelLength <= 50) { + ui->bookInfoLabel->setWordWrap(false); + } + else { + ui->bookInfoLabel->setWordWrap(true); + } ui->bookInfoLabel->setText(infoLabelContent); } else { @@ -609,7 +619,6 @@ int reader::setup_book(QString book, int i, bool run_parser) { QTextStream in(&epubPage); epubPageContent = in.readAll(); epubPage.close(); - qDebug() << epubPageContent; } return 0; } @@ -706,7 +715,6 @@ void reader::on_nextBtn_clicked() } else { mupdf::epubPageNumber = mupdf::epubPageNumber + 1; - qDebug() << mupdf::epubPageNumber; setup_book(book_file, mupdf::epubPageNumber, true); ui->text->setText(""); ui->text->setText(epubPageContent); diff --git a/reader.ui b/reader.ui index 9c696ff..e04b548 100644 --- a/reader.ui +++ b/reader.ui @@ -391,6 +391,9 @@ Qt::AlignCenter + + false + diff --git a/resources/info.png b/resources/info.png new file mode 100644 index 0000000000000000000000000000000000000000..42a0774a036e3545a19ebd97103f98093b890a5b GIT binary patch literal 3563 zcma)8d011|5}%ueY)AqGq!LU(v;m?5MGJ+J2&jOlxD{~?il7B$v90g~a)Ag6$nvxW ziA!*Sx}XSF5!#x#QgPv{ZS_@@AXu@j5Rpox0p0|cXZyWB8a}>zXXf{t<;f$q6y*;@1F(OVUd|489-} zTw1yGtNjx#J`z7DuJ|C5XOr}UE59P(OPeL1x}WU}T>E|T!Fq4@aXLe4d(>jmjfM~E z*;zWqR+VbU{`{SWa|c_TE@yXSeBIbzznNk9ZB1pl!)o$KngM^mN?qHKlFdqaB__lNWW_Qh<~teHVDZ2D7wQ?&y%ti<5Rjo8B5rhg(ptV%&8 zn&wzS+jg?C@qVLb z(&>&Pk6CGHNdIR)4X@cswzPCJO|PX_bl)J-?4~s}?f~IbUSGGXCYMe7=1)!<2~j=% zRH2 zcCdhIhQclH#VDk2r_xcl>mAI@&Sfd=Jyaj584bA!pApP8VXN@jLa5;)!>h+qt5ZHPg-uWtZg}l~Qu|Ne`w1B3Ccq8Nu^PjL1lI7H*drs7+&4 zm{_rNDj*?S;*SK2$P^?+bnA*f~LOOR}ByBNu0$#Env zSiBg?M{B-B@`^}ImAqD4hSAQhakNB2vy&4NO6mNeFF=+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