kopia lustrzana https://github.com/f4exb/sdrangel
Massive UI revamping (v7): Removed forceClose
rodzic
ec7a10e662
commit
8a3d2bd497
|
@ -28,6 +28,7 @@
|
|||
|
||||
#include "mainwindow.h"
|
||||
#include "gui/workspaceselectiondialog.h"
|
||||
#include "gui/rollupcontents.h"
|
||||
|
||||
#include "channelgui.h"
|
||||
|
||||
|
@ -129,7 +130,8 @@ ChannelGUI::ChannelGUI(QWidget *parent) :
|
|||
m_topLayout->addWidget(m_sizeGripTopRight, 0, Qt::AlignTop | Qt::AlignRight);
|
||||
|
||||
m_centerLayout = new QHBoxLayout();
|
||||
m_centerLayout->addWidget(&m_rollupContents);
|
||||
m_rollupContents = new RollupContents(); // Do not delete! Done in child's destructor with "delete ui"
|
||||
m_centerLayout->addWidget(m_rollupContents);
|
||||
|
||||
m_bottomLayout = new QHBoxLayout();
|
||||
m_bottomLayout->setContentsMargins(0, 0, 0, 0);
|
||||
|
@ -157,7 +159,7 @@ ChannelGUI::ChannelGUI(QWidget *parent) :
|
|||
connect(m_closeButton, SIGNAL(clicked()), this, SLOT(close()));
|
||||
|
||||
connect(
|
||||
&m_rollupContents,
|
||||
m_rollupContents,
|
||||
&RollupContents::widgetRolled,
|
||||
this,
|
||||
&ChannelGUI::onWidgetRolled
|
||||
|
@ -258,13 +260,13 @@ void ChannelGUI::onWidgetRolled(QWidget *widget, bool show)
|
|||
{
|
||||
// qDebug("ChannelGUI::onWidgetRolled: show: %d %d", m_rollupContents.height(), widget->height());
|
||||
int dh = m_heightsMap.contains(widget) ? m_heightsMap[widget] - widget->height() : widget->minimumHeight();
|
||||
resize(width(), 52 + m_rollupContents.height() + dh);
|
||||
resize(width(), 52 + 3 + m_rollupContents->height() + dh);
|
||||
}
|
||||
else
|
||||
{
|
||||
// qDebug("ChannelGUI::onWidgetRolled: hide: %d %d", m_rollupContents.height(), widget->height());
|
||||
m_heightsMap[widget] = widget->height();
|
||||
resize(width(), 52 + m_rollupContents.height());
|
||||
resize(width(), 52 + 3 + m_rollupContents->height());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
#include <QMdiSubWindow>
|
||||
#include <QMap>
|
||||
|
||||
#include "gui/rollupcontents.h"
|
||||
#include "export.h"
|
||||
|
||||
class QCloseEvent;
|
||||
|
@ -31,6 +30,7 @@ class QPushButton;
|
|||
class QVBoxLayout;
|
||||
class QHBoxLayout;
|
||||
class QSizeGrip;
|
||||
class RollupContents;
|
||||
|
||||
class SDRGUI_API ChannelGUI : public QMdiSubWindow
|
||||
{
|
||||
|
@ -69,7 +69,7 @@ public:
|
|||
|
||||
virtual MessageQueue* getInputMessageQueue() = 0;
|
||||
|
||||
RollupContents *getRollupContents() { return &m_rollupContents; }
|
||||
RollupContents *getRollupContents() { return m_rollupContents; }
|
||||
void setTitle(const QString& title);
|
||||
void setTitleColor(const QColor& c);
|
||||
void setDeviceType(DeviceType type);
|
||||
|
@ -93,7 +93,7 @@ protected:
|
|||
int m_deviceSetIndex;
|
||||
int m_channelIndex;
|
||||
QString m_helpURL;
|
||||
RollupContents m_rollupContents;
|
||||
RollupContents* m_rollupContents;
|
||||
ContextMenuType m_contextMenuType;
|
||||
|
||||
protected slots:
|
||||
|
|
|
@ -145,7 +145,7 @@ DeviceGUI::DeviceGUI(QWidget *parent) :
|
|||
m_topLayout->addWidget(m_sizeGripTopRight, 0, Qt::AlignTop | Qt::AlignRight);
|
||||
|
||||
m_centerLayout = new QHBoxLayout();
|
||||
m_contents = new QWidget();
|
||||
m_contents = new QWidget(); // Do not delete! Done in child's destructor with "delete ui"
|
||||
m_centerLayout->addWidget(m_contents);
|
||||
|
||||
m_bottomLayout = new QHBoxLayout();
|
||||
|
@ -175,7 +175,6 @@ DeviceGUI::DeviceGUI(QWidget *parent) :
|
|||
connect(m_shrinkButton, SIGNAL(clicked()), this, SLOT(shrinkWindow()));
|
||||
connect(this, SIGNAL(forceShrink()), this, SLOT(shrinkWindow()));
|
||||
connect(m_closeButton, SIGNAL(clicked()), this, SLOT(close()));
|
||||
connect(this, SIGNAL(forceClose()), this, SLOT(close()));
|
||||
connect(m_showSpectrumButton, SIGNAL(clicked()), this, SLOT(showSpectrumHandler()));
|
||||
connect(m_showAllChannelsButton, SIGNAL(clicked()), this, SLOT(showAllChannelsHandler()));
|
||||
|
||||
|
@ -209,7 +208,6 @@ DeviceGUI::~DeviceGUI()
|
|||
delete m_reloadDeviceButton;
|
||||
delete m_changeDeviceButton;
|
||||
delete m_indexLabel;
|
||||
delete m_contents;
|
||||
qDebug("DeviceGUI::~DeviceGUI: end");
|
||||
}
|
||||
|
||||
|
|
|
@ -134,7 +134,6 @@ private slots:
|
|||
void deviceSetPresetsDialog();
|
||||
|
||||
signals:
|
||||
void forceClose();
|
||||
void closing();
|
||||
void moveToWorkspace(int workspaceIndex);
|
||||
void forceShrink();
|
||||
|
|
|
@ -135,7 +135,6 @@ MainSpectrumGUI::MainSpectrumGUI(GLSpectrum *spectrum, GLSpectrumGUI *spectrumGU
|
|||
connect(m_shrinkButton, SIGNAL(clicked()), this, SLOT(shrinkWindow()));
|
||||
connect(this, SIGNAL(forceShrink()), this, SLOT(shrinkWindow()));
|
||||
connect(m_hideButton, SIGNAL(clicked()), this, SLOT(hide()));
|
||||
connect(this, SIGNAL(forceClose()), this, SLOT(close()));
|
||||
|
||||
shrinkWindow();
|
||||
}
|
||||
|
|
|
@ -100,7 +100,6 @@ private slots:
|
|||
void shrinkWindow();
|
||||
|
||||
signals:
|
||||
void forceClose();
|
||||
void closing();
|
||||
void moveToWorkspace(int workspaceIndex);
|
||||
void forceShrink();
|
||||
|
|
|
@ -509,7 +509,7 @@ void MainWindow::sampleSourceCreate(
|
|||
|
||||
// delete previous GUI if it exists
|
||||
if (deviceUISet->m_deviceGUI) {
|
||||
emit deviceUISet->m_deviceGUI->forceClose();
|
||||
emit deviceUISet->m_deviceGUI->destroy();
|
||||
}
|
||||
|
||||
// constructs new GUI and input object
|
||||
|
@ -727,7 +727,7 @@ void MainWindow::sampleSinkCreate(
|
|||
|
||||
// delete previous plugin GUI if it exists
|
||||
if (deviceUISet->m_deviceGUI) {
|
||||
emit deviceUISet->m_deviceGUI->forceClose();
|
||||
emit deviceUISet->m_deviceGUI->destroy();
|
||||
}
|
||||
|
||||
// constructs new GUI and output object
|
||||
|
@ -919,7 +919,7 @@ void MainWindow::sampleMIMOCreate(
|
|||
|
||||
// delete previous plugin GUI if it exists
|
||||
if (deviceUISet->m_deviceGUI) {
|
||||
emit deviceUISet->m_deviceGUI->forceClose();
|
||||
emit deviceUISet->m_deviceGUI->destroy();
|
||||
}
|
||||
|
||||
// constructs new GUI and output object
|
||||
|
|
Ładowanie…
Reference in New Issue