From 182edc603d0a1ac62ca925b35018c00fb56bf35e Mon Sep 17 00:00:00 2001 From: Philipp A Date: Thu, 11 May 2017 09:43:21 +0200 Subject: [PATCH] Created ui file for OutputDialog --- notifier/octopi-notifier/mainwindow.cpp | 1 - notifier/octopi-notifier/octopi-notifier.pro | 9 +- notifier/octopi-notifier/outputdialog.cpp | 79 ++++------- notifier/octopi-notifier/outputdialog.h | 12 +- notifier/octopi-notifier/ui/outputdialog.ui | 74 +++++++++++ octopi.pro | 8 +- src/searchbar.cpp | 65 +++------ src/searchbar.h | 5 + src/searchlineedit.cpp | 45 +++---- src/searchlineedit.h | 5 + ui/searchbar.ui | 132 +++++++++++++++++++ ui/searchlineedit.ui | 41 ++++++ ui/transactiondialog.ui | 85 ++---------- 13 files changed, 353 insertions(+), 208 deletions(-) create mode 100644 notifier/octopi-notifier/ui/outputdialog.ui create mode 100644 ui/searchbar.ui create mode 100644 ui/searchlineedit.ui diff --git a/notifier/octopi-notifier/mainwindow.cpp b/notifier/octopi-notifier/mainwindow.cpp index d5d2c2d2..ced44165 100644 --- a/notifier/octopi-notifier/mainwindow.cpp +++ b/notifier/octopi-notifier/mainwindow.cpp @@ -349,7 +349,6 @@ void MainWindow::doSystemUpgrade() m_actionSystemUpgrade->setEnabled(false); OutputDialog *dlg = new OutputDialog(this); - dlg->setFrameShape(QFrame::NoFrame); if (m_debugInfo) dlg->setDebugMode(true); diff --git a/notifier/octopi-notifier/octopi-notifier.pro b/notifier/octopi-notifier/octopi-notifier.pro index 21b6c17e..4644cc98 100644 --- a/notifier/octopi-notifier/octopi-notifier.pro +++ b/notifier/octopi-notifier/octopi-notifier.pro @@ -34,6 +34,10 @@ OBJECTS_DIR += ../build-octopi-notifier MOC_DIR += ../build-octopi-notifier UI_DIR += ../build-octopi-notifier +# so that .ui files can find headers +# no matter where they’re included from +INCLUDEPATH += ../.. + HEADERS += \ mainwindow.h \ outputdialog.h \ @@ -78,7 +82,10 @@ ALPM_BACKEND{ } FORMS += ../../ui/transactiondialog.ui \ - ../../ui/optionsdialog.ui + ../../ui/searchlineedit.ui \ + ../../ui/searchbar.ui \ + ../../ui/optionsdialog.ui \ + ui/outputdialog.ui RESOURCES += \ ../../resources.qrc diff --git a/notifier/octopi-notifier/outputdialog.cpp b/notifier/octopi-notifier/outputdialog.cpp index 793be723..1b760ab9 100644 --- a/notifier/octopi-notifier/outputdialog.cpp +++ b/notifier/octopi-notifier/outputdialog.cpp @@ -19,6 +19,7 @@ */ #include "outputdialog.h" +#include "ui_outputdialog.h" #include "../../src/pacmanexec.h" #include "../../src/searchbar.h" #include "../../src/uihelper.h" @@ -37,8 +38,11 @@ /* * The obligatory constructor... */ -OutputDialog::OutputDialog(QWidget *parent): QDialog(parent) +OutputDialog::OutputDialog(QWidget *parent): + QDialog(parent), + ui(new Ui::OutputDialog) { + ui->setupUi(this); init(); m_upgradeRunning = false; m_debugInfo = false; @@ -52,49 +56,20 @@ void OutputDialog::setDebugMode(bool newValue) m_debugInfo = newValue; } -QFrame::Shape OutputDialog::frameShape() -{ - return m_textBrowser->frameShape(); -} - -void OutputDialog::setFrameShape(QFrame::Shape shape) -{ - m_textBrowser->setFrameShape(shape); -} - /* * Let's build the main widgets... */ void OutputDialog::init() { - this->resize(650, 500); - - setWindowTitle(QCoreApplication::translate("MainWindow", "System upgrade")); setWindowIcon(IconHelper::getIconSystemUpgrade()); - m_mainLayout = new QVBoxLayout(this); - m_textBrowser = new QTextBrowser(this); - m_progressBar = new QProgressBar(this); - - m_textBrowser->setGeometry(QRect(0, 0, 650, 500)); - - m_mainLayout->addWidget(m_textBrowser); - - m_searchBar = new SearchBar(this); - connect(m_searchBar, SIGNAL(textChanged(QString)), this, SLOT(onSearchBarTextChanged(QString))); - connect(m_searchBar, SIGNAL(closed()), this, SLOT(onSearchBarClosed())); - connect(m_searchBar, SIGNAL(findNext()), this, SLOT(onSearchBarFindNext())); - connect(m_searchBar, SIGNAL(findPrevious()), this, SLOT(onSearchBarFindPrevious())); - m_mainLayout->addWidget(m_progressBar); - m_mainLayout->addWidget(m_searchBar); - m_mainLayout->setSpacing(0); - m_mainLayout->setSizeConstraint(QLayout::SetMinimumSize); - m_mainLayout->setContentsMargins(2, 2, 2, 2); - m_progressBar->setMinimum(0); - m_progressBar->setMaximum(100); - m_progressBar->setValue(0); - m_progressBar->close(); - m_searchBar->show(); + connect(ui->m_searchBar, SIGNAL(textChanged(QString)), this, SLOT(onSearchBarTextChanged(QString))); + connect(ui->m_searchBar, SIGNAL(closed()), this, SLOT(onSearchBarClosed())); + connect(ui->m_searchBar, SIGNAL(findNext()), this, SLOT(onSearchBarFindNext())); + connect(ui->m_searchBar, SIGNAL(findPrevious()), this, SLOT(onSearchBarFindPrevious())); + ui->m_searchBar->show(); + + ui->m_progressBar->close(); } /* @@ -147,8 +122,8 @@ void OutputDialog::reject() */ void OutputDialog::onPencertange(int percentage) { - if (percentage > 0 && !m_progressBar->isVisible()) m_progressBar->show(); - m_progressBar->setValue(percentage); + if (percentage > 0 && !ui->m_progressBar->isVisible()) ui->m_progressBar->show(); + ui->m_progressBar->setValue(percentage); } /* @@ -156,10 +131,10 @@ void OutputDialog::onPencertange(int percentage) */ void OutputDialog::positionTextEditCursorAtEnd() { - QTextCursor tc = m_textBrowser->textCursor(); + QTextCursor tc = ui->m_textBrowser->textCursor(); tc.clearSelection(); tc.movePosition(QTextCursor::End); - m_textBrowser->setTextCursor(tc); + ui->m_textBrowser->setTextCursor(tc); } /* @@ -167,7 +142,7 @@ void OutputDialog::positionTextEditCursorAtEnd() */ void OutputDialog::writeToTabOutput(const QString &msg, TreatURLLinks treatURLLinks) { - utils::writeToTextBrowser(m_textBrowser, msg, treatURLLinks); + utils::writeToTextBrowser(ui->m_textBrowser, msg, treatURLLinks); } /* @@ -175,9 +150,9 @@ void OutputDialog::writeToTabOutput(const QString &msg, TreatURLLinks treatURLLi */ void OutputDialog::onWriteOutput(const QString &output) { - utils::positionTextEditCursorAtEnd(m_textBrowser); - m_textBrowser->insertHtml(output); - m_textBrowser->ensureCursorVisible(); + utils::positionTextEditCursorAtEnd(ui->m_textBrowser); + ui->m_textBrowser->insertHtml(output); + ui->m_textBrowser->ensureCursorVisible(); } /* @@ -185,7 +160,7 @@ void OutputDialog::onWriteOutput(const QString &output) */ bool OutputDialog::textInTabOutput(const QString& findText) { - return (utils::strInQTextEdit(m_textBrowser, findText)); + return (utils::strInQTextEdit(ui->m_textBrowser, findText)); } /* @@ -193,7 +168,7 @@ bool OutputDialog::textInTabOutput(const QString& findText) */ void OutputDialog::pacmanProcessFinished(int exitCode, QProcess::ExitStatus exitStatus) { - m_progressBar->close(); + ui->m_progressBar->close(); if ((exitCode == 0) && exitStatus == QProcess::NormalExit) { @@ -226,7 +201,7 @@ void OutputDialog::pacmanProcessFinished(int exitCode, QProcess::ExitStatus exit */ void OutputDialog::onSearchBarTextChanged(QString strToSearch) { - utils::searchBarTextChangedInTextBrowser(m_textBrowser, m_searchBar, strToSearch); + utils::searchBarTextChangedInTextBrowser(ui->m_textBrowser, ui->m_searchBar, strToSearch); } /* @@ -234,7 +209,7 @@ void OutputDialog::onSearchBarTextChanged(QString strToSearch) */ void OutputDialog::onSearchBarClosed() { - utils::searchBarClosedInTextBrowser(m_textBrowser, m_searchBar); + utils::searchBarClosedInTextBrowser(ui->m_textBrowser, ui->m_searchBar); } /* @@ -242,7 +217,7 @@ void OutputDialog::onSearchBarClosed() */ void OutputDialog::onSearchBarFindNext() { - utils::searchBarFindNextInTextBrowser(m_textBrowser, m_searchBar); + utils::searchBarFindNextInTextBrowser(ui->m_textBrowser, ui->m_searchBar); } /* @@ -250,7 +225,7 @@ void OutputDialog::onSearchBarFindNext() */ void OutputDialog::onSearchBarFindPrevious() { - utils::searchBarFindPreviousInTextBrowser(m_textBrowser, m_searchBar); + utils::searchBarFindPreviousInTextBrowser(ui->m_textBrowser, ui->m_searchBar); } /* @@ -277,7 +252,7 @@ void OutputDialog::keyPressEvent(QKeyEvent *ke) { if(ke->key() == Qt::Key_F && ke->modifiers() == Qt::ControlModifier) { - m_searchBar->show(); + ui->m_searchBar->show(); } else if(ke->key() == Qt::Key_Escape) { diff --git a/notifier/octopi-notifier/outputdialog.h b/notifier/octopi-notifier/outputdialog.h index 6ca8321e..9d03bcd5 100644 --- a/notifier/octopi-notifier/outputdialog.h +++ b/notifier/octopi-notifier/outputdialog.h @@ -37,16 +37,16 @@ class QWidget; class QCloseEvent; class QKeyEvent; +namespace Ui { +class OutputDialog; +} + class OutputDialog : public QDialog { Q_OBJECT - Q_PROPERTY(QFrame::Shape frameShape READ frameShape WRITE setFrameShape USER true) - private: - QTextBrowser *m_textBrowser; - QProgressBar *m_progressBar; - QVBoxLayout *m_mainLayout; + Ui::OutputDialog *ui; PacmanExec *m_pacmanExec; SearchBar *m_searchBar; bool m_upgradeRunning; @@ -77,12 +77,10 @@ private slots: public: explicit OutputDialog(QWidget *parent = 0); void setDebugMode(bool newValue); - QFrame::Shape frameShape(); public slots: void show(); void reject(); - void setFrameShape(QFrame::Shape shape); }; #endif // OUTPUTDIALOG_H diff --git a/notifier/octopi-notifier/ui/outputdialog.ui b/notifier/octopi-notifier/ui/outputdialog.ui new file mode 100644 index 00000000..a09554de --- /dev/null +++ b/notifier/octopi-notifier/ui/outputdialog.ui @@ -0,0 +1,74 @@ + + + OutputDialog + + + + 0 + 0 + 650 + 550 + + + + System upgrade + + + + .. + + + + 0 + + + QLayout::SetMinimumSize + + + 0 + + + 0 + + + 0 + + + 0 + + + + + QFrame::NoFrame + + + + + + + 0 + + + 100 + + + 0 + + + + + + + + + + + SearchBar + QWidget +
src/searchbar.h
+ 1 +
+
+ + +
diff --git a/octopi.pro b/octopi.pro index d3270d3a..7964639c 100644 --- a/octopi.pro +++ b/octopi.pro @@ -47,7 +47,7 @@ HEADERS += src/QtSolutions/qtsingleapplication.h \ src/terminal.h \ src/pacmanexec.h \ src/constants.h \ - src/optionsdialog.h + src/optionsdialog.h ALPM_BACKEND{ HEADERS += src/alpmbackend.h @@ -83,7 +83,7 @@ SOURCES += src/QtSolutions/qtsingleapplication.cpp \ src/utils.cpp \ src/terminal.cpp \ src/pacmanexec.cpp \ - src/optionsdialog.cpp + src/optionsdialog.cpp ALPM_BACKEND{ SOURCES += src/alpmbackend.cpp @@ -92,7 +92,9 @@ ALPM_BACKEND{ FORMS += ui/mainwindow.ui \ ui/transactiondialog.ui \ ui/multiselectiondialog.ui \ - ui/optionsdialog.ui + ui/optionsdialog.ui \ + ui/searchbar.ui \ + ui/searchlineedit.ui RESOURCES += resources.qrc diff --git a/src/searchbar.cpp b/src/searchbar.cpp index 586f378d..20e40cb7 100644 --- a/src/searchbar.cpp +++ b/src/searchbar.cpp @@ -19,6 +19,7 @@ */ #include "searchbar.h" +#include "ui_searchbar.h" #include "searchlineedit.h" #include "uihelper.h" #include @@ -35,8 +36,10 @@ */ SearchBar::SearchBar(QWidget *parent) : - QWidget(parent) + QWidget(parent), + ui(new Ui::SearchBar) { + ui->setupUi(this); init(); } @@ -46,58 +49,22 @@ SearchBar::SearchBar(QWidget *parent) : void SearchBar::init() { setVisible(false); - setObjectName("searchbar"); - QHBoxLayout *layout = new QHBoxLayout(this); - layout->setSpacing(0); - layout->setMargin(4); - - setStyleSheet("QWidget#searchbar{" - "border-top-width: .6px;" - "border-top-style: solid;" - "border-top-color: darkgray;}"); - - m_searchLineEdit = new SearchLineEdit(this); - m_searchLineEdit->setMinimumWidth(300); - QToolButton *m_previousButton = new QToolButton(this); - QToolButton *m_nextButton = new QToolButton(this); - m_previousButton->setToolButtonStyle(Qt::ToolButtonTextOnly); - m_nextButton->setToolButtonStyle(Qt::ToolButtonTextOnly); QAction *m_previousAction = new QAction(this); QAction *m_nextAction = new QAction(this); m_previousAction->setText("< " + tr("Previous")); - m_previousButton->setAutoRaise(true); m_previousAction->setShortcut(QKeySequence(Qt::SHIFT + Qt::Key_F3)); m_nextAction->setText(tr("Next") + " >"); - m_nextButton->setAutoRaise(true); m_nextAction->setShortcut(Qt::Key_F3); - m_previousButton->setDefaultAction(m_previousAction); - m_nextButton->setDefaultAction(m_nextAction); - - QToolButton *tbClose = new QToolButton(); - tbClose->setIcon(IconHelper::getIconClose()); - - tbClose->setAutoRaise(true); - tbClose->setStyleSheet("QToolButton{ font-size: 16px; font-family: verdana; border-radius: 4px; } " - "QToolButton:hover{ background-color: palette(light); }" - "QToolButton::pressed{ background-color: palette(mid); }"); - - tbClose->setToolTip(tr("Close")); - tbClose->setShortcut(Qt::Key_Escape); - layout->addWidget(tbClose, 1, Qt::AlignLeft); - layout->addSpacing(3); - layout->addWidget(m_searchLineEdit, 0, Qt::AlignLeft); - layout->addSpacing(2); - layout->addWidget(m_previousButton, 1, Qt::AlignLeft); - layout->addWidget(m_nextButton, 20, Qt::AlignLeft); + ui->m_previousButton->setDefaultAction(m_previousAction); + ui->m_nextButton->setDefaultAction(m_nextAction); - setLayout(layout); - m_searchLineEdit->setFocus(); + ui->m_searchLineEdit->setFocus(); - connect(tbClose, SIGNAL(clicked()), this, SLOT(close())); - connect(m_searchLineEdit, SIGNAL(textChanged(QString)), this, SIGNAL(textChanged(QString))); + connect(ui->tbClose, SIGNAL(clicked()), this, SLOT(close())); + connect(ui->m_searchLineEdit, SIGNAL(textChanged(QString)), this, SIGNAL(textChanged(QString))); connect(m_previousAction, SIGNAL(triggered()), this, SIGNAL(findPrevious())); connect(m_nextAction, SIGNAL(triggered()), this, SIGNAL(findNext())); } @@ -108,9 +75,9 @@ void SearchBar::init() void SearchBar::close() { hide(); - disconnect(m_searchLineEdit, SIGNAL(textChanged(QString)), this, SIGNAL(textChanged(QString))); - m_searchLineEdit->setText(""); - connect(m_searchLineEdit, SIGNAL(textChanged(QString)), this, SIGNAL(textChanged(QString))); + disconnect(ui->m_searchLineEdit, SIGNAL(textChanged(QString)), this, SIGNAL(textChanged(QString))); + ui->m_searchLineEdit->setText(""); + connect(ui->m_searchLineEdit, SIGNAL(textChanged(QString)), this, SIGNAL(textChanged(QString))); emit closed(); } @@ -119,7 +86,7 @@ void SearchBar::close() */ void SearchBar::clear() { - m_searchLineEdit->setText(""); + ui->m_searchLineEdit->setText(""); } /* @@ -138,7 +105,7 @@ void SearchBar::paintEvent(QPaintEvent *) */ void SearchBar::keyPressEvent(QKeyEvent *ke) { - if(!m_searchLineEdit->text().isEmpty() && (ke->key() == Qt::Key_Enter || ke->key() == Qt::Key_Return)) + if(!ui->m_searchLineEdit->text().isEmpty() && (ke->key() == Qt::Key_Enter || ke->key() == Qt::Key_Return)) { findNext(); } @@ -150,6 +117,6 @@ void SearchBar::keyPressEvent(QKeyEvent *ke) void SearchBar::show() { setVisible(true); - m_searchLineEdit->selectAll(); - m_searchLineEdit->setFocus(); + ui->m_searchLineEdit->selectAll(); + ui->m_searchLineEdit->setFocus(); } diff --git a/src/searchbar.h b/src/searchbar.h index 40dd64a1..8928e394 100644 --- a/src/searchbar.h +++ b/src/searchbar.h @@ -28,11 +28,16 @@ #include #include +namespace Ui { +class SearchBar; +} + class SearchBar : public QWidget { Q_OBJECT private: + Ui::SearchBar *ui; SearchLineEdit *m_searchLineEdit; protected: diff --git a/src/searchlineedit.cpp b/src/searchlineedit.cpp index 55e3fa6e..f3ecb80a 100644 --- a/src/searchlineedit.cpp +++ b/src/searchlineedit.cpp @@ -7,6 +7,7 @@ */ #include "searchlineedit.h" +#include "ui_searchlineedit.h" #include "strconstants.h" #include "wmhelper.h" #include "uihelper.h" @@ -20,7 +21,10 @@ #include SearchLineEdit::SearchLineEdit(QWidget *parent, bool hasSLocate) : - QLineEdit(parent){ + QLineEdit(parent), + ui(new Ui::SearchLineEdit) +{ + ui->setupUi(this); m_hasLocate = hasSLocate; m_completerModel = new QStringListModel(this); @@ -31,17 +35,11 @@ SearchLineEdit::SearchLineEdit(QWidget *parent, bool hasSLocate) : m_completer->setMaxVisibleItems(10); setCompleter(m_completer); - // Create the search button and set its icon, cursor, and stylesheet - this->m_SearchButton = new QToolButton(this); - // Increase button size a bit for kde if (WMHelper::isKDERunning()) - this->m_SearchButton->setFixedSize(20, 20); - else - this->m_SearchButton->setFixedSize(18, 18); + ui->m_SearchButton->setFixedSize(20, 20); - this->m_SearchButton->setCursor(Qt::ArrowCursor); - this->m_SearchButton->setStyleSheet(this->buttonStyleSheetForCurrentState()); + ui->m_SearchButton->setStyleSheet(this->buttonStyleSheetForCurrentState()); m_defaultValidator = new QRegExpValidator(QRegExp("[a-zA-Z0-9_\\-\\$\\^\\*\\+\\(\\)\\[\\]\\.\\s\\\\]+"), this); m_aurValidator = new QRegExpValidator(QRegExp("[a-zA-Z0-9_\\-\\+\\s\\\\]+"), this); @@ -95,21 +93,21 @@ void SearchLineEdit::refreshCompleterData() void SearchLineEdit::resizeEvent(QResizeEvent *event) { Q_UNUSED(event); - this->m_SearchButton->move(5, (this->rect().height() - this->m_SearchButton->height()) / 2); + ui->m_SearchButton->move(5, (this->rect().height() - ui->m_SearchButton->height()) / 2); } void SearchLineEdit::updateSearchButton(const QString &text) { if (!text.isEmpty()){ // We have some text in the box - set the button to clear the text - QObject::connect(this->m_SearchButton, SIGNAL(clicked()), SLOT(clear())); + QObject::connect(ui->m_SearchButton, SIGNAL(clicked()), SLOT(clear())); } else{ // The text box is empty - make the icon do nothing when clicked - QObject::disconnect(this->m_SearchButton, SIGNAL(clicked()), this, SLOT(clear())); + QObject::disconnect(ui->m_SearchButton, SIGNAL(clicked()), this, SLOT(clear())); } - this->m_SearchButton->setStyleSheet(this->buttonStyleSheetForCurrentState()); + ui->m_SearchButton->setStyleSheet(this->buttonStyleSheetForCurrentState()); } QString SearchLineEdit::styleSheetForCurrentState() @@ -133,7 +131,7 @@ QString SearchLineEdit::styleSheetForCurrentState() if (!WMHelper::isKDERunning()) //UnixCommand::getLinuxDistro() != ectn_CHAKRA) { style += "padding-left: 20px;"; - style += QString("padding-right: %1px;").arg(this->m_SearchButton->sizeHint().width() + frameWidth + 1); + style += QString("padding-right: %1px;").arg(ui->m_SearchButton->sizeHint().width() + frameWidth + 1); style += "border-width: 3px;"; style += "border-image: url(:/resources/images/esf-border.png) 3 3 3 3 stretch;"; style += "background-color: rgba(255, 255, 255, 255);"; //204);"; @@ -157,7 +155,7 @@ void SearchLineEdit::setFoundStyle(){ style += "font-family: 'Sans Serif';"; style += "font-style: italic;"; style += "padding-left: 20px;"; - style += QString("padding-right: %1px;").arg(this->m_SearchButton->sizeHint().width() + 2); + style += QString("padding-right: %1px;").arg(ui->m_SearchButton->sizeHint().width() + 2); style += "border-width: 3px;"; style += "border-image: url(:/resources/images/esf-border.png) 3 3 3 3 stretch;"; style += "color: black; "; @@ -187,7 +185,7 @@ void SearchLineEdit::setNotFoundStyle(){ style += "font-family: 'Sans Serif';"; style += "font-style: italic;"; style += "padding-left: 20px;"; - style += QString("padding-right: %1px;").arg(this->m_SearchButton->sizeHint().width() + 2); + style += QString("padding-right: %1px;").arg(ui->m_SearchButton->sizeHint().width() + 2); style += "border-width: 3px;"; style += "border-image: url(:/resources/images/esf-border.png) 3 3 3 3 stretch;"; style += "color: white; "; @@ -212,30 +210,29 @@ QString SearchLineEdit::buttonStyleSheetForCurrentState() const { // When using KDE avoid stylesheet customization if (WMHelper::isKDERunning() && UnixCommand::getLinuxDistro() != ectn_KAOS) { - this->text().isEmpty() ? this->m_SearchButton->setIcon(IconHelper::getIconSearch()) - : this->m_SearchButton->setIcon(IconHelper::getIconClear()); - this->m_SearchButton->setAutoRaise(true); + this->text().isEmpty() ? ui->m_SearchButton->setIcon(IconHelper::getIconSearch()) + : ui->m_SearchButton->setIcon(IconHelper::getIconClear()); if (!this->text().isEmpty()) - this->m_SearchButton->setToolTip(StrConstants::getClear()); + ui->m_SearchButton->setToolTip(StrConstants::getClear()); else - this->m_SearchButton->setToolTip(""); + ui->m_SearchButton->setToolTip(""); return QString(); } QString style; style += "QToolButton {"; - style += "border: none; margin: 0; padding: 0;"; + style += "margin: 0; padding: 0;"; style += QString("background-image: url(:/resources/images/esf-%1.png);").arg(this->text().isEmpty() ? "search" : "clear"); style += "}"; if (!this->text().isEmpty()) { style += "QToolButton:pressed { background-image: url(:/resources/images/esf-clear-active.png); }"; - this->m_SearchButton->setToolTip(StrConstants::getClear()); + ui->m_SearchButton->setToolTip(StrConstants::getClear()); } - else this->m_SearchButton->setToolTip(""); + else ui->m_SearchButton->setToolTip(""); return style; } diff --git a/src/searchlineedit.h b/src/searchlineedit.h index 2d1f8053..2ea93f4b 100644 --- a/src/searchlineedit.h +++ b/src/searchlineedit.h @@ -18,11 +18,16 @@ class QStringListModel; enum ValidatorType { ectn_AUR_VALIDATOR, ectn_FILE_VALIDATOR, ectn_DEFAULT_VALIDATOR }; +namespace Ui { +class SearchLineEdit; +} + class SearchLineEdit : public QLineEdit { Q_OBJECT private: + Ui::SearchLineEdit *ui; bool m_hasLocate; QStringListModel *m_completerModel; diff --git a/ui/searchbar.ui b/ui/searchbar.ui new file mode 100644 index 00000000..6f4c0bb1 --- /dev/null +++ b/ui/searchbar.ui @@ -0,0 +1,132 @@ + + + SearchBar + + + SearchBar { + border-top-width: .6px; + border-top-style: solid; + border-top-color: darkgray; +} + + + + 0 + + + 4 + + + 4 + + + 4 + + + 4 + + + + + Close + + + QToolButton { + font-size: 16px; + font-family: verdana; + border-radius: 4px; +} +QToolButton:hover{ background-color: palette(light); } +QToolButton::pressed{ background-color: palette(mid); } + + + + + + Esc + + + true + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 3 + 0 + + + + + + + + + 300 + 0 + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 2 + 0 + + + + + + + + Previous + + + Qt::ToolButtonTextOnly + + + true + + + + + + + Next + + + Qt::ToolButtonTextOnly + + + true + + + + + + + + SearchLineEdit + QLineEdit +
src/searchlineedit.h
+
+
+ + +
diff --git a/ui/searchlineedit.ui b/ui/searchlineedit.ui new file mode 100644 index 00000000..c9b28db7 --- /dev/null +++ b/ui/searchlineedit.ui @@ -0,0 +1,41 @@ + + + SearchLineEdit + + + + 0 + 0 + 196 + 32 + + + + + + + + + 5 + 8 + 18 + 18 + + + + + 18 + 18 + + + + + + + true + + + + + + diff --git a/ui/transactiondialog.ui b/ui/transactiondialog.ui index 3bfb5a2d..02195496 100644 --- a/ui/transactiondialog.ui +++ b/ui/transactiondialog.ui @@ -13,10 +13,7 @@ Form - - - 0 - + QLayout::SetMinimumSize @@ -32,33 +29,7 @@ 10 - - - - - - - 10 - - - - - - - Qt::Vertical - - - QSizePolicy::Maximum - - - - 20 - 50 - - - - - + @@ -68,52 +39,14 @@ - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 2 - - - - - + - - - 0 - 0 - - QDialogButtonBox::No|QDialogButtonBox::Yes - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 5 - - - - - + @@ -123,6 +56,16 @@ + + + + + + + 10 + + +