Changeset View
Changeset View
Standalone View
Standalone View
src/ViewContainer.h
Show First 20 Lines • Show All 399 Lines • ▼ Show 20 Line(s) | 391 | public: | |||
---|---|---|---|---|---|
400 | QWidget *containerWidget() const Q_DECL_OVERRIDE; | 400 | QWidget *containerWidget() const Q_DECL_OVERRIDE; | ||
401 | QWidget *activeView() const Q_DECL_OVERRIDE; | 401 | QWidget *activeView() const Q_DECL_OVERRIDE; | ||
402 | void setActiveView(QWidget *view) Q_DECL_OVERRIDE; | 402 | void setActiveView(QWidget *view) Q_DECL_OVERRIDE; | ||
403 | QList<NavigationPosition> supportedNavigationPositions() const Q_DECL_OVERRIDE; | 403 | QList<NavigationPosition> supportedNavigationPositions() const Q_DECL_OVERRIDE; | ||
404 | void setFeatures(Features features) Q_DECL_OVERRIDE; | 404 | void setFeatures(Features features) Q_DECL_OVERRIDE; | ||
405 | Features supportedFeatures() const Q_DECL_OVERRIDE; | 405 | Features supportedFeatures() const Q_DECL_OVERRIDE; | ||
406 | void setNewViewMenu(QMenu *menu) Q_DECL_OVERRIDE; | 406 | void setNewViewMenu(QMenu *menu) Q_DECL_OVERRIDE; | ||
407 | void setStyleSheet(const QString &styleSheet) Q_DECL_OVERRIDE; | 407 | void setStyleSheet(const QString &styleSheet) Q_DECL_OVERRIDE; | ||
408 | void setTabBarVisible(bool visible); | ||||
408 | 409 | | |||
409 | // return associated view manager | 410 | // return associated view manager | ||
410 | ViewManager *connectedViewManager(); | 411 | ViewManager *connectedViewManager(); | ||
411 | 412 | | |||
412 | protected: | 413 | protected: | ||
413 | void addViewWidget(QWidget *view, int index) Q_DECL_OVERRIDE; | 414 | void addViewWidget(QWidget *view, int index) Q_DECL_OVERRIDE; | ||
414 | void removeViewWidget(QWidget *view) Q_DECL_OVERRIDE; | 415 | void removeViewWidget(QWidget *view) Q_DECL_OVERRIDE; | ||
415 | void navigationVisibilityChanged(NavigationVisibility mode) Q_DECL_OVERRIDE; | 416 | void navigationVisibilityChanged(NavigationVisibility mode) Q_DECL_OVERRIDE; | ||
Show All 23 Lines | |||||
439 | Q_SIGNALS: | 440 | Q_SIGNALS: | ||
440 | void detachTab(ViewContainer *self, QWidget *activeView); | 441 | void detachTab(ViewContainer *self, QWidget *activeView); | ||
441 | void closeTab(ViewContainer *self, QWidget *activeView); | 442 | void closeTab(ViewContainer *self, QWidget *activeView); | ||
442 | 443 | | |||
443 | private: | 444 | private: | ||
444 | Q_DISABLE_COPY(TabbedViewContainer) | 445 | Q_DISABLE_COPY(TabbedViewContainer) | ||
445 | 446 | | |||
446 | void dynamicTabBarVisibility(); | 447 | void dynamicTabBarVisibility(); | ||
447 | void setTabBarVisible(bool visible); | | |||
448 | void setTabActivity(int index, bool activity); | 448 | void setTabActivity(int index, bool activity); | ||
449 | void renameTab(int index); | 449 | void renameTab(int index); | ||
450 | void updateVisibilityOfQuickButtons(); | 450 | void updateVisibilityOfQuickButtons(); | ||
451 | void widgetRemoved(int index); | 451 | void widgetRemoved(int index); | ||
452 | 452 | | |||
453 | ViewContainerTabBar *_tabBar; | 453 | ViewContainerTabBar *_tabBar; | ||
454 | QPointer<QStackedWidget> _stackWidget; | 454 | QPointer<QStackedWidget> _stackWidget; | ||
455 | QPointer<QWidget> _containerWidget; | 455 | QPointer<QWidget> _containerWidget; | ||
456 | ViewManager *_connectedViewManager; | 456 | ViewManager *_connectedViewManager; | ||
457 | QVBoxLayout *_layout; | 457 | QVBoxLayout *_layout; | ||
458 | QHBoxLayout *_tabBarLayout; | 458 | QHBoxLayout *_tabBarLayout; | ||
459 | QToolButton *_newTabButton; | 459 | QToolButton *_newTabButton; | ||
460 | QToolButton *_closeTabButton; | 460 | QToolButton *_closeTabButton; | ||
461 | int _contextMenuTabIndex; | 461 | int _contextMenuTabIndex; | ||
462 | QMenu *_contextPopupMenu; | 462 | QMenu *_contextPopupMenu; | ||
463 | }; | 463 | }; | ||
464 | 464 | | |||
465 | /** A plain view container with no navigation display */ | | |||
466 | class StackedViewContainer : public ViewContainer | | |||
467 | { | | |||
468 | Q_OBJECT | | |||
469 | | ||||
470 | public: | | |||
471 | explicit StackedViewContainer(QObject *parent); | | |||
472 | ~StackedViewContainer() Q_DECL_OVERRIDE; | | |||
473 | | ||||
474 | QWidget *containerWidget() const Q_DECL_OVERRIDE; | | |||
475 | QWidget *activeView() const Q_DECL_OVERRIDE; | | |||
476 | void setActiveView(QWidget *view) Q_DECL_OVERRIDE; | | |||
477 | | ||||
478 | protected: | | |||
479 | void addViewWidget(QWidget *view, int index) Q_DECL_OVERRIDE; | | |||
480 | void removeViewWidget(QWidget *view) Q_DECL_OVERRIDE; | | |||
481 | | ||||
482 | private: | | |||
483 | QPointer<QWidget> _containerWidget; | | |||
484 | QPointer<QStackedWidget> _stackWidget; | | |||
485 | }; | | |||
486 | } | 465 | } | ||
487 | #endif //VIEWCONTAINER_H | 466 | #endif //VIEWCONTAINER_H |