Commit 1f43b75c authored by Christoph Cullmann's avatar Christoph Cullmann 🍨
Browse files

cleanups

remove stackwidget for central widget, no longer needed
as quick open and Co. are no dialogs

make some stuff protected
parent 015bf1b4
Pipeline #238132 passed with stage
in 9 minutes and 46 seconds
......@@ -68,6 +68,7 @@
#include <QMimeData>
#include <QMimeDatabase>
#include <QScreen>
#include <QStackedWidget>
#include <QTimer>
#include <QToolButton>
......@@ -257,20 +258,9 @@ void KateMainWindow::setupImportantActions()
void KateMainWindow::setupMainWindow()
{
setToolViewStyle(KMultiTabBar::KDEV3ICON);
/**
* create central stacked widget with its children
*/
m_mainStackedWidget = new QStackedWidget(centralWidget());
centralWidget()->layout()->addWidget(m_mainStackedWidget);
(static_cast<QBoxLayout *>(centralWidget()->layout()))->setStretchFactor(m_mainStackedWidget, 100);
m_viewManager = new KateViewManager(m_mainStackedWidget, this);
m_mainStackedWidget->addWidget(m_viewManager);
// make view manager default visible!
m_mainStackedWidget->setCurrentWidget(m_viewManager);
m_viewManager = new KateViewManager(centralWidget(), this);
centralWidget()->layout()->addWidget(m_viewManager);
(static_cast<QBoxLayout *>(centralWidget()->layout()))->setStretchFactor(m_viewManager, 100);
m_bottomViewBarContainer = new QWidget(centralWidget());
centralWidget()->layout()->addWidget(m_bottomViewBarContainer);
......@@ -773,11 +763,6 @@ void KateMainWindow::slotWindowActivated()
updateCaption(m_viewManager->activeView()->document());
}
// show view manager in any case
if (m_mainStackedWidget->currentWidget() != m_viewManager) {
m_mainStackedWidget->setCurrentWidget(m_viewManager);
}
// update proxy
centralWidget()->setFocusProxy(m_viewManager->activeView());
}
......
......@@ -25,7 +25,6 @@
#include <QEvent>
#include <QHash>
#include <QStackedLayout>
#include <QStackedWidget>
#include <QUrl>
class QMenu;
......@@ -590,11 +589,6 @@ private:
*/
bool m_modCloseAfterLast = false;
/**
* stacked widget containing the central area, aka view manager, quickopen, ...
*/
QStackedWidget *m_mainStackedWidget = nullptr;
/**
* keeps track of views
*/
......
......@@ -1312,6 +1312,9 @@ MainWindow::MainWindow(QWidget *parentWidget)
bottomHBoxLaout->setStretch(0, 100);
toplevelVBox->addLayout(bottomHBoxLaout);
// ensure proper toolview style
setToolViewStyle(KMultiTabBar::KDEV3ICON);
for (const auto &sidebar : m_sidebars) {
connect(sidebar.get(), &Sidebar::sigShowPluginConfigPage, this, &MainWindow::sigShowPluginConfigPage);
}
......
......@@ -442,19 +442,6 @@ public:
*/
ToolView *toolView(const QString &identifier) const;
/**
* set the toolview's tabbar style.
* @param style the tabbar style.
*/
void setToolViewStyle(KMultiTabBar::KMultiTabBarStyle style);
/**
* get the toolview's tabbar style. Call this before @p startRestore(),
* otherwise you overwrite the usersettings.
* @return toolview's tabbar style
*/
KMultiTabBar::KMultiTabBarStyle toolViewStyle() const;
/**
* get the sidebars' visibility.
* @return false, if the sidebars' visibility is forced hidden, otherwise true
......@@ -494,6 +481,19 @@ protected:
*/
void toolViewDeleted(ToolView *widget);
/**
* set the toolview's tabbar style.
* @param style the tabbar style.
*/
void setToolViewStyle(KMultiTabBar::KMultiTabBarStyle style);
/**
* get the toolview's tabbar style. Call this before @p startRestore(),
* otherwise you overwrite the usersettings.
* @return toolview's tabbar style
*/
KMultiTabBar::KMultiTabBarStyle toolViewStyle() const;
public:
/**
* central widget ;)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment