ui: Added history of last active symbols to UI and menu (issue 151)

* holding down back or forward button shows list of current back-forward stack
* added narrow button between back and forward to show the list
* added History menu
* moved back and forward actions to History menu
* show chronological list of recently active symbols in History menu

bug id = 151

fortune cookie message = Dein Geschäft wird gut laufen und expandieren.
This commit is contained in:
Eberhard Graether
2017-05-09 17:14:43 +02:00
parent bb8c2ae5a9
commit f4caacacf2
30 changed files with 668 additions and 65 deletions
+36 -29
View File
@@ -1,17 +1,13 @@
#include "qt/view/QtUndoRedoView.h"
#include "utility/ResourcePaths.h"
#include "qt/utility/utilityQt.h"
#include "qt/view/QtMainView.h"
#include "qt/view/QtViewWidgetWrapper.h"
#include "utility/ResourcePaths.h"
QtUndoRedoView::QtUndoRedoView(ViewLayout* viewLayout)
: UndoRedoView(viewLayout)
, m_refreshFunctor(std::bind(&QtUndoRedoView::doRefreshView, this))
, m_setRedoButtonEnabledFunctor(std::bind(&QtUndoRedoView::doSetRedoButtonEnabled, this, std::placeholders::_1))
, m_setUndoButtonEnabledFunctor(std::bind(&QtUndoRedoView::doSetUndoButtonEnabled, this, std::placeholders::_1))
{
m_widget = new QtUndoRedo();
setStyleSheet();
@@ -32,36 +28,47 @@ void QtUndoRedoView::initView()
void QtUndoRedoView::refreshView()
{
m_refreshFunctor();
}
void QtUndoRedoView::setStyleSheet()
{
m_widget->setStyleSheet(utility::getStyleSheet(ResourcePaths::getGuiPath().concat(FilePath("undoredo_view/undoredo_view.css"))).c_str());
}
void QtUndoRedoView::doRefreshView()
{
setStyleSheet();
m_widget->refreshStyle();
}
void QtUndoRedoView::doSetRedoButtonEnabled(bool enabled)
{
m_widget->setRedoButtonEnabled(enabled);
}
void QtUndoRedoView::doSetUndoButtonEnabled(bool enabled)
{
m_widget->setUndoButtonEnabled(enabled);
m_onQtThread(
[=]()
{
setStyleSheet();
m_widget->refreshStyle();
}
);
}
void QtUndoRedoView::setRedoButtonEnabled(bool enabled)
{
m_setRedoButtonEnabledFunctor(enabled);
m_onQtThread(
[=]()
{
m_widget->setRedoButtonEnabled(enabled);
}
);
}
void QtUndoRedoView::setUndoButtonEnabled(bool enabled)
{
m_setUndoButtonEnabledFunctor(enabled);
m_onQtThread(
[=]()
{
m_widget->setUndoButtonEnabled(enabled);
}
);
}
void QtUndoRedoView::updateHistory(const std::vector<SearchMatch>& searchMatches, size_t currentIndex)
{
m_onQtThread(
[=]()
{
m_widget->updateHistory(searchMatches, currentIndex);
}
);
}
void QtUndoRedoView::setStyleSheet()
{
m_widget->setStyleSheet(utility::getStyleSheet(
ResourcePaths::getGuiPath().concat(FilePath("undoredo_view/undoredo_view.css"))).c_str());
}