mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-01 03:43:24 +00:00
Dive site rewrite: correctly position the edit site widget
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
32928b3880
commit
6afd9161e8
3 changed files with 19 additions and 3 deletions
|
@ -228,7 +228,7 @@ void LocationInformationWidget::resetPallete()
|
||||||
}
|
}
|
||||||
|
|
||||||
SimpleDiveSiteEditDialog::SimpleDiveSiteEditDialog(QWidget *parent) :
|
SimpleDiveSiteEditDialog::SimpleDiveSiteEditDialog(QWidget *parent) :
|
||||||
QDialog(parent, Qt::FramelessWindowHint | Qt::WindowSystemMenuHint),
|
QDialog(parent, Qt::FramelessWindowHint | Qt::WindowSystemMenuHint | Qt::Popup),
|
||||||
ui(new Ui::SimpleDiveSiteEditDialog())
|
ui(new Ui::SimpleDiveSiteEditDialog())
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
@ -238,3 +238,18 @@ SimpleDiveSiteEditDialog::~SimpleDiveSiteEditDialog()
|
||||||
{
|
{
|
||||||
delete ui;
|
delete ui;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SimpleDiveSiteEditDialog::showEvent(QShowEvent *ev)
|
||||||
|
{
|
||||||
|
const int heigth = 190;
|
||||||
|
const int width = 280;
|
||||||
|
|
||||||
|
QDialog::showEvent(ev);
|
||||||
|
QRect currGeometry = geometry();
|
||||||
|
currGeometry.setX(QCursor::pos().x() + 10);
|
||||||
|
currGeometry.setY(QCursor::pos().y() - heigth / 2);
|
||||||
|
currGeometry.setWidth(width);
|
||||||
|
currGeometry.setHeight(heigth);
|
||||||
|
setGeometry(currGeometry);
|
||||||
|
ev->accept();
|
||||||
|
}
|
||||||
|
|
|
@ -51,7 +51,8 @@ Q_OBJECT
|
||||||
public:
|
public:
|
||||||
SimpleDiveSiteEditDialog(QWidget *parent);
|
SimpleDiveSiteEditDialog(QWidget *parent);
|
||||||
virtual ~SimpleDiveSiteEditDialog();
|
virtual ~SimpleDiveSiteEditDialog();
|
||||||
|
protected:
|
||||||
|
void showEvent(QShowEvent *ev);
|
||||||
private:
|
private:
|
||||||
Ui::SimpleDiveSiteEditDialog *ui;
|
Ui::SimpleDiveSiteEditDialog *ui;
|
||||||
|
|
||||||
|
|
|
@ -241,7 +241,7 @@ void MainTab::setCurrentLocationIndex()
|
||||||
void MainTab::showDiveSiteSimpleEdit()
|
void MainTab::showDiveSiteSimpleEdit()
|
||||||
{
|
{
|
||||||
SimpleDiveSiteEditDialog dlg(this);
|
SimpleDiveSiteEditDialog dlg(this);
|
||||||
dlg.exec();
|
int reason = dlg.exec();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainTab::enableGeoLookupEdition()
|
void MainTab::enableGeoLookupEdition()
|
||||||
|
|
Loading…
Add table
Reference in a new issue