Ejemplo n.º 1
0
void ColorPicker::createTexture(void) {   
   Kernel *kernel = Kernel::getInstance();

   Panel::createTexture();

   createColors();

   if ((_cpTexture = kernel->getWidgetTexture(COLORPICKER)) != NULL) return;

   _cpTexture = new ComponentTexture(MatrixTemplate<ColorRGBA>::getWidth(), MatrixTemplate<ColorRGBA>::getHeight() + 1);
   kernel->setWidgetTexture(COLORPICKER, _cpTexture);

   _cpTexture->setTextureEnvMode(GL_MODULATE);
   _cpTexture->addTexture(Point(0,0), *this);

   _cpTexture->addTexture(Point(0,MatrixTemplate<ColorRGBA>::getHeight()), MatrixTemplate<ColorRGBA>(1, 1, ColorRGBA(255,255,255,255)));

   _cpTexture->createTexture();
}
Ejemplo n.º 2
0
ChatPanel::ChatPanel(QWidget *parent, const QStringList &botNames) :
    QWidget(parent),
    ui(new Ui::ChatPanel),
    botNames(botNames),
    availableColors(createColors()),
    autoTranslating(false)
{
    ui->setupUi(this);
    ui->scrollContent->setLayout(new QVBoxLayout(ui->scrollContent));
    ui->scrollContent->layout()->setContentsMargins(0, 0, 0, 0);

    QObject::connect(ui->chatText, SIGNAL(returnPressed()), this,
                     SLOT(on_chatTextEditionFinished()));
    ui->chatText->installEventFilter(this);

    // this event is used to auto scroll down when new messages are added
    QObject::connect(ui->chatScroll->verticalScrollBar(), SIGNAL(rangeChanged(int,
                                                                              int)), this,
                     SLOT(on_verticalScrollBarRangeChanged(int, int)));

    // disable blue border when QLineEdit has focus in mac
    ui->chatText->setAttribute(Qt::WA_MacShowFocusRect, 0);
}