2022-08-19 15:59:36 +02:00
|
|
|
// Copyright (C) 2016 The Qt Company Ltd.
|
2022-12-21 10:12:09 +01:00
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
2008-12-02 15:08:31 +01:00
|
|
|
|
2016-03-18 07:55:01 +01:00
|
|
|
#pragma once
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2020-06-17 09:14:47 +02:00
|
|
|
#include "core_global.h"
|
2020-09-21 13:30:57 +02:00
|
|
|
|
|
|
|
|
#include <utils/id.h>
|
2008-12-02 15:08:31 +01:00
|
|
|
|
2012-02-15 10:42:41 +01:00
|
|
|
#include <QWidget>
|
|
|
|
|
#include <QPointer>
|
2009-10-01 16:38:08 +02:00
|
|
|
|
2009-10-01 17:09:10 +02:00
|
|
|
QT_BEGIN_NAMESPACE
|
2009-10-01 16:38:08 +02:00
|
|
|
class QSettings;
|
2009-10-01 17:09:10 +02:00
|
|
|
QT_END_NAMESPACE
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2020-12-10 11:24:27 +01:00
|
|
|
namespace Utils {
|
|
|
|
|
class QtcSettings;
|
|
|
|
|
}
|
|
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
namespace Core {
|
|
|
|
|
|
|
|
|
|
class RightPaneWidget;
|
|
|
|
|
|
|
|
|
|
class CORE_EXPORT RightPanePlaceHolder : public QWidget
|
|
|
|
|
{
|
|
|
|
|
friend class Core::RightPaneWidget;
|
|
|
|
|
Q_OBJECT
|
2009-01-26 15:27:04 +01:00
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
public:
|
2020-06-26 13:59:38 +02:00
|
|
|
explicit RightPanePlaceHolder(Utils::Id mode, QWidget *parent = nullptr);
|
2018-05-07 15:00:03 +02:00
|
|
|
~RightPanePlaceHolder() override;
|
2008-12-02 12:01:29 +01:00
|
|
|
static RightPanePlaceHolder *current();
|
2009-01-26 15:27:04 +01:00
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
private:
|
2020-06-26 13:59:38 +02:00
|
|
|
void currentModeChanged(Utils::Id mode);
|
2008-12-02 12:01:29 +01:00
|
|
|
void applyStoredSize(int width);
|
2020-06-26 13:59:38 +02:00
|
|
|
Utils::Id m_mode;
|
2008-12-02 12:01:29 +01:00
|
|
|
static RightPanePlaceHolder* m_current;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class CORE_EXPORT RightPaneWidget : public QWidget
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
2009-01-26 15:27:04 +01:00
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
public:
|
|
|
|
|
RightPaneWidget();
|
2018-05-07 15:00:03 +02:00
|
|
|
~RightPaneWidget() override;
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2020-12-10 11:24:27 +01:00
|
|
|
void saveSettings(Utils::QtcSettings *settings);
|
2008-12-02 12:01:29 +01:00
|
|
|
void readSettings(QSettings *settings);
|
|
|
|
|
|
2020-12-10 00:59:50 +01:00
|
|
|
bool isShown() const;
|
2008-12-02 12:01:29 +01:00
|
|
|
void setShown(bool b);
|
|
|
|
|
|
2009-01-26 15:27:04 +01:00
|
|
|
static RightPaneWidget *instance();
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2011-02-24 14:00:04 +02:00
|
|
|
void setWidget(QWidget *widget);
|
2019-03-21 14:10:15 +01:00
|
|
|
QWidget *widget() const;
|
2011-02-24 14:00:04 +02:00
|
|
|
|
2020-12-10 00:59:50 +01:00
|
|
|
int storedWidth() const;
|
2009-01-26 15:27:04 +01:00
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
protected:
|
2018-05-07 15:00:03 +02:00
|
|
|
void resizeEvent(QResizeEvent *) override;
|
2009-01-26 15:27:04 +01:00
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
private:
|
2011-02-24 14:00:04 +02:00
|
|
|
void clearWidget();
|
2018-07-21 21:11:46 +02:00
|
|
|
bool m_shown = true;
|
|
|
|
|
int m_width = 0;
|
2011-03-03 16:46:57 +01:00
|
|
|
QPointer<QWidget> m_widget;
|
2008-12-02 12:01:29 +01:00
|
|
|
static RightPaneWidget *m_instance;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace Core
|