mirror of
https://github.com/Quill-OS/quill.git
synced 2024-10-31 21:33:22 -07:00
Add search button in Reader framework
This commit is contained in:
parent
b0b5f9cdaa
commit
a961d95290
3 changed files with 73 additions and 24 deletions
29
reader.cpp
29
reader.cpp
|
@ -50,6 +50,7 @@ reader::reader(QWidget *parent) :
|
|||
ui->previousDefinitionBtn->setProperty("type", "borderless");
|
||||
ui->nextDefinitionBtn->setProperty("type", "borderless");
|
||||
ui->nightModeBtn->setProperty("type", "borderless");
|
||||
ui->searchBtn->setProperty("type", "borderless");
|
||||
ui->gotoBtn->setProperty("type", "borderless");
|
||||
|
||||
// Icons
|
||||
|
@ -77,6 +78,8 @@ reader::reader(QWidget *parent) :
|
|||
ui->homeBtn->setIcon(QIcon(":/resources/home.png"));
|
||||
ui->aboutBtn->setText("");
|
||||
ui->aboutBtn->setIcon(QIcon(":/resources/info.png"));
|
||||
ui->searchBtn->setText("");
|
||||
ui->searchBtn->setIcon(QIcon(":/resources/search.png"));
|
||||
|
||||
// Style misc.
|
||||
ui->bookInfoLabel->setStyleSheet("font-style: italic");
|
||||
|
@ -1575,3 +1578,29 @@ void reader::gotoPage(int pageNumber) {
|
|||
setupPageWidget();
|
||||
refreshScreen();
|
||||
}
|
||||
|
||||
void reader::on_searchBtn_clicked()
|
||||
{
|
||||
global::forbidOpenSearchDialog = false;
|
||||
setupSearchDialog();
|
||||
}
|
||||
|
||||
void reader::setupSearchDialog() {
|
||||
if(global::forbidOpenSearchDialog == false) {
|
||||
global::keyboard::keyboardDialog = true;
|
||||
global::keyboard::searchDialog = true;
|
||||
global::keyboard::keyboardText = "";
|
||||
generalDialogWindow = new generalDialog();
|
||||
generalDialogWindow->setAttribute(Qt::WA_DeleteOnClose);
|
||||
connect(generalDialogWindow, SIGNAL(refreshScreen()), SLOT(searchRefreshScreen()));
|
||||
connect(generalDialogWindow, SIGNAL(destroyed(QObject*)), SLOT(setupSearchDialog()));
|
||||
generalDialogWindow->show();
|
||||
}
|
||||
else {
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
void reader::searchRefreshScreen() {
|
||||
this->repaint();
|
||||
}
|
||||
|
|
3
reader.h
3
reader.h
|
@ -124,6 +124,9 @@ private slots:
|
|||
void on_nightModeBtn_clicked();
|
||||
void on_gotoBtn_clicked();
|
||||
void gotoPage(int pageNumber);
|
||||
void on_searchBtn_clicked();
|
||||
void searchRefreshScreen();
|
||||
void setupSearchDialog();
|
||||
|
||||
private:
|
||||
Ui::reader *ui;
|
||||
|
|
65
reader.ui
65
reader.ui
|
@ -558,10 +558,10 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QPushButton" name="homeBtn">
|
||||
<item row="0" column="11">
|
||||
<widget class="QLabel" name="batteryIconLabel">
|
||||
<property name="text">
|
||||
<string> Home </string>
|
||||
<string>Battery Icon</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -572,7 +572,7 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="7">
|
||||
<item row="0" column="8">
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
|
@ -585,7 +585,41 @@
|
|||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="9">
|
||||
<item row="0" column="3">
|
||||
<widget class="Line" name="line_7">
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Plain</enum>
|
||||
</property>
|
||||
<property name="lineWidth">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QPushButton" name="aboutBtn">
|
||||
<property name="text">
|
||||
<string> About </string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QPushButton" name="homeBtn">
|
||||
<property name="text">
|
||||
<string> Home </string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="6">
|
||||
<widget class="QPushButton" name="searchBtn">
|
||||
<property name="text">
|
||||
<string>Search</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="10">
|
||||
<widget class="QLabel" name="batteryLabel">
|
||||
<property name="font">
|
||||
<font>
|
||||
|
@ -598,28 +632,11 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="10">
|
||||
<widget class="QLabel" name="batteryIconLabel">
|
||||
<property name="text">
|
||||
<string>Battery Icon</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QPushButton" name="aboutBtn">
|
||||
<property name="text">
|
||||
<string> About </string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="3">
|
||||
<widget class="Line" name="line_7">
|
||||
<item row="0" column="5">
|
||||
<widget class="Line" name="line_17">
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Plain</enum>
|
||||
</property>
|
||||
<property name="lineWidth">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
|
|
Loading…
Reference in a new issue