* 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!
55 lines
1.1 KiB
C++
55 lines
1.1 KiB
C++
#ifndef QT_TABS_VIEW_H
|
|
#define QT_TABS_VIEW_H
|
|
|
|
#include <QObject>
|
|
|
|
#include "TabsController.h"
|
|
#include "TabsView.h"
|
|
#include "QtThreadedFunctor.h"
|
|
|
|
class QtTabBar;
|
|
|
|
class QtTabsView
|
|
: public QObject
|
|
, public TabsView
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
QtTabsView(ViewLayout* viewLayout);
|
|
virtual ~QtTabsView() = default;
|
|
|
|
// View implementation
|
|
void createWidgetWrapper() override;
|
|
void initView() override;
|
|
void refreshView() override;
|
|
|
|
// TabsView implementation
|
|
void clear() override;
|
|
void openTab(bool showTab, SearchMatch match) override;
|
|
void closeTab() override;
|
|
void destroyTab(Id tabId) override;
|
|
void selectTab(bool next) override;
|
|
void updateTab(Id tabId, std::vector<SearchMatch> matches) override;
|
|
|
|
private slots:
|
|
void addTab();
|
|
void insertTab(bool showTab, SearchMatch match);
|
|
void changedTab(int index);
|
|
void removeTab(int index);
|
|
|
|
private:
|
|
void setTabState(int idx, const std::vector<SearchMatch>& matches);
|
|
|
|
void setStyleSheet();
|
|
|
|
QtThreadedLambdaFunctor m_onQtThread;
|
|
|
|
QWidget* m_widget;
|
|
QtTabBar* m_tabBar;
|
|
|
|
size_t m_insertedTabCount;
|
|
};
|
|
|
|
#endif // QT_TABS_VIEW_H
|