mirror of
https://github.com/leozide/leocad
synced 2025-01-30 20:34:56 +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(changed(int)), SLOT(changed(int)));
|
||||||
connect(popup, SIGNAL(selected(int)), SLOT(selected(int)));
|
connect(popup, SIGNAL(selected(int)), SLOT(selected(int)));
|
||||||
connect(popup, SIGNAL(hid()), SLOT(popupClosed()));
|
connect(popup, SIGNAL(hid()), SLOT(popupClosed()));
|
||||||
|
popup->setMinimumSize(300, 200);
|
||||||
|
|
||||||
const QRect desktop = QApplication::desktop()->geometry();
|
const QRect desktop = QApplication::desktop()->geometry();
|
||||||
|
|
||||||
|
@ -122,10 +123,10 @@ void lcQColorPicker::buttonPressed(bool toggled)
|
||||||
if (pos.y() < desktop.top())
|
if (pos.y() < desktop.top())
|
||||||
pos.setY(desktop.top());
|
pos.setY(desktop.top());
|
||||||
|
|
||||||
if ((pos.x() + popup->sizeHint().width()) > desktop.width())
|
if ((pos.x() + popup->width()) > desktop.width())
|
||||||
pos.setX(desktop.width() - popup->sizeHint().width());
|
pos.setX(desktop.width() - popup->width());
|
||||||
if ((pos.y() + popup->sizeHint().height()) > desktop.bottom())
|
if ((pos.y() + popup->height()) > desktop.bottom())
|
||||||
pos.setY(desktop.bottom() - popup->sizeHint().height());
|
pos.setY(desktop.bottom() - popup->height());
|
||||||
popup->move(pos);
|
popup->move(pos);
|
||||||
|
|
||||||
clearFocus();
|
clearFocus();
|
||||||
|
|
|
@ -670,6 +670,7 @@ void lcQPropertiesTree::slotColorButtonClicked()
|
||||||
|
|
||||||
lcQColorPickerPopup *popup = new lcQColorPickerPopup(parent, part->mColorIndex);
|
lcQColorPickerPopup *popup = new lcQColorPickerPopup(parent, part->mColorIndex);
|
||||||
connect(popup, SIGNAL(selected(int)), SLOT(slotSetValue(int)));
|
connect(popup, SIGNAL(selected(int)), SLOT(slotSetValue(int)));
|
||||||
|
popup->setMinimumSize(300, 200);
|
||||||
|
|
||||||
const QRect desktop = QApplication::desktop()->geometry();
|
const QRect desktop = QApplication::desktop()->geometry();
|
||||||
|
|
||||||
|
@ -679,10 +680,10 @@ void lcQPropertiesTree::slotColorButtonClicked()
|
||||||
if (pos.y() < desktop.top())
|
if (pos.y() < desktop.top())
|
||||||
pos.setY(desktop.top());
|
pos.setY(desktop.top());
|
||||||
|
|
||||||
if ((pos.x() + popup->sizeHint().width()) > desktop.width())
|
if ((pos.x() + popup->width()) > desktop.width())
|
||||||
pos.setX(desktop.width() - popup->sizeHint().width());
|
pos.setX(desktop.width() - popup->width());
|
||||||
if ((pos.y() + popup->sizeHint().height()) > desktop.bottom())
|
if ((pos.y() + popup->height()) > desktop.bottom())
|
||||||
pos.setY(desktop.bottom() - popup->sizeHint().height());
|
pos.setY(desktop.bottom() - popup->height());
|
||||||
popup->move(pos);
|
popup->move(pos);
|
||||||
|
|
||||||
popup->setFocus();
|
popup->setFocus();
|
||||||
|
|
Loading…
Add table
Reference in a new issue