From 5e06ba85cc13ff3a5b088cbd70dada878665570a Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 16 Feb 2015 00:43:04 +0000 Subject: [PATCH] Bigger color popups. --- qt/lc_qcolorpicker.cpp | 9 +++++---- qt/lc_qpropertiestree.cpp | 9 +++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/qt/lc_qcolorpicker.cpp b/qt/lc_qcolorpicker.cpp index 96dcb408..b4cd190c 100644 --- a/qt/lc_qcolorpicker.cpp +++ b/qt/lc_qcolorpicker.cpp @@ -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(); diff --git a/qt/lc_qpropertiestree.cpp b/qt/lc_qpropertiestree.cpp index 87ff877e..3f614a08 100644 --- a/qt/lc_qpropertiestree.cpp +++ b/qt/lc_qpropertiestree.cpp @@ -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();