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
@@ -1,8 +1,11 @@
#include "QtCodeFileTitleButton.h"
#include <QMouseEvent>
#include "FileSystem.h"
#include "MessageActivateFile.h"
#include "MessageProjectEdit.h"
#include "MessageTabOpenWith.h"
#include "ResourcePaths.h"
#include "utilityString.h"
@@ -25,6 +28,12 @@ QtCodeFileTitleButton::QtCodeFileTitleButton(QWidget* parent)
setIconSize(QSize(16, 16));
connect(this, &QtCodeFileTitleButton::clicked, this, &QtCodeFileTitleButton::clickedTitle);
m_openInTabAction = new QAction("Open in New Tab", this);
m_openInTabAction->setStatusTip("Opens the file in a new tab");
m_openInTabAction->setToolTip("Opens the file in a new tab");
m_openInTabAction->setEnabled(false);
connect(m_openInTabAction, &QAction::triggered, this, &QtCodeFileTitleButton::openInTab);
}
QtCodeFileTitleButton::~QtCodeFileTitleButton()
@@ -147,6 +156,17 @@ void QtCodeFileTitleButton::updateFromOther(const QtCodeFileTitleButton* other)
updateTexts();
}
void QtCodeFileTitleButton::mouseReleaseEvent(QMouseEvent* event)
{
if (event->button() == Qt::MiddleButton)
{
openInTab();
return;
}
QtSelfRefreshIconButton::mouseReleaseEvent(event);
}
void QtCodeFileTitleButton::contextMenuEvent(QContextMenuEvent* event)
{
FilePath path = m_filePath;
@@ -161,7 +181,11 @@ void QtCodeFileTitleButton::contextMenuEvent(QContextMenuEvent* event)
path = currentProject->getProjectSettingsFilePath();
}
m_openInTabAction->setEnabled(!m_filePath.empty());
QtContextMenu menu(event, this);
menu.addAction(m_openInTabAction);
menu.addUndoActions();
menu.addSeparator();
menu.addFileActions(path);
menu.show();
@@ -186,6 +210,14 @@ void QtCodeFileTitleButton::clickedTitle()
}
}
void QtCodeFileTitleButton::openInTab()
{
if (!m_filePath.empty())
{
MessageTabOpenWith(m_filePath).dispatch();
}
}
void QtCodeFileTitleButton::updateIcon()
{
if (m_filePath.empty())