Exemple #1
0
void SDLFontGL::setupColors(std::vector<SDL_Color> colors) {
	assert(!colors.empty());
	m_colors = colors;

	updateColors();
	// cursor does a manual color lookup
	updateCursor();
}
HbAnchorArrowDrawer::HbAnchorArrowDrawer(HbAnchorLayout *layout, QGraphicsItem *parent)
    : HbWidgetBase(parent),
      mLayout(layout), mDrawOutlines(true), mDrawArrows(true), mDrawSpacers(true)
{
#if defined(HB_DEVELOPER) || defined(CSS_INSPECTOR)
    updateColors();
#endif
}
Exemple #3
0
 void Canvas::update()
 {
     if (_dirty)
     {
         updateColors();
         _dirty = false;
     }
 }
Exemple #4
0
inline void vertex_buffer_object<Ta, Te>::update()
{
    updateVertices();
    updateNormals();
    updateColors();
    updateTexCoords();
    updateElements();
}
void FieldPropertiesDialog::OnRadioGeneratorClick(wxCommandEvent&
    WXUNUSED(event))
{
    textctrl_generator_name->SetEditable(radio_generator_new->GetValue());
    updateColors();
    choice_generator->Enable(radio_generator_existing->GetValue());
    updateSqlStatement();
}
Exemple #6
0
void SkLabel::setDefaultForegroundColor (const QColor &color)
{
	// TODO: this will use the parent's foreground color as this widget's
	// foreground color, which means that it will not be updated if the
	// style is changed.
	defaultForegroundColor=color;
	updateColors ();
}
Exemple #7
0
//! Updates all the gui components
void VtkColorTable::updateAll(const QColor & val) {
  updateRed(val.red(), false);
  updateGreen(val.green(), false);
  updateBlue(val.blue(), false);

  updateColors();
  updateColorFunction();
}
void HbAnchorArrowDrawer::changeEvent(QEvent *event)
{
#if defined(HB_DEVELOPER) || defined(CSS_INSPECTOR)
    if (event->type() == HbEvent::ThemeChanged)
        updateColors();
#endif
    HbWidgetBase::changeEvent(event);
}
Exemple #9
0
colorPicker::colorPicker(QWidget *parent):QWidget(parent){
  setupUi(this);
  color=Qt::black;
  connect(red, SIGNAL( valueChanged(int) ), this, SLOT( setRed(int) ) );
  connect(green, SIGNAL( valueChanged(int) ), this, SLOT( setGreen(int) ) );
  connect(blue, SIGNAL( valueChanged(int) ), this, SLOT( setBlue(int) ) );
  connect(editBtn, SIGNAL( clicked() ), this, SLOT( displayPicker() ) );
  updateColors();
}
Exemple #10
0
void Vga::sunset() {
	Dac tab[256];
	getColors(tab);
	for (int i = 64; i >= 0; i -= kFadeStep) {
		setColors(tab, i);
		waitVR();
		updateColors();
	}
}
Exemple #11
0
void Clock::init()
{
    ClockApplet::init();

    dataEngine("time")->connectSource(currentTimezone(), this, updateInterval(), intervalAlignment());
    connect(Plasma::Theme::defaultTheme(), SIGNAL(themeChanged()), this, SLOT(updateColors()));
    connect(KGlobalSettings::self(), SIGNAL(appearanceChanged()), SLOT(resetSize()));
    connect(KGlobalSettings::self(), SIGNAL(settingsChanged(int)), SLOT(updateClock(int)));
}
Exemple #12
0
void PropertyEditor::slotColoring(bool coloring)
{
    if (coloring == m_coloring)
        return;

    m_coloring = coloring;

    updateColors();
}
void DatabaseRegistrationDialog::OnAuthenticationChange(
    wxCommandEvent& WXUNUSED(event))
{
    if (IsShown())
    {
        updateAuthenticationMode();
        updateColors();
    }
}
Exemple #14
0
void Simulator::processInput(void)
{
    // handle events
    sf::Event event;
    while (window.pollEvent(event))
    {
        if (event.type == sf::Event::Closed) {
            // end the program
            running = false;
        } else if (event.type == sf::Event::Resized) {
            // adjust the viewport when the window is resized
            glViewport(0, 0, event.size.width, event.size.height);
        } else if (event.type == sf::Event::KeyPressed) {
            if (event.key.code == sf::Keyboard::I) {
                colors_inverted = !colors_inverted;
                updateColors();
            } else if (event.key.code == sf::Keyboard::Up) {
                if (colorscheme < (colorschemes.size()/2)-1) {
                    colorscheme++;
                    updateColors();
                }
            } else if (event.key.code == sf::Keyboard::Down) {
                if (colorscheme > 0) {
                    colorscheme--;
                    updateColors();
                }
            }
        }

    }

    if (sf::Keyboard::isKeyPressed(sf::Keyboard::Escape)) {
        running = false;
    }

    // use convenient static functions
    input.button_a = sf::Keyboard::isKeyPressed(sf::Keyboard::Left);
    input.button_b = sf::Keyboard::isKeyPressed(sf::Keyboard::Right);

    input.button_p2_a = sf::Keyboard::isKeyPressed(sf::Keyboard::A);
    input.button_p2_b = sf::Keyboard::isKeyPressed(sf::Keyboard::E);

    input.restart  = sf::Keyboard::isKeyPressed(sf::Keyboard::R);
}
Exemple #15
0
void Workspace::setCurrentProject( Project *pro )
{
    if ( project == pro )
	return;
    if ( project ) {
	disconnect( project, SIGNAL( sourceFileAdded(SourceFile*) ), this, SLOT( sourceFileAdded(SourceFile*) ) );
	disconnect( project, SIGNAL( sourceFileRemoved(SourceFile*) ), this, SLOT( sourceFileRemoved(SourceFile*) ) );
	disconnect( project, SIGNAL( formFileAdded(FormFile*) ), this, SLOT( formFileAdded(FormFile*) ) );
	disconnect( project, SIGNAL( formFileRemoved(FormFile*) ), this, SLOT( formFileRemoved(FormFile*) ) );
	disconnect( project, SIGNAL( objectAdded(QObject*) ), this, SLOT( objectAdded(QObject*) ) );
	disconnect( project, SIGNAL( objectRemoved(QObject*) ), this, SLOT( objectRemoved(QObject*) ) );
	disconnect( project, SIGNAL( projectModified() ), this, SLOT( update() ) );
    }
    project = pro;
    connect( project, SIGNAL( sourceFileAdded(SourceFile*) ), this, SLOT( sourceFileAdded(SourceFile*) ) );
    connect( project, SIGNAL( sourceFileRemoved(SourceFile*) ), this, SLOT( sourceFileRemoved(SourceFile*) ) );
    connect( project, SIGNAL( formFileAdded(FormFile*) ), this, SLOT( formFileAdded(FormFile*) ) );
    connect( project, SIGNAL( formFileRemoved(FormFile*) ), this, SLOT( formFileRemoved(FormFile*) ) );
    connect( project, SIGNAL( destroyed(QObject*) ), this, SLOT( projectDestroyed(QObject*) ) );
    connect( project, SIGNAL( objectAdded(QObject*) ), this, SLOT( objectAdded(QObject*) ) );
    connect( project, SIGNAL( objectRemoved(QObject*) ), this, SLOT( objectRemoved(QObject*) ) );
    connect( project, SIGNAL( projectModified() ), this, SLOT( update() ) );
    clear();

    if ( bufferEdit )
	bufferEdit->clear();

    projectItem = new WorkspaceItem( this, project );

    projectItem->setOpen( TRUE );

    for ( QPtrListIterator<SourceFile> sources = project->sourceFiles();
	  sources.current(); ++sources ) {
	SourceFile* f = sources.current();
	(void) new WorkspaceItem( projectItem, f );
    }

    for ( QPtrListIterator<FormFile> forms = project->formFiles();
	  forms.current(); ++forms ) {
	FormFile* f = forms.current();
	if ( f->isFake() )
	    continue;

	(void) new WorkspaceItem( projectItem, f );
    }

    QObjectList l = project->objects();
    QObjectListIt objs( l );
    for ( ;objs.current(); ++objs ) {
	QObject* o = objs.current();
	(void) new WorkspaceItem( projectItem, o, project );
    }

    updateColors();
    completionDirty = TRUE;
}
Exemple #16
0
void Clock::clockConfigChanged()
{
    KConfigGroup cg = config();
    m_showTimezone = cg.readEntry("showTimezone", !isLocalTimezone());

    kDebug() << "showTimezone:" << m_showTimezone;

    if (cg.hasKey("showDate")) {    //legacy config entry as of 2011-1-4
        m_dateStyle = cg.readEntry("showDate", false) ? 2 : 0; //short date : no date
        cg.deleteEntry("showDate");
    }
    else {
        m_dateStyle = cg.readEntry("dateStyle", 0);
    }

    if (cg.hasKey("showYear")) {   //legacy config entry as of 2011-1-4
        if( m_dateStyle ) {
            m_dateStyle = cg.readEntry("showYear", false) ? 2 : 1; //short date : compact date
        }
        cg.deleteEntry("showYear");
    }

    m_showSeconds = cg.readEntry("showSeconds", false);
    if (m_showSeconds) {
        //We don't need to cache the applet if it update every seconds
        setCacheMode(QGraphicsItem::NoCache);
    } else {
        setCacheMode(QGraphicsItem::DeviceCoordinateCache);
    }

    QFont f = cg.readEntry("plainClockFont", m_plainClockFont);
    m_isDefaultFont = f == m_plainClockFont;
    m_plainClockFont = f;

    m_useCustomColor = cg.readEntry("useCustomColor", m_useCustomColor);
    m_plainClockColor = cg.readEntry("plainClockColor", m_plainClockColor);
    m_useCustomShadowColor = cg.readEntry("useCustomShadowColor", m_useCustomShadowColor);
    m_plainClockShadowColor = cg.readEntry("plainClockShadowColor", m_plainClockShadowColor);
    m_drawShadow = cg.readEntry("plainClockDrawShadow", m_drawShadow);

    updateColors();

    if (m_useCustomColor) {
        m_pixmap = QPixmap();
        delete m_svg;
        m_svg = 0;
    }

    const QFontMetricsF metrics(KGlobalSettings::smallestReadableFont());
    const QString timeString = KGlobal::locale()->formatTime(QTime(23, 59), m_showSeconds);
    setMinimumSize(metrics.size(Qt::TextSingleLine, timeString));

    if (isUserConfiguring()) {
        updateSize();
    }
}
void AbstractTableView::Initialize()
{
    // Required to be called by each constructor because
    // of VTable changes
    //
    // Init all other updates once
    updateColors();
    updateFonts();
    updateShortcuts();
}
Exemple #18
0
// Draws snake body as single point(1 pixel)
void Board::drawPointFast(uint8_t xPoint, uint8_t yPoint){
  // Set new stroke
  TFTscreen.stroke(rgbColour[0], rgbColour[1], rgbColour[2]);

  // Draw 9x9 square
  TFTscreen.point(xPoint, yPoint);

  // Set new colors
  updateColors();
}
void  myGLWidget::setColor(Color c)
{
  m_color = c;
  for (unsigned int x = 0; x < m_colors.size(); x += 3) {
      m_colors[x] = m_color.red();
      m_colors[x + 1] = m_color.green();
      m_colors[x + 2] = m_color.blue();
    }
  updateColors();
}
Exemple #20
0
GMSourceView::GMSourceView(FXComposite* p) : GMScrollFrame(p) , source(NULL) {
  sourcelistheader = new GMHeaderButton(this,tr("Sources\tPress to change sorting order\tPress to change sorting order"),NULL,this,ID_SOURCE_LIST_HEADER,LAYOUT_FILL_X|FRAME_RAISED|JUSTIFY_LEFT);
  sourcelist       = new GMTreeList(this,this,ID_SOURCE_LIST,LAYOUT_FILL_X|LAYOUT_FILL_Y|TREELIST_BROWSESELECT);

  sourcelist->dropEnable();
  sourcelist->setSortFunc(source_list_sort);

  sourcelistheader->setArrowState(ARROW_DOWN);

  updateColors();
  }
Exemple #21
0
void QScintillaWidget::changeEvent(QEvent *pEvent)
{
    // Default handling of the event

    QsciScintilla::changeEvent(pEvent);

    // Check whether the palette has changed and if so then update our colors

    if (pEvent->type() == QEvent::PaletteChange)
        updateColors();
}
Exemple #22
0
void Vga::update() {
	SWAP(Vga::_page[0], Vga::_page[1]);

	if (_setPal) {
		updateColors();
		_setPal = false;
	}

	g_system->copyRectToScreen((const byte *)Vga::_page[0]->getBasePtr(0, 0), kScrWidth, 0, 0, kScrWidth, kScrHeight);
	g_system->updateScreen();
}
Exemple #23
0
bool FlatTitleBar::eventFilter(QObject *, QEvent *event)
{
    switch (event->type()) {
        case QEvent::WindowActivate:
        case QEvent::WindowDeactivate:
            updateColors();
        default:
            break;
    }
    return false;
}
Exemple #24
0
void PropertyEditor::updateForegroundBrightness()
{
    QColor c = palette().color(QPalette::Text);
    bool newBrightness = qRound(0.3 * c.redF() + 0.59 * c.greenF() + 0.11 * c.blueF());

    if (m_brightness == newBrightness)
        return;

    m_brightness = newBrightness;

    updateColors();
}
void DotPlotDialog::sl_invertedColorButton() {
    QObjectScopedPointer<QColorDialog> d = new QColorDialog(invertedColor, this);
    d->exec();
    CHECK(!d.isNull(), );

    if (QDialog::Accepted == d->result()) {
        invertedColor = d->selectedColor();
        invertedCheckBox->setChecked(true);
    }

    updateColors();
}
Exemple #26
0
Editor::Editor(QWidget *parent) : QPlainTextEdit(parent)
{
    propDialog = ((MainWindow *) parent)->propDialog;

    ctrlPressed = false;
    isSpin = false;
    expectAutoComplete = false;
    canUndo = false;
    canRedo = false;
    canCopy = false;

    lineNumberArea = new LineNumberArea(this);
    connect(this, SIGNAL(blockCountChanged(int)), this, SLOT(updateLineNumberAreaWidth()));
    connect(this, SIGNAL(updateRequest(QRect,int)), this, SLOT(updateLineNumberArea(QRect,int)));
    updateLineNumberAreaWidth();

    highlighter = 0;
    setHighlights();
    setMouseTracking(true);
    setCenterOnScroll(true);
    setWordWrapMode(QTextOption::NoWrap);

    currentTheme = &Singleton<ColorScheme>::Instance();
    updateColors();
    updateFonts();
    saveContent();

    connect(this,SIGNAL(cursorPositionChanged()),this,SLOT(updateBackgroundColors()));
    connect(propDialog,SIGNAL(updateColors()),this,SLOT(updateColors()));
    connect(propDialog,SIGNAL(updateFonts()),this,SLOT(updateFonts()));
    connect(propDialog->getTabSpaceLedit(),SIGNAL(textChanged(QString)), this, SLOT(tabSpacesChanged()));

    connect(this,SIGNAL(undoAvailable(bool)), this, SLOT(setUndo(bool)));
    connect(this,SIGNAL(redoAvailable(bool)), this, SLOT(setRedo(bool)));
    connect(this,SIGNAL(copyAvailable(bool)), this, SLOT(setCopy(bool)));

    // this must be a pointer otherwise we can't control the position.
    cbAuto = new QComboBox(this);
    cbAuto->hide();
}
void DateTimeGroup::configChanged()
{
	
	KConfigGroup cg = config();

	if (isUserConfiguring()) {
		configAccepted();
	}
	m_natoOperation = cg.readEntry("natoOperation", m_natoOperation);
	m_local= cg.readEntry("localTime", m_local);

	QFont f = cg.readEntry("plainDateTimeGroupFont", m_plainDateTimeGroupFont);
	m_isDefaultFont = f == m_plainDateTimeGroupFont;
	m_plainDateTimeGroupFont = f;
	
	m_useCustomColor = cg.readEntry("useCustomColor", m_useCustomColor);
	m_plainDateTimeGroupColor = cg.readEntry("plainDateTimeGroupColor", m_plainDateTimeGroupColor);
	m_useCustomShadowColor = cg.readEntry("useCustomShadowColor", m_useCustomShadowColor);
	m_plainDateTimeGroupShadowColor = cg.readEntry("plainDateTimeGroupShadowColor", m_plainDateTimeGroupShadowColor);
	
	m_drawShadow = cg.readEntry("plainDateTimeGroupDrawShadow", m_drawShadow);
	m_rounded=cg.readEntry("rounded",m_rounded);
	m_format=cg.readEntry("format",m_format);
	
	m_showSeconds=m_format==2;
	if (m_showSeconds) {
		//We don't need to cache the applet if it update every seconds
		setCacheMode(QGraphicsItem::NoCache);
	} else {
		setCacheMode(QGraphicsItem::DeviceCoordinateCache);
	}
	
	m_sAfterDay =cg.readEntry("sAfterDay", m_sAfterDay);
	m_sAfterHour = cg.readEntry("sAfterHour", m_sAfterHour);
	m_sAfterMinute = cg.readEntry("sAfterMinute", m_sAfterMinute);
	
	m_sAfterSecond = cg.readEntry("sAfterSecond", m_sAfterSecond);
	m_sAfterTimeZone = cg.readEntry("sAfterTimeZone", m_sAfterTimeZone);
	m_sAfterMonth = cg.readEntry("sAfterMonth", m_sAfterMonth);
	
	updateColors();
	
	if (m_useCustomColor) {
		m_pixmap = QPixmap();
		delete m_svg;
		m_svg = 0;
	}
	
	const QFontMetricsF metrics(KGlobalSettings::smallestReadableFont());
	setMinimumSize(metrics.size(Qt::TextSingleLine, dtg));
	updateSize();
}
Exemple #28
0
void VtkColorTable::updateBlue(int val, bool updateAll) {
    mainTable->item(mainTable->currentRow(), 3)->setText(QString::number(val));

    Point point = points.at(mainTable->currentRow());
    QColor & color = point.color;
    color.setBlue(val);
    points.replace(mainTable->currentRow(), point);

    if (updateAll) {
        updateColors();
        updateColorFunction();
    }
}
Exemple #29
0
void KIconEditGrid::load( QImage *image)
{
  debug("KIconEditGrid::load");

  setUpdatesEnabled(false);

  if(image != 0L)
  {
    *img = *fixTransparence(image);
    //*img = image->convertDepth(32);
    //img->setAlphaBuffer(true);
  }
  else
  {
    QString msg = i18n("There was an error loading a blank image.\n");
    KMsgBox::message (this, i18n("Error"), msg.data());
    return;
  }

  setNumRows(img->height());
  setNumCols(img->width());

  for(int y = 0; y < numRows(); y++)
  {
    uint *l = (uint*)img->scanLine(y);
    for(int x = 0; x < numCols(); x++, l++)
    {
/*
      //uint gray = (qRgb(200, 200, 200) | OPAQUE_MASK);
      //uint bc = (TRANSPARENT | OPAQUE_MASK);
      //if(*l == gray || *l == bc || *l < 0xff000000)  // this is a hack but I couldn't save it as transparent otherwise
      if(*l < 0xff000000 || *l == (TRANSPARENT|OPAQUE_MASK))  // this is a hack but I couldn't save it as transparent otherwise
      {
        *l = TRANSPARENT;
      }
      //debug("KIcnGrid::load: %d %%", (((y*ncols)+x)/imgsize) * 100);
      //debug("KIconEditGrid::load: RGB: %d %d %d", qRed(*l), qGreen(*l), qBlue(*l));
*/
      setColor((y*numCols())+x, *l, false);
    }
    //debug("Row: %d", y);
    kapp->processEvents(200);
  }
  updateColors();
  emit sizechanged(numCols(), numRows());
  emit colorschanged(numColors(), data());
  emit changed(pixmap());
  setUpdatesEnabled(true);
  emit needPainting();
  //repaint(viewRect(), false);
}
Exemple #30
0
// Draws a 9X9 point with (xPoint, yPoint) as center
void Board::drawPoint(uint8_t xPoint, uint8_t yPoint){
  // set new stroke
  TFTscreen.stroke(rgbColour[0], rgbColour[1], rgbColour[2]);

  //Draw 9x9 square
  for(int i = -3; i <= 3; i++){
    for(int j = -3; j <= 3; j++){
      TFTscreen.point(((int)xPoint) + i, ((int)yPoint) + j);
    }
  }

  // Set new colors
  updateColors();
}