mirror of
https://github.com/Quill-OS/quill.git
synced 2024-12-26 23:57:22 -08:00
Added new font and set icons to frontlight controls
This commit is contained in:
parent
d07080ec84
commit
640991db98
4 changed files with 38 additions and 6 deletions
6
eink.qrc
6
eink.qrc
|
@ -31,5 +31,11 @@
|
|||
<file>resources/alert.png</file>
|
||||
<file>resources/eink_dark.qss</file>
|
||||
<file>resources/frontlight.png</file>
|
||||
<file>resources/fonts/CrimsonPro-Bold.ttf</file>
|
||||
<file>resources/fonts/CrimsonPro-Italic.ttf</file>
|
||||
<file>resources/fonts/CrimsonPro-Regular.ttf</file>
|
||||
<file>resources/check.png</file>
|
||||
<file>resources/minus.png</file>
|
||||
<file>resources/plus.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
|
27
reader.cpp
27
reader.cpp
|
@ -54,7 +54,10 @@ reader::reader(QWidget *parent) :
|
|||
ui->previousDefinitionBtn->setIcon(QIcon(":/resources/chevron-left.png"));
|
||||
ui->nextDefinitionBtn->setText("");
|
||||
ui->nextDefinitionBtn->setIcon(QIcon(":/resources/chevron-right.png"));
|
||||
|
||||
ui->brightnessDecBtn->setText("");
|
||||
ui->brightnessDecBtn->setIcon(QIcon(":/resources/minus.png"));
|
||||
ui->brightnessIncBtn->setText("");
|
||||
ui->brightnessIncBtn->setIcon(QIcon(":/resources/plus.png"));
|
||||
|
||||
// Making text selectable
|
||||
ui->text->setTextInteractionFlags(Qt::TextSelectableByMouse);
|
||||
|
@ -66,9 +69,18 @@ reader::reader(QWidget *parent) :
|
|||
;
|
||||
}
|
||||
else {
|
||||
QFont config_font(checkconfig_str_val);
|
||||
ui->text->setFont(config_font);
|
||||
ui->fontChooser->setCurrentText(checkconfig_str_val);
|
||||
if(checkconfig_str_val == "Crimson Pro") {
|
||||
int id = QFontDatabase::addApplicationFont(":/resources/fonts/CrimsonPro-Regular.ttf");
|
||||
QString family = QFontDatabase::applicationFontFamilies(id).at(0);
|
||||
QFont crimson(family);
|
||||
ui->text->setFont(crimson);
|
||||
ui->fontChooser->setCurrentText(checkconfig_str_val);
|
||||
}
|
||||
else {
|
||||
QFont config_font(checkconfig_str_val);
|
||||
ui->text->setFont(config_font);
|
||||
ui->fontChooser->setCurrentText(checkconfig_str_val);
|
||||
}
|
||||
}
|
||||
|
||||
// Alignment
|
||||
|
@ -476,6 +488,13 @@ void reader::on_fontChooser_currentIndexChanged(const QString &arg1)
|
|||
ui->text->setFont(libertinus);
|
||||
string_writeconfig(".config/04-book/font", "Libertinus Serif");
|
||||
}
|
||||
if(arg1 == "Crimson Pro") {
|
||||
int id = QFontDatabase::addApplicationFont(":/resources/fonts/CrimsonPro-Regular.ttf");
|
||||
QString family = QFontDatabase::applicationFontFamilies(id).at(0);
|
||||
QFont crimson(family);
|
||||
ui->text->setFont(crimson);
|
||||
string_writeconfig(".config/04-book/font", "Crimson Pro");
|
||||
}
|
||||
}
|
||||
|
||||
void reader::on_alignLeftBtn_clicked()
|
||||
|
|
2
reader.h
2
reader.h
|
@ -12,6 +12,8 @@
|
|||
#include <fstream>
|
||||
#include <QMessageBox>
|
||||
#include <regex>
|
||||
#include <QFont>
|
||||
#include <QFontDatabase>
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
|
|
@ -196,14 +196,14 @@
|
|||
<item row="1" column="0">
|
||||
<widget class="QPushButton" name="brightnessDecBtn">
|
||||
<property name="text">
|
||||
<string>―</string>
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QPushButton" name="brightnessIncBtn">
|
||||
<property name="text">
|
||||
<string> + </string>
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -333,6 +333,11 @@
|
|||
<string>Inter</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Crimson Pro</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Source Serif Pro</string>
|
||||
|
|
Loading…
Reference in a new issue