void ColorChooserPopupUIController::openUI()
{
    if (m_client->shouldShowSuggestions())
        openPopup();
    else
        openColorChooser();
}
Esempio n. 2
0
Popup::Popup(QWidget* text, QButton* button, QWidget* parent, const char* name)
    : QWidget(parent, name)
{
    _text = text;
    _button = button;
    _popup = NULL;

    text->reparent(this, 0, QPoint());
    if (text->inherits("LineEdit"))
	connect(text, SIGNAL(validData()), SIGNAL(validData()));

    button->reparent(this, 0, QPoint());
    connect(button, SIGNAL(clicked()), SLOT(openPopup()));

    if (topLevelWidget())
	topLevelWidget()->installEventFilter(this);
    text->installEventFilter(this);

    setFocusProxy(text);
    setFocusPolicy(StrongFocus);

    QGridLayout* grid = new QGridLayout(this);
    grid->setColStretch(0, 1);
    grid->addWidget(text, 0, 0);
    grid->addWidget(button, 0, 1, AlignLeft | AlignVCenter);

    setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
}
Esempio n. 3
0
ColorChooserUIController::ColorChooserUIController(ChromeClientImpl* chromeClient, WebCore::ColorChooserClient* client)
    : m_chromeClient(chromeClient)
    , m_client(client)
    , m_popup(0)
{
    if (m_client->shouldShowSuggestions())
        openPopup();
    else
        openColorChooser();
}
Esempio n. 4
0
ColorChooserUIController::ColorChooserUIController(ChromeClientImpl* chromeClient, ColorChooserClient* client)
    : m_chromeClient(chromeClient)
    , m_client(client)
    , m_popup(0)
    , m_locale(Locale::createDefault())
{
    if (m_client->shouldShowSuggestions())
        openPopup();
    else
        openColorChooser();
}
Esempio n. 5
0
bool
Popup::eventFilter(QObject* o, QEvent* e)
{
    if (o == _text) {
	if (e->type() == QEvent::KeyPress) {
	    QKeyEvent* ke = (QKeyEvent*)e;
	    if (ke->key() == Key_F9)
		openPopup();
	}
    } else {
	switch (e->type()) {
	case QEvent::Move:
	case QEvent::Resize:
	    setPopupWidget(_popup);
	    break;
	default:
	    break;
	}
    }

    return false;
}
Esempio n. 6
0
void QtPhoneCallEventFilter::mouseEvent(QMouseEvent * e) {
	if (e->button() == Qt::RightButton) {
		QPoint p = QPoint(e->globalPos());
		openPopup(p.x(), p.y());
	}
}