HelpText(MyScene *scene){ QFont font = g_editor->main_window->font(); font.setPointSize(15); font.setPixelSize(15); // When is this text shown? _text = scene->addText( // "* Add objects with right mouse button\n" "* Move objects with right mouse button.\n" "\n" "* Double-click the name of an object to open GUI. (only if there is one)\n" "\n" "* Delete objects or connections by pressing SHIFT and click left.\n" " - Alternatively, click with middle mouse button.\n" "\n" "* Select more than one object by holding CTRL when clicking.\n" " - Alternatively, mark an area of objects with left mouse button.\n" "\n" "* To autoconnect a new object to an existing object, right click at the input or output of an existing object.\n" "\n" "* Zoom in and out by pressing CTRL and using the scroll wheel.\n" , font); _text->setDefaultTextColor(get_qcolor(HIGH_BACKGROUND_COLOR_NUM).light(70)); _text->setPos(-150,-150); _text->setZValue(-1000); setSingleShot(true); setInterval(1000*60); start(); }
static void configure_note_colors(void){ for(int i=0;i<NUM_NOTE_COLOR_CONF;i++){ QColor start_color = get_custom_qcolor(note_color_conf[i][1]); QColor end_color = get_custom_qcolor(note_color_conf[i+1][1]); int start_note = note_color_conf[i][0]; int end_note = note_color_conf[i+1][0]; if(start_note<64) start_color = get_qcolor(TEXT_COLOR_NUM); else end_color = get_qcolor(WAVEFORM_COLOR_NUM); for(int note=start_note;note<end_note;note++){ //printf("setting %d (%d-%d) to %d %d %f\n",note,start_note,end_note,note_color_conf[i][1], note_color_conf[i+1][1], (float)(note-start_note)/(end_note-start_note)); g_note_colors[note] = mix_colors(end_color, start_color, (float)(note-start_note)/(end_note-start_note)); } } }
// if colornum==-1, create new color int GFX_MakeRandomCustomColor(int colornum){ static int num_colors = first_custom_colornum; if (colornum==-1) colornum = num_colors++; custom_colors[colornum] = mix_colors(QColor(qrand()%255,qrand()%255,qrand()%255), get_qcolor(HIGH_EDITOR_BACKGROUND_COLOR_NUM), 0.10f); return colornum; }
static void updatePalette(EditorWidget *my_widget, QWidget *widget, QPalette &pal){ if(system_color==NULL){ system_color=new QColor(SETTINGS_read_string("system_color","#d2d0d5")); SETTINGS_write_string("system_color",system_color->name()); } if(button_color==NULL){ button_color=new QColor(SETTINGS_read_string("button_color","#c1f1e3")); SETTINGS_write_string("button_color",button_color->name()); } if(override_default_qt_colors==false){ //qapplication->setPalette(t.palette()); //my_widget->setPalette( QApplication::palette( my_widget ) ); return; } // Background { //QColor c(0xe5, 0xe5, 0xe5); QColor c = get_qcolor(LOW_BACKGROUND_COLOR_NUM); //(*system_color); QColor b = get_qcolor(HIGH_BACKGROUND_COLOR_NUM); //(*system_color); if(dynamic_cast<QComboBox*>(widget)!=NULL){ c = get_qcolor(BUTTONS_COLOR_NUM); #if 0 c = mix_colors(c.light(70),QColor(98,59,33),0.55);//editor->colors[colnum].light(52); c.setAlpha(76); #endif } pal.setColor( QPalette::Active, QPalette::Background, b); pal.setColor( QPalette::Inactive, QPalette::Background, b); pal.setColor( QPalette::Disabled, QPalette::Background, b.light(95)); pal.setColor( QPalette::Active, QPalette::Button, c); pal.setColor( QPalette::Inactive, QPalette::Button, c); pal.setColor( QPalette::Disabled, QPalette::Button, c.light(80)); pal.setColor(QPalette::Active, QPalette::Base, c); pal.setColor(QPalette::Inactive, QPalette::Base, c); pal.setColor(QPalette::Disabled, QPalette::Base, c.light(80)); pal.setBrush(QPalette::Highlight, (const QBrush&)QBrush(b.light(85))); pal.setColor(QPalette::Disabled, QPalette::Light, c.light(80)); //pal.setBrush((QPalette::ColorGroup)QPalette::Button, QPalette::Highlight, (const QBrush&)QBrush(b.light(95))); //pal.setBrush(QPalette::Highlight, QPalette::Button, QBrush(c.light(80))); //pal.setBrush(QPalette::Highlight, QPalette::Base, QBrush(c.light(80))); #if 0 pal.setColor(QPalette::Active, QPalette::Window, c); pal.setColor(QPalette::Inactive, QPalette::Window, c); pal.setColor(QPalette::Disabled, QPalette::Window, c.light(80)); #endif #if 0 pal.setColor(QPalette::Active, QPalette::BrightText, c); pal.setColor(QPalette::Inactive, QPalette::BrightText, c); pal.setColor(QPalette::Disabled, QPalette::BrightText, c.light(80)); #endif } // Foreground, text, etc. (everything blackish) { QColor c = get_qcolor(TEXT_COLOR_NUM); //QColor black(QColor("black")); c.setAlpha(180); //black.setAlpha(108); pal.setColor(QPalette::Active, QPalette::Foreground, c); pal.setColor(QPalette::Inactive, QPalette::Foreground, c.light(93)); pal.setColor(QPalette::Disabled, QPalette::Foreground, c.light(80)); pal.setColor(QPalette::Active, QPalette::Foreground, c); pal.setColor(QPalette::Inactive, QPalette::Foreground, c.light(93)); pal.setColor(QPalette::Disabled, QPalette::Foreground, c.light(80)); pal.setColor(QPalette::Active, QPalette::ButtonText, c); pal.setColor(QPalette::Inactive, QPalette::ButtonText, c.light(93)); pal.setColor(QPalette::Disabled, QPalette::ButtonText, c.light(80)); pal.setColor(QPalette::Active, QPalette::ButtonText, c); pal.setColor(QPalette::Inactive, QPalette::ButtonText, c.light(93)); pal.setColor(QPalette::Disabled, QPalette::ButtonText, c.light(80)); pal.setColor(QPalette::Active, QPalette::Text, c); pal.setColor(QPalette::Inactive, QPalette::Text, c.light(90)); pal.setColor(QPalette::Disabled, QPalette::Text, c.light(80)); pal.setColor(QPalette::Active, QPalette::HighlightedText, c.light(100)); pal.setColor(QPalette::Inactive, QPalette::HighlightedText, c.light(90)); pal.setColor(QPalette::Disabled, QPalette::HighlightedText, c.light(80)); pal.setColor(QPalette::Active, QPalette::Text, c); pal.setColor(QPalette::Inactive, QPalette::Text, c.light(90)); pal.setColor(QPalette::Disabled, QPalette::Text, c.light(80)); } }