Bigger color popups.

This commit is contained in:
leo 2015-02-16 00:43:04 +00:00
parent e4eb0e65d7
commit 5e06ba85cc
2 changed files with 10 additions and 8 deletions

View file

@ -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();

View file

@ -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();