mirror of
https://github.com/leozide/leocad
synced 2025-01-17 18:11:42 +01:00
Bigger color popups.
This commit is contained in:
parent
e4eb0e65d7
commit
5e06ba85cc
2 changed files with 10 additions and 8 deletions
|
@ -113,6 +113,7 @@ void lcQColorPicker::buttonPressed(bool toggled)
|
|||
connect(popup, SIGNAL(changed(int)), SLOT(changed(int)));
|
||||
connect(popup, SIGNAL(selected(int)), SLOT(selected(int)));
|
||||
connect(popup, SIGNAL(hid()), SLOT(popupClosed()));
|
||||
popup->setMinimumSize(300, 200);
|
||||
|
||||
const QRect desktop = QApplication::desktop()->geometry();
|
||||
|
||||
|
@ -122,10 +123,10 @@ void lcQColorPicker::buttonPressed(bool toggled)
|
|||
if (pos.y() < desktop.top())
|
||||
pos.setY(desktop.top());
|
||||
|
||||
if ((pos.x() + popup->sizeHint().width()) > desktop.width())
|
||||
pos.setX(desktop.width() - popup->sizeHint().width());
|
||||
if ((pos.y() + popup->sizeHint().height()) > desktop.bottom())
|
||||
pos.setY(desktop.bottom() - popup->sizeHint().height());
|
||||
if ((pos.x() + popup->width()) > desktop.width())
|
||||
pos.setX(desktop.width() - popup->width());
|
||||
if ((pos.y() + popup->height()) > desktop.bottom())
|
||||
pos.setY(desktop.bottom() - popup->height());
|
||||
popup->move(pos);
|
||||
|
||||
clearFocus();
|
||||
|
|
|
@ -670,6 +670,7 @@ void lcQPropertiesTree::slotColorButtonClicked()
|
|||
|
||||
lcQColorPickerPopup *popup = new lcQColorPickerPopup(parent, part->mColorIndex);
|
||||
connect(popup, SIGNAL(selected(int)), SLOT(slotSetValue(int)));
|
||||
popup->setMinimumSize(300, 200);
|
||||
|
||||
const QRect desktop = QApplication::desktop()->geometry();
|
||||
|
||||
|
@ -679,10 +680,10 @@ void lcQPropertiesTree::slotColorButtonClicked()
|
|||
if (pos.y() < desktop.top())
|
||||
pos.setY(desktop.top());
|
||||
|
||||
if ((pos.x() + popup->sizeHint().width()) > desktop.width())
|
||||
pos.setX(desktop.width() - popup->sizeHint().width());
|
||||
if ((pos.y() + popup->sizeHint().height()) > desktop.bottom())
|
||||
pos.setY(desktop.bottom() - popup->sizeHint().height());
|
||||
if ((pos.x() + popup->width()) > desktop.width())
|
||||
pos.setX(desktop.width() - popup->width());
|
||||
if ((pos.y() + popup->height()) > desktop.bottom())
|
||||
pos.setY(desktop.bottom() - popup->height());
|
||||
popup->move(pos);
|
||||
|
||||
popup->setFocus();
|
||||
|
|
Loading…
Reference in a new issue