Replace some labels with icons

This commit is contained in:
Nicolas Mailloux 2021-06-21 07:19:14 -04:00
parent 351a375dfc
commit 3a2c90794d
4 changed files with 16 additions and 4 deletions

View file

@ -43,5 +43,6 @@
<file>resources/settings-inverted.png</file> <file>resources/settings-inverted.png</file>
<file>resources/kobox-icon.png</file> <file>resources/kobox-icon.png</file>
<file>resources/X11.png</file> <file>resources/X11.png</file>
<file>resources/info.png</file>
</qresource> </qresource>
</RCC> </RCC>

View file

@ -29,7 +29,6 @@ reader::reader(QWidget *parent) :
if(global::reader::bookIsEpub == true) { if(global::reader::bookIsEpub == true) {
is_epub = true; is_epub = true;
} }
mupdf::epubPageNumber = 22;
wordwidgetLock = false; wordwidgetLock = false;
ui->setupUi(this); ui->setupUi(this);
@ -72,6 +71,10 @@ reader::reader(QWidget *parent) :
ui->brightnessDecBtn->setIcon(QIcon(":/resources/minus.png")); ui->brightnessDecBtn->setIcon(QIcon(":/resources/minus.png"));
ui->brightnessIncBtn->setText(""); ui->brightnessIncBtn->setText("");
ui->brightnessIncBtn->setIcon(QIcon(":/resources/plus.png")); 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. // Style misc.
ui->bookInfoLabel->setStyleSheet("font-style: italic"); ui->bookInfoLabel->setStyleSheet("font-style: italic");
@ -88,7 +91,7 @@ reader::reader(QWidget *parent) :
// Font // Font
string_checkconfig(".config/04-book/font"); string_checkconfig(".config/04-book/font");
if(checkconfig_str_val == "") { if(checkconfig_str_val == "") {
ui->fontChooser->setCurrentText(checkconfig_str_val); ui->fontChooser->setCurrentText("Source Serif Pro");
ui->text->setFont(QFont("Source Serif Pro")); ui->text->setFont(QFont("Source Serif Pro"));
} }
else { else {
@ -403,6 +406,13 @@ reader::reader(QWidget *parent) :
QString infoLabelContent = bookCreator; QString infoLabelContent = bookCreator;
infoLabelContent.append(""); infoLabelContent.append("");
infoLabelContent.append(bookTitle); infoLabelContent.append(bookTitle);
int infoLabelLength = infoLabelContent.length();
if(infoLabelLength <= 50) {
ui->bookInfoLabel->setWordWrap(false);
}
else {
ui->bookInfoLabel->setWordWrap(true);
}
ui->bookInfoLabel->setText(infoLabelContent); ui->bookInfoLabel->setText(infoLabelContent);
} }
else { else {
@ -609,7 +619,6 @@ int reader::setup_book(QString book, int i, bool run_parser) {
QTextStream in(&epubPage); QTextStream in(&epubPage);
epubPageContent = in.readAll(); epubPageContent = in.readAll();
epubPage.close(); epubPage.close();
qDebug() << epubPageContent;
} }
return 0; return 0;
} }
@ -706,7 +715,6 @@ void reader::on_nextBtn_clicked()
} }
else { else {
mupdf::epubPageNumber = mupdf::epubPageNumber + 1; mupdf::epubPageNumber = mupdf::epubPageNumber + 1;
qDebug() << mupdf::epubPageNumber;
setup_book(book_file, mupdf::epubPageNumber, true); setup_book(book_file, mupdf::epubPageNumber, true);
ui->text->setText(""); ui->text->setText("");
ui->text->setText(epubPageContent); ui->text->setText(epubPageContent);

View file

@ -391,6 +391,9 @@
<property name="alignment"> <property name="alignment">
<set>Qt::AlignCenter</set> <set>Qt::AlignCenter</set>
</property> </property>
<property name="wordWrap">
<bool>false</bool>
</property>
</widget> </widget>
</item> </item>
</layout> </layout>

BIN
resources/info.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB