From 139aa787389fba9fbd2072f3609cc6ec39199d69 Mon Sep 17 00:00:00 2001 From: Nicolas Mailloux Date: Tue, 8 Mar 2022 10:08:10 -0500 Subject: [PATCH] Reader: Set wordWrap on bookInfoLabel when book isn't an ePUB --- reader.cpp | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/reader.cpp b/reader.cpp index e222136..9cf352c 100644 --- a/reader.cpp +++ b/reader.cpp @@ -562,7 +562,10 @@ reader::reader(QWidget *parent) : if(checkconfig_str_val == "n705\n") { infoLabelDefinedLength = 35; } - if(checkconfig_str_val == "n905\n") { + else if(checkconfig_str_val == "n905\n" or checkconfig_str_val == "n613\n" or checkconfig_str_val == "n236\n" or checkconfig_str_val == "n437\n" or checkconfig_str_val == "n306\n") { + infoLabelDefinedLength = 50; + } + else { infoLabelDefinedLength = 50; } @@ -583,6 +586,24 @@ reader::reader(QWidget *parent) : else { bookReadRelativePath = book_file.split("/").last(); } + + int infoLabelDefinedLength; + if(checkconfig_str_val == "n705\n") { + infoLabelDefinedLength = 35; + } + else if(checkconfig_str_val == "n905\n" or checkconfig_str_val == "n613\n" or checkconfig_str_val == "n236\n" or checkconfig_str_val == "n437\n" or checkconfig_str_val == "n306\n") { + infoLabelDefinedLength = 50; + } + else { + infoLabelDefinedLength = 50; + } + + if(bookReadRelativePath <= infoLabelDefinedLength) { + ui->bookInfoLabel->setWordWrap(false); + } + else { + ui->bookInfoLabel->setWordWrap(true); + } ui->bookInfoLabel->setText(bookReadRelativePath); }