22 setWindowTitle (tr (
"Tags selector"));
23 setWindowFlags (Qt::Dialog | Qt::WindowStaysOnTopHint);
24 setMinimumHeight (screen ()->availableGeometry ().height () / 3 * 2);
26 const auto box =
new QDialogButtonBox {
this };
30 box->setStandardButtons (QDialogButtonBox::Close);
33 box->setStandardButtons (QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
37 &QDialogButtonBox::accepted,
41 &QDialogButtonBox::rejected,
45 const auto layout =
new QVBoxLayout {
this };
46 layout->addWidget (&Selector_);
47 layout->addWidget (box);
57 QDialog::moveEvent (e);
59 const auto& pos = e->pos ();
60 const auto& avail = screen ()->availableGeometry ();
63 if (pos.x () + width () > avail.width ())
64 dx = width () + pos.x () - avail.width ();
65 if (pos.y () + height () > avail.height () &&
66 height () < avail.height ())
67 dy = height () + pos.y () - avail.height ();
70 move (pos - QPoint { dx, dy });