@@ -110,24 +110,51 @@ reader::reader(QWidget *parent) :
110110 ui->text ->setFont (crimson);
111111 ui->fontChooser ->setCurrentText (checkconfig_str_val);
112112 }
113+ else if (checkconfig_str_val == " Bitter" ) {
114+ QString family;
115+ {
116+ int id = QFontDatabase::addApplicationFont (" :/resources/fonts/Bitter-Medium.ttf" );
117+ family = QFontDatabase::applicationFontFamilies (id).at (0 );
118+ }
119+ {
120+ int id = QFontDatabase::addApplicationFont (" :/resources/fonts/Bitter-MediumItalic.ttf" );
121+ family = QFontDatabase::applicationFontFamilies (id).at (0 );
122+ }
123+ {
124+ int id = QFontDatabase::addApplicationFont (" :/resources/fonts/Bitter-Bold.ttf" );
125+ family = QFontDatabase::applicationFontFamilies (id).at (0 );
126+ }
127+ QFont bitter (family);
128+ ui->text ->setFont (bitter);
129+ ui->fontChooser ->setCurrentText (checkconfig_str_val);
130+ }
113131 else {
114132 QFont config_font (checkconfig_str_val);
115133 ui->text ->setFont (config_font);
116134 ui->fontChooser ->setCurrentText (checkconfig_str_val);
117135 }
118136 }
119137 // Night mode
120- if (checkconfig (" .config/10-dark_mode/config" ) == true ) {
121- string_writeconfig (" /tmp/invertScreen" , " y" );
122- ui->nightModeBtn ->setText (" " );
123- ui->nightModeBtn ->setIcon (QIcon (" :/resources/nightmode-full.png" ));
124- isNightModeActive = true ;
138+ string_checkconfig_ro (" /opt/inkbox_device" );
139+ if (checkconfig_str_val == " n705\n " or checkconfig_str_val == " n905\n " or checkconfig_str_val == " n613\n " ) {
140+ if (checkconfig (" .config/10-dark_mode/config" ) == true ) {
141+ string_writeconfig (" /tmp/invertScreen" , " y" );
142+ ui->nightModeBtn ->setText (" " );
143+ ui->nightModeBtn ->setIcon (QIcon (" :/resources/nightmode-full.png" ));
144+ isNightModeActive = true ;
145+ }
146+ else {
147+ string_writeconfig (" /tmp/invertScreen" , " n" );
148+ ui->nightModeBtn ->setText (" " );
149+ ui->nightModeBtn ->setIcon (QIcon (" :/resources/nightmode-empty.png" ));
150+ isNightModeActive = false ;
151+ }
125152 }
126153 else {
127- string_writeconfig ( " /tmp/invertScreen " , " n " );
128- ui->nightModeBtn -> setText ( " " );
129- ui->nightModeBtn ->setIcon ( QIcon ( " :/resources/nightmode-empty.png " ) );
130- isNightModeActive = false ;
154+ ui-> line_7 -> hide ( );
155+ ui->line_7 -> deleteLater ( );
156+ ui->nightModeBtn ->hide ( );
157+ ui-> nightModeBtn -> deleteLater () ;
131158 }
132159
133160 // Stylesheet + misc.
@@ -166,7 +193,7 @@ reader::reader(QWidget *parent) :
166193
167194 // Getting brightness level
168195 int brightness_value;
169- if (global::isN705 == true or global::isN905C == true ) {
196+ if (global::isN705 == true or global::isN905C == true or global::isN873 == true ) {
170197 brightness_value = get_brightness ();
171198 }
172199 else if (global::isN613 == true ) {
@@ -904,7 +931,7 @@ void reader::on_hideOptionsBtn_clicked()
904931void reader::on_brightnessDecBtn_clicked ()
905932{
906933 int bval;
907- if (global::isN705 == true or global::isN905C == true ) {
934+ if (global::isN705 == true or global::isN905C == true or global::isN873 == true ) {
908935 bval = get_brightness ();
909936 }
910937 else if (global::isN613 == true ) {
@@ -927,7 +954,7 @@ void reader::on_brightnessDecBtn_clicked()
927954void reader::on_brightnessIncBtn_clicked ()
928955{
929956 int bval;
930- if (global::isN705 == true or global::isN905C == true ) {
957+ if (global::isN705 == true or global::isN905C == true or global::isN873 == true ) {
931958 bval = get_brightness ();
932959 }
933960 else if (global::isN613 == true ) {
@@ -1012,6 +1039,11 @@ void reader::on_fontChooser_currentIndexChanged(const QString &arg1)
10121039 ui->text ->setFont (crimson);
10131040 string_writeconfig (" .config/04-book/font" , " Crimson Pro" );
10141041 }
1042+ if (arg1 == " Bitter" ) {
1043+ QFont bitter (" Bitter" );
1044+ ui->text ->setFont (bitter);
1045+ string_writeconfig (" .config/04-book/font" , " Bitter" );
1046+ }
10151047}
10161048
10171049void reader::on_alignLeftBtn_clicked ()
0 commit comments