Ejemplo n.º 1
0
void MonoText::setLatin(bool latin)
{
    if (latin == m_latin)
        return;

    m_latin = latin;
    emit latinChanged();
}
Ejemplo n.º 2
0
void Text::dispatchEvents()
{
    int old_line = m_old_line + (m_old_start_index / m_width);
    int new_line = m_line + (m_start_index / m_width);
    if (old_line != new_line) {
        m_old_line = m_line;
        emit lineChanged();
    }

    if (m_latin != m_latin_old) {
        m_latin_old = m_latin;
        emit latinChanged();
    }

    if (m_old_start_index != m_start_index
            || m_text_dirty) {
        m_text_dirty = false;
        QString old_text = m_text;
        m_text = m_text_line->mid(m_start_index, m_end_index - m_start_index + 1);
        if (m_old_start_index != m_start_index) {
            m_old_start_index = m_start_index;
            emit indexChanged();
        }
        emit textChanged();
    }

    if (m_style_dirty) {
        m_style_dirty = false;

        bool emit_foreground = m_new_style.foreground != m_style.foreground;
        bool emit_background = m_new_style.background != m_style.background;
        TextStyle::Styles new_style = m_new_style.style;
        TextStyle::Styles old_style = m_style.style;

        bool emit_bold = false;
        bool emit_blink = false;
        bool emit_underline = false;
        bool emit_inverse = false;
        if (new_style != old_style) {
            emit_bold = differentStyle(new_style, old_style, TextStyle::Bold);
            emit_blink = differentStyle(new_style, old_style, TextStyle::Blinking);
            emit_underline = differentStyle(new_style, old_style, TextStyle::Underlined);
            emit_inverse = differentStyle(new_style, old_style, TextStyle::Inverse);
        }

        m_style = m_new_style;
        if (emit_inverse) {
            setForegroundColor();
            setBackgroundColor();
        } else {
            if (emit_foreground || emit_bold) {
                setForegroundColor();
            }
            if (emit_background) {
                setBackgroundColor();
            }
        }

        if (emit_bold) {
            emit boldChanged();
        }

        if (emit_blink) {
            emit blinkingChanged();
        }

        if (emit_underline) {
            emit underlineChanged();
        }

    }


    if (m_visible_old != m_visible) {
        m_visible_old = m_visible;
        emit visibleChanged();
    }
}
Ejemplo n.º 3
0
LayoutConfig::LayoutConfig(QWidget *parent, const char *name) : KCModule(parent, name), m_rules(NULL)
{
    QVBoxLayout *main = new QVBoxLayout(this, 0, KDialog::spacingHint());

    widget = new LayoutConfigWidget(this, "widget");
    main->addWidget(widget);

    connect(widget->chkEnable, SIGNAL(toggled(bool)), this, SLOT(changed()));
    connect(widget->chkShowSingle, SIGNAL(toggled(bool)), this, SLOT(changed()));
    connect(widget->chkShowFlag, SIGNAL(toggled(bool)), this, SLOT(changed()));
    connect(widget->comboModel, SIGNAL(activated(int)), this, SLOT(changed()));

    connect(widget->listLayoutsSrc, SIGNAL(doubleClicked(QListViewItem *, const QPoint &, int)), this, SLOT(add()));
    connect(widget->btnAdd, SIGNAL(clicked()), this, SLOT(add()));
    connect(widget->btnRemove, SIGNAL(clicked()), this, SLOT(remove()));

    connect(widget->comboVariant, SIGNAL(activated(int)), this, SLOT(changed()));
    connect(widget->comboVariant, SIGNAL(activated(int)), this, SLOT(variantChanged()));
    connect(widget->listLayoutsDst, SIGNAL(selectionChanged(QListViewItem *)), this, SLOT(layoutSelChanged(QListViewItem *)));

    connect(widget->editDisplayName, SIGNAL(textChanged(const QString &)), this, SLOT(displayNameChanged(const QString &)));

    connect(widget->chkLatin, SIGNAL(clicked()), this, SLOT(changed()));
    connect(widget->chkLatin, SIGNAL(clicked()), this, SLOT(latinChanged()));

    widget->btnUp->setIconSet(SmallIconSet("1uparrow"));
    connect(widget->btnUp, SIGNAL(clicked()), this, SLOT(changed()));
    connect(widget->btnUp, SIGNAL(clicked()), this, SLOT(moveUp()));
    widget->btnDown->setIconSet(SmallIconSet("1downarrow"));
    connect(widget->btnDown, SIGNAL(clicked()), this, SLOT(changed()));
    connect(widget->btnDown, SIGNAL(clicked()), this, SLOT(moveDown()));

    connect(widget->grpSwitching, SIGNAL(clicked(int)), SLOT(changed()));

    connect(widget->chkEnableSticky, SIGNAL(toggled(bool)), this, SLOT(changed()));
    connect(widget->spinStickyDepth, SIGNAL(valueChanged(int)), this, SLOT(changed()));

    widget->listLayoutsSrc->setColumnText(LAYOUT_COLUMN_FLAG, "");
    widget->listLayoutsDst->setColumnText(LAYOUT_COLUMN_FLAG, "");
    widget->listLayoutsDst->setColumnText(LAYOUT_COLUMN_INCLUDE, "");
    //  widget->listLayoutsDst->setColumnText(LAYOUT_COLUMN_DISPLAY_NAME, "");

    widget->listLayoutsSrc->setColumnWidth(LAYOUT_COLUMN_FLAG, 28);
    widget->listLayoutsDst->setColumnWidth(LAYOUT_COLUMN_FLAG, 28);

    widget->listLayoutsDst->header()->setResizeEnabled(FALSE, LAYOUT_COLUMN_INCLUDE);
    widget->listLayoutsDst->header()->setResizeEnabled(FALSE, LAYOUT_COLUMN_DISPLAY_NAME);
    widget->listLayoutsDst->setColumnWidthMode(LAYOUT_COLUMN_INCLUDE, QListView::Manual);
    widget->listLayoutsDst->setColumnWidth(LAYOUT_COLUMN_INCLUDE, 0);
    //  widget->listLayoutsDst->setColumnWidth(LAYOUT_COLUMN_DISPLAY_NAME, 0);

    widget->listLayoutsDst->setSorting(-1);
#if 0
  widget->listLayoutsDst->setResizeMode(QListView::LastColumn);
  widget->listLayoutsSrc->setResizeMode(QListView::LastColumn);
#endif
    widget->listLayoutsDst->setResizeMode(QListView::LastColumn);

    // Read rules - we _must_ read _before_ creating xkb-options comboboxes
    loadRules();

    makeOptionsTab();

    load();
}