Skip to content

Commit

Permalink
Clearing CLI of focus get.
Browse files Browse the repository at this point in the history
  • Loading branch information
dvorka committed Jan 6, 2024
1 parent 78cdeec commit 887f33d
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 6 deletions.
11 changes: 11 additions & 0 deletions app/src/qt/cli_n_breadcrumbs_view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,17 @@ void CliView::keyPressEvent(QKeyEvent* event)
QLineEdit::keyPressEvent(event);
}

void CliView::focusInEvent(QFocusEvent* event)
{
MF_DEBUG("CLI: on focus acquired" << std::endl);

if(text() == CLI_HELP_SHADOW_TEXT) {
clear();
}

QLineEdit::focusInEvent(event);
}

void CliView::focusOutEvent(QFocusEvent* event)
{
MF_DEBUG("CLI: on focus lost" << std::endl);
Expand Down
3 changes: 2 additions & 1 deletion app/src/qt/cli_n_breadcrumbs_view.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ class CliView : public QLineEdit
CliAndBreadcrumbsView* cliAndBreadcrumps;

protected:
void focusOutEvent(QFocusEvent*) override;
virtual void focusInEvent(QFocusEvent*) override;
virtual void focusOutEvent(QFocusEvent*) override;

public:
QPalette PALETTE_DISABLED_TEXT;
Expand Down
7 changes: 4 additions & 3 deletions app/src/qt/main_toolbar_view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ MainToolbarView::MainToolbarView(MainWindowView* mainWindowView)
{
// TOOLBAR: L&F driven toolbar icons - dark vs. light

actionFindFts = addAction(
QIcon(":/icons/find-fts.svg"),
"Full-text search");
// REMOVED: button preceding the CLI
//actionFindFts = addAction(
// QIcon(":/icons/find-fts.svg"),
// "Full-text search");

cli = new CliAndBreadcrumbsView{this};
addWidget(cli);
Expand Down
1 change: 0 additions & 1 deletion app/src/qt/main_toolbar_view.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ class MainToolbarView : public QToolBar
QAction* actionViewNavigator;
QAction* actionViewTags;
QAction* actionViewRecentNotes;
QAction* actionFindFts;
QAction* actionHomeOutline;
QAction* actionThink;
QAction* actionScope;
Expand Down
1 change: 0 additions & 1 deletion app/src/qt/main_window_presenter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,6 @@ MainWindowPresenter::MainWindowPresenter(MainWindowView& view)
QObject::connect(view.getToolBar()->actionViewNavigator, SIGNAL(triggered()), this, SLOT(doActionViewKnowledgeGraphNavigator()));
QObject::connect(view.getToolBar()->actionViewTags, SIGNAL(triggered()), this, SLOT(doActionViewTagCloud()));
QObject::connect(view.getToolBar()->actionViewRecentNotes, SIGNAL(triggered()), this, SLOT(doActionViewRecentNotes()));
QObject::connect(view.getToolBar()->actionFindFts, SIGNAL(triggered()), this, SLOT(doActionFts()));
QObject::connect(view.getToolBar()->actionHomeOutline, SIGNAL(triggered()), this, SLOT(doActionViewHome()));
QObject::connect(view.getToolBar()->actionThink, SIGNAL(triggered()), this, SLOT(doActionMindToggleThink()));
QObject::connect(view.getToolBar()->actionScope, SIGNAL(triggered()), this, SLOT(doActionMindTimeTagScope()));
Expand Down

0 comments on commit 887f33d

Please sign in to comment.