From 4bf2387558add1e0d1dd8f1650f363b500683f7d Mon Sep 17 00:00:00 2001 From: Nicolas Mailloux Date: Mon, 14 Jun 2021 14:49:16 -0400 Subject: [PATCH] Replaced main 'text' QLabel by a QTextEdit We won't ever have that clipping out problem ever again :D Main thing left is to find out how to enable the word search feature as hasSelectedText() function in QLabel doesn't exist for QTextEdits... --- reader.cpp | 4 +- reader.ui | 752 +++++++++++++++++++++++---------------------- resources/eink.qss | 10 +- 3 files changed, 386 insertions(+), 380 deletions(-) diff --git a/reader.cpp b/reader.cpp index 878b72e..2f26f5d 100644 --- a/reader.cpp +++ b/reader.cpp @@ -235,7 +235,7 @@ reader::reader(QWidget *parent) : } // Word selection & dictionary lookup feature - QString dictionary_position_str = QString::number(dictionary_position); + /*QString dictionary_position_str = QString::number(dictionary_position); ui->definitionStatusLabel->setText(dictionary_position_str); QTimer *select_t = new QTimer(this); select_t->setInterval(100); @@ -271,7 +271,7 @@ reader::reader(QWidget *parent) : ; } } ); - select_t->start(); + select_t->start();*/ // We have to get the file's path if(global::reader::skipOpenDialog == true) { diff --git a/reader.ui b/reader.ui index 6c5006a..4885b25 100644 --- a/reader.ui +++ b/reader.ui @@ -16,6 +16,363 @@ + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + QFrame::Plain + + + 8 + + + Qt::Horizontal + + + + + + + 0 + + + 6 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Save + + + + + + + Close + + + + + + + + 75 + true + + + + Word search + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + 0 + + + + + 0 + + + + + QFrame::Plain + + + 2 + + + Qt::Vertical + + + + + + + + Source Serif Pro + + + + Definition + + + Qt::AlignJustify|Qt::AlignVCenter + + + true + + + + + + + + Inter + 75 + true + + + + Word + + + Qt::AlignCenter + + + true + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Previous + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Status + + + + + + + Next + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + QFrame::Plain + + + 8 + + + Qt::Horizontal + + + + + + + + + + + + + + QFrame::Plain + + + Qt::Vertical + + + + + + + + 75 + true + + + + Previous + + + + + + + QFrame::Plain + + + Qt::Vertical + + + + + + + + 75 + true + + + + Options + + + + + + + + 75 + true + + + + Next + + + + + + + + 75 + true + + + + Hide + + + + + @@ -589,289 +946,8 @@ - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - QFrame::Plain - - - 8 - - - Qt::Horizontal - - - - - - - 0 - - - 6 - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Save - - - - - - - Close - - - - - - - - 75 - true - - - - Word search - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - 0 - - - - - 0 - - - - - QFrame::Plain - - - 2 - - - Qt::Vertical - - - - - - - - Source Serif Pro - - - - Definition - - - Qt::AlignJustify|Qt::AlignVCenter - - - true - - - - - - - - Inter - 75 - true - - - - Word - - - Qt::AlignCenter - - - true - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - 0 - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Previous - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Status - - - - - - - Next - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - QFrame::Plain - - - 8 - - - Qt::Horizontal - - - - - - - - - - + + Qt::Vertical @@ -883,103 +959,33 @@ - - - - - - QFrame::Plain - - - Qt::Vertical - - - - - - - - 75 - true - - - - Previous - - - - - - - QFrame::Plain - - - Qt::Vertical - - - - - - - - 75 - true - - - - Options - - - - - - - - 75 - true - - - - Next - - - - - - - - 75 - true - - - - Hide - - - - - - - - - Ubuntu - false - + + + + 50 + 50 + - - Text + + QFrame::NoFrame - - Qt::AlignJustify|Qt::AlignVCenter + + QFrame::Plain - - true + + 0 + + + Qt::ScrollBarAlwaysOff + + + Qt::ScrollBarAlwaysOff - - + + Qt::Vertical diff --git a/resources/eink.qss b/resources/eink.qss index 8b562af..86811e0 100644 --- a/resources/eink.qss +++ b/resources/eink.qss @@ -193,17 +193,17 @@ QLineEdit:edit-focus, QSpinBox:edit-focus, QDoubleSpinBox:edit-focus QTextEdit { background-color:transparent; - border:1px solid black; - padding: 1px; + border:0px; + padding: 0px; } QTextEdit:focus { - border: 1px solid black; - padding: 1px; + border: 0px; + padding: 0px; } QTextEdit:edit-focus { - border: 3px solid black; + border: 0px; padding: 0px; }