ui: Added tabs UI to top of main window (issue #215)

* Added tab bar to top of main window with UI/shortcuts similar to web browsers
* ComponentManager offers components for 2 use-cases: application and tab
* Application components: log view (status/errors), bookmarks, screen search, status bar, tabs, tooltips, dialogs and all tab views disabled
* Tab components: graph, code, history and search
* When a project is loaded there is always at least one tab, otherwise there is none
* Each tab replaces the application views of the same name in the main layout when activated
* Each tab has it's own TaskScheduler, to process tasks independent from other tabs
* The application has a global TaskScheduler for application wide tasks
* The singloton class TaskManager is responsible for managing the TaskSchedulers
* MessageListeners and Messages hold an optional schedulerId, both must be set to only send to a specific TaskScheduler
* Bookmark buttons where split off into a separate view per tab, bookmark managemement is done in the application
* History menu processing is done by the QtMainWindow now
* Screen search is an application component, the responders are always changed to the active tab
* Plugin messages are opened in a new tab
* Symbols can be opened in a new tab via middle click/context menu in graph, code, history dropdown
* Full text index creation is mutexed now in PersistenStorage to make it fully thread-safe
* All tabs are closed when switching projects
* Tab contents are only animated when visible

fortune cookie message = Catch your lucky star!
This commit is contained in:
Eberhard Graether
2018-11-05 01:28:12 +01:00
parent bd4a554b27
commit f13aec70dd
170 changed files with 2972 additions and 823 deletions
+23 -1
View File
@@ -10,6 +10,7 @@
#include "MessageShowError.h"
#include "MessageScrollCode.h"
#include "ResourcePaths.h"
#include "TabId.h"
#include "utility.h"
#include "SourceLocation.h"
@@ -26,6 +27,7 @@ QtCodeNavigator::QtCodeNavigator(QWidget* parent)
: QWidget(parent)
, m_mode(MODE_NONE)
, m_oldMode(MODE_NONE)
, m_schedulerId(TabId::ignore())
, m_activeTokenId(0)
, m_value(0)
, m_refIndex(0)
@@ -338,6 +340,16 @@ void QtCodeNavigator::setMode(Mode mode)
}
}
Id QtCodeNavigator::getSchedulerId() const
{
return m_schedulerId;
}
void QtCodeNavigator::setSchedulerId(Id schedulerId)
{
m_schedulerId = schedulerId;
}
const std::set<Id>& QtCodeNavigator::getCurrentActiveTokenIds() const
{
return m_currentActiveTokenIds;
@@ -708,6 +720,11 @@ void QtCodeNavigator::deactivateScreenMatch(size_t matchIndex)
m_activeScreenMatchId = 0;
}
bool QtCodeNavigator::hasScreenMatches() const
{
return !m_screenMatches.empty();
}
void QtCodeNavigator::clearScreenMatches()
{
if (m_activeScreenMatchId)
@@ -847,7 +864,7 @@ void QtCodeNavigator::requestScroll(
void QtCodeNavigator::handleScrollRequest()
{
const ScrollRequest& req = m_scrollRequest;
if (req.filePath.empty())
if (req.filePath.empty() || !isVisible())
{
return;
}
@@ -871,6 +888,11 @@ void QtCodeNavigator::scrolled(int value)
MessageScrollCode(value, m_mode == MODE_LIST).dispatch();
}
void QtCodeNavigator::showEvent(QShowEvent* event)
{
emit scrollRequest();
}
void QtCodeNavigator::setValue()
{
QAbstractScrollArea* area = m_current->getScrollArea();