void ColorPalette::appendColor(const QColor& color, const QString& name)
{
    p->colors.push_back(qMakePair(color,name));
    setDirty(true);
    colorAdded(p->colors.size()-1);
    colorsUpdated(p->colors);
}
Example #2
0
void Configuration::writeColors()
{
    //write config
    for(int i = 0; i < Colors.size(); i++)
    {
        QString id = Colors.keys().at(i);
        colorToConfig(id, Colors[id]);
    }
    emit colorsUpdated();
}
void ColorPalette::eraseColor(int index)
{
    if ( !p->valid_index(index) )
        return;

    p->colors.remove(index);

    setDirty(true);
    colorRemoved(index);
    colorsUpdated(p->colors);
}
void ColorPalette::insertColor(int index, const QColor& color, const QString& name)
{
    if ( index < 0 || index > p->colors.size() )
        return;

    p->colors.insert(index, qMakePair(color, name));

    setDirty(true);
    colorAdded(index);
    colorsUpdated(p->colors);
}
void ColorPalette::setNameAt(int index, const QString& name)
{
    if ( !p->valid_index(index) )
        return;

    p->colors[index].second = name;

    setDirty(true);
    colorChanged(index);
    colorsUpdated(p->colors);
}
void ColorPalette::setColorAt(int index, const QColor& color)
{
    if ( !p->valid_index(index) )
        return;

    p->colors[index].first = color;

    setDirty(true);
    colorChanged(index);
    colorsUpdated(p->colors);
}
Example #7
0
AbstractTableView::AbstractTableView(QWidget* parent) : QAbstractScrollArea(parent)
{
    // Class variable initialization
    mTableOffset = 0;
    mPrevTableOffset = mTableOffset + 1;
    Header_t data;
    data.isVisible = true;
    data.height = 20;
    data.activeButtonIndex = -1;
    mHeader = data;

    // Paint cell content only when debugger is running
    setDrawDebugOnly(true);

    mRowCount = 0;

    mHeaderButtonSytle.setStyleSheet(" QPushButton {\n     background-color: rgb(192, 192, 192);\n     border-style: outset;\n     border-width: 2px;\n     border-color: rgb(128, 128, 128);\n }\n QPushButton:pressed {\n     background-color: rgb(192, 192, 192);\n     border-style: inset;\n }");

    mNbrOfLineToPrint = 0;

    memset(&mColResizeData, 0, sizeof(mColResizeData));

    mGuiState = AbstractTableView::NoState;

    mShouldReload = true;
    mAllowPainting = true;

    // ScrollBar Init
    setVerticalScrollBar(new AbstractTableScrollBar(verticalScrollBar()));
    setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
    memset(&mScrollBarAttributes, 0, sizeof(mScrollBarAttributes));
    horizontalScrollBar()->setRange(0, 0);
    horizontalScrollBar()->setPageStep(650);
    mMouseWheelScrollDelta = 4;
    setMouseTracking(true);

    // Slots
    connect(verticalScrollBar(), SIGNAL(actionTriggered(int)), this, SLOT(vertSliderActionSlot(int)));
    connect(Config(), SIGNAL(colorsUpdated()), this, SLOT(slot_updateColors()));
    connect(Config(), SIGNAL(fontsUpdated()), this, SLOT(slot_updateFonts()));
    connect(Config(), SIGNAL(shortcutsUpdated()), this, SLOT(slot_updateShortcuts()));

    // todo: try Qt::QueuedConnection to init
    Initialize();
}
Example #8
0
void Configuration::emitColorsUpdated()
{
    emit colorsUpdated();
}