2023-04-17 20:12:27 +00:00
|
|
|
#include "searchpanel.hh"
|
2023-03-17 22:42:11 +00:00
|
|
|
#include <QLabel>
|
|
|
|
#include <QVBoxLayout>
|
|
|
|
|
|
|
|
SearchPanel::SearchPanel( QWidget * parent ):
|
|
|
|
QWidget( parent )
|
|
|
|
{
|
|
|
|
lineEdit = new QLineEdit( this );
|
|
|
|
|
|
|
|
close = new QPushButton( this );
|
|
|
|
close->setIcon( QIcon( ":/icons/closetab.svg" ) );
|
|
|
|
|
|
|
|
previous = new QPushButton( this );
|
|
|
|
previous->setIcon( QIcon( ":/icons/previous.svg" ) );
|
|
|
|
previous->setText( tr( "&Previous" ) );
|
2023-04-28 05:56:04 +00:00
|
|
|
previous->setShortcut( QKeySequence( tr( "Ctrl+Shift+G" ) ) );
|
2023-03-17 22:42:11 +00:00
|
|
|
|
|
|
|
next = new QPushButton( this );
|
|
|
|
next->setIcon( QIcon( ":/icons/next.svg" ) );
|
|
|
|
next->setText( tr( "&Next" ) );
|
2023-04-28 05:56:04 +00:00
|
|
|
next->setShortcut( QKeySequence( tr( "Ctrl+G" ) ) );
|
2023-03-17 22:42:11 +00:00
|
|
|
|
|
|
|
caseSensitive = new QCheckBox( this );
|
|
|
|
caseSensitive->setText( tr( "&Case Sensitive" ) );
|
|
|
|
|
|
|
|
auto * searchLabel = new QLabel( tr( "Find:" ) );
|
|
|
|
|
|
|
|
auto * editRow = new QHBoxLayout(); // parent will be set in layout->addLayout.
|
|
|
|
editRow->addWidget( searchLabel );
|
|
|
|
editRow->addWidget( lineEdit );
|
|
|
|
editRow->addWidget( close );
|
|
|
|
|
|
|
|
auto * buttonsRow = new QHBoxLayout();
|
|
|
|
buttonsRow->addWidget( previous );
|
|
|
|
buttonsRow->addWidget( next );
|
|
|
|
buttonsRow->addWidget( caseSensitive );
|
|
|
|
buttonsRow->addStretch();
|
|
|
|
|
|
|
|
auto * layout = new QVBoxLayout( this );
|
|
|
|
layout->addLayout( editRow );
|
|
|
|
layout->addLayout( buttonsRow );
|
|
|
|
}
|