void GenomeColorSelector::toggleShowHistAction(bool flag)
{
	show_histogram = flag;
	QSettings settings;
	settings.setValue("genomecolorselector/showhistogram", show_histogram);
	repaintLabel();
}
ColorSettingsWidget::ColorSettingsWidget(GenomeVector* g, QWidget* parent)
    : QWidget(parent), genome(g)
{
    setupUi(this);

    m_colorSelector->setGenomeVector(genome);

    m_colorLineEdit->setWheelEventUpdate(true);
    m_colorLineEdit->restoreSettings();
    connect(m_colorLineEdit, SIGNAL(valueUpdated()), this, SLOT(colorChangedAction()));
    connect(m_colorLineEdit, SIGNAL(undoStateSignal()), this, SIGNAL(undoStateSignal()));

    m_speedLineEdit->setWheelEventUpdate(true);
    m_speedLineEdit->restoreSettings();
    connect(m_speedLineEdit, SIGNAL(valueUpdated()), this, SLOT(fieldEditedAction()));
    connect(m_speedLineEdit, SIGNAL(valueUpdated()), m_colorSelector, SLOT(repaintLabel()));
    connect(m_speedLineEdit, SIGNAL(undoStateSignal()), this, SIGNAL(undoStateSignal()));

    m_opacityLineEdit->setWheelEventUpdate(true);
    m_opacityLineEdit->restoreSettings();
    connect(m_opacityLineEdit, SIGNAL(valueUpdated()), this, SLOT(fieldEditedAction()));

    connect(m_backgroundLabel, SIGNAL(colorSelected(QColor)), this, SLOT(changeBackground(QColor)));
    connect(m_backgroundLabel, SIGNAL(undoStateSignal()), this, SIGNAL(undoStateSignal()));
    connect(m_colorSelector, SIGNAL(colorSelected(double)), this, SLOT(colorSelectedAction(double)));
    connect(m_colorSelector, SIGNAL(undoStateSignal()), this, SIGNAL(undoStateSignal()));
}
ValSelector::ValSelector(QWidget* parent)
	: ColorSelector(parent)
{
	QSize s = size();
	background = QImage(s.width(), 256, QImage::Format_RGB32);
	QPainter p(&background);
	for (int i = 0 ; i < 256 ; i++)
	{
		p.setPen(QPen(qRgb(i, i, i)));
		p.drawLine(0, i, s.width(), i);
	}
	repaintLabel();
}
Exemple #4
0
void RenderSnapshottedPlugIn::handleEvent(Event* event)
{
    if (!event->isMouseEvent())
        return;

    MouseEvent* mouseEvent = static_cast<MouseEvent*>(event);

    if (event->type() == eventNames().clickEvent) {
        if (mouseEvent->button() != LeftButton)
            return;

        plugInImageElement()->setDisplayState(HTMLPlugInElement::PlayingWithPendingMouseClick);
        plugInImageElement()->userDidClickSnapshot(mouseEvent);

        if (widget()) {
            if (Frame* frame = document()->frame())
                frame->loader()->client()->recreatePlugin(widget());
            repaint();
        }
        event->setDefaultHandled();
    } else if (event->type() == eventNames().mousedownEvent) {
        if (mouseEvent->button() != LeftButton)
            return;

        if (m_showLabelDelayTimer.isActive())
            m_showLabelDelayTimer.stop();

        event->setDefaultHandled();
    } else if (event->type() == eventNames().mouseoverEvent) {
        if (!m_showedLabelOnce || m_showReason != ShouldShowAutomatically)
            resetDelayTimer(UserMousedOver);
        event->setDefaultHandled();
    } else if (event->type() == eventNames().mouseoutEvent) {
        if (m_showLabelDelayTimer.isActive())
            m_showLabelDelayTimer.stop();
        if (m_shouldShowLabel) {
            if (m_showReason == UserMousedOver) {
                m_shouldShowLabel = false;
                repaintLabel();
            }
        } else if (m_shouldShowLabelAutomatically)
            resetDelayTimer(ShouldShowAutomatically);
        event->setDefaultHandled();
    }
}
void GenomeColorSelector::setSelectedIndex(int y)
{
	int this_y = 1 + y;
	selected_y = this_y; // voodoo too
	repaintLabel();
}
Exemple #6
0
void RenderSnapshottedPlugIn::showLabelDelayTimerFired(Timer<RenderSnapshottedPlugIn>*)
{
    m_shouldShowLabel = true;
    repaintLabel();
}