~neon/okteta/master

« back to all changes in this revision

Viewing changes to libs/kasten/gui/shell/singleviewarea_p.cpp

  • Committer: Friedrich W. H. Kossebau
  • Date: 2019-02-16 03:41:54 UTC
  • Revision ID: git-v1:a613494cb204c374bce8094204240564b8ba3e63
kastengui: make ToolInlineViewWidget an internal helper of ViewAreaBox

Show diffs side-by-side

added added

removed removed

Lines of Context:
55
55
 
56
56
void SingleViewAreaPrivate::setCurrentToolInlineView(AbstractToolInlineView* view)
57
57
{
58
 
    ToolInlineViewWidget* currentViewWidget =
59
 
        qobject_cast<ToolInlineViewWidget*>(mViewAreaBox->bottomWidget());
60
 
    AbstractToolInlineView* currentToolInlineView =
61
 
        currentViewWidget ? currentViewWidget->view() : nullptr;
62
 
 
63
 
    if (currentToolInlineView != view) {
64
 
        ToolInlineViewWidget* toolInlineViewWidget =
65
 
            view ? new ToolInlineViewWidget(view /*->widget()*/) : nullptr;
66
 
        mViewAreaBox->setBottomWidget(toolInlineViewWidget);
67
 
    }
68
 
 
69
 
    if (view) {
70
 
        view->widget()->setFocus();
71
 
    } else if (mCurrentView) {
72
 
        mCurrentView->setFocus();
73
 
    }
74
 
}
75
 
 
76
 
AbstractToolInlineView* SingleViewAreaPrivate::currentToolInlineView() const
77
 
{
78
 
    ToolInlineViewWidget* currentViewWidget =
79
 
        qobject_cast<ToolInlineViewWidget*>(mViewAreaBox->bottomWidget());
80
 
    AbstractToolInlineView* currentToolInlineView =
81
 
        currentViewWidget ? currentViewWidget->view() : nullptr;
82
 
 
83
 
    return currentToolInlineView;
84
 
}
85
 
 
 
58
    if (mCurrentToolInlineView != view) {
 
59
        mCurrentToolInlineView = view;
 
60
        QWidget* toolInlineViewWidget = mCurrentToolInlineView ? mCurrentToolInlineView->widget() : nullptr;
 
61
        mViewAreaBox->setBottomToolWidget(toolInlineViewWidget);
 
62
    }
 
63
 
 
64
    if (mCurrentToolInlineView) {
 
65
        mViewAreaBox->showBottomToolWidget();
 
66
    }
 
67
}
86
68
 
87
69
void SingleViewAreaPrivate::setView(AbstractView* view)
88
70
{