#include "GuiDialog.h"
#include "DockView.h"
+#include "FancyLineEdit.h"
+#include <QMenu>
#include <QDockWidget>
#include "ui_SearchUi.h"
Q_OBJECT
public:
- GuiSearchWidget(QWidget * parent);
+ GuiSearchWidget(QWidget * parent, GuiView & view);
///
void saveSession(QSettings & settings, QString const & session_key) const;
///
private Q_SLOTS:
void findChanged();
void findBufferChanged();
- void findClicked(bool const backwards = false,
- bool const instant = false);
+ void findClicked();
void findPrevClicked();
- void replaceClicked(bool const backwards = false);
+ void replaceClicked();
void replacePrevClicked();
void replaceallClicked();
void minimizeClicked(bool const toggle = true);
+ void caseSenseActTriggered();
+ void wholeWordsActTriggered();
+ void searchSelActTriggered();
+ void immediateActTriggered();
+ void immediateClicked();
+ void wrapActTriggered();
Q_SIGNALS:
void needTitleBarUpdate() const;
void needSizeUpdate() const;
void keyPressEvent(QKeyEvent * e) override;
///
void showEvent(QShowEvent * e) override;
+ ///
+ void hideEvent(QHideEvent * e) override;
+ ///
+ void doFind(bool const backwards = false,
+ bool const instant = false);
+ ///
+ void doReplace(bool const backwards = false);
/// Searches occurrence of string
void find(docstring const & search,
bool casesensitive, bool matchword,
bool casesensitive, bool matchword,
bool forward, bool all, bool wrap, bool onlysel);
///
+ void handleIndicators();
+ ///
BufferView const * bv_ = nullptr;
///
+ GuiView & view_;
+ ///
bool minimized_ = false;
+ /// contains the search box
+ FancyLineEdit * findLE_;
+ /// The options menu
+ QMenu * menu_;
+ /// And its actions
+ QAction * act_casesense_ = new QAction(this);
+ ///
+ QAction * act_wholewords_ = new QAction(this);
+ ///
+ QAction * act_selection_ = new QAction(this);
+ ///
+ QAction * act_immediate_ = new QAction(this);
+ ///
+ QAction * act_wrap_ = new QAction(this);
};
protected:
bool wantInitialFocus() const override { return true; }
+ void mouseMoveEvent(QMouseEvent * event) override;
+ void mousePressEvent(QMouseEvent * event) override;
+ void mouseDoubleClickEvent(QMouseEvent *event) override;
public Q_SLOTS:
///
private:
/// The encapsulated widget.
GuiSearchWidget * widget_;
+ ///
+ QPoint dragPosition;
};
} // namespace frontend