1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-07-25 11:34:09 -04:00

Implemented new basic channel settings dialog instead of widget inside rollup

This commit is contained in:
f4exb
2017-08-24 02:05:48 +02:00
parent e2ce645c74
commit 01eed29a6f
10 changed files with 310 additions and 67 deletions
+18 -17
View File
@@ -100,23 +100,33 @@ int RollupWidget::arrangeRollups()
QFontMetrics fm(font());
int pos = fm.height() + 4;
for(int i = 0; i < children().count(); ++i) {
for(int i = 0; i < children().count(); ++i)
{
QWidget* r = qobject_cast<QWidget*>(children()[i]);
if(r != NULL) {
if(r != NULL)
{
pos += fm.height() + 2;
if(!r->isHidden()) {
if(!r->isHidden() && (r->windowTitle() != "Basic channel settings"))
{
r->move(2, pos + 3);
int h = 0;
if(r->hasHeightForWidth())
if(r->hasHeightForWidth()) {
h = r->heightForWidth(width() - 4);
else h = r->sizeHint().height();
} else {
h = r->sizeHint().height();
}
r->resize(width() - 4, h);
pos += r->height() + 5;
}
}
}
setMinimumHeight(pos);
setMaximumHeight(pos);
return pos;
}
@@ -205,6 +215,8 @@ void RollupWidget::paintEvent(QPaintEvent*)
int RollupWidget::paintRollup(QWidget* rollup, int pos, QPainter* p, bool last, const QColor& frame)
{
if (rollup->windowTitle() == "Basic channel settings") return 0;
QFontMetrics fm(font());
int height = 1;
@@ -270,7 +282,7 @@ void RollupWidget::mousePressEvent(QMouseEvent* event)
// menu box left
if(QRectF(3.5, 3.5, fm.ascent(), fm.ascent()).contains(event->pos())) {
emit customContextMenuRequested(event->pos());
emit customContextMenuRequested(event->globalPos());
return;
}
@@ -305,17 +317,6 @@ void RollupWidget::mousePressEvent(QMouseEvent* event)
}
}
void RollupWidget::mouseDoubleClickEvent(QMouseEvent* event)
{
QFontMetrics fm(font());
// menu box left
if(QRectF(3.5, 3.5, fm.ascent(), fm.ascent()).contains(event->pos())) {
emit menuDoubleClickEvent();
return;
}
}
bool RollupWidget::event(QEvent* event)
{
if(event->type() == QEvent::ChildAdded) {