示例#1
0
void VCWidget::resetBackgroundColor()
{
    m_hasCustomBackgroundColor = false;
    m_backgroundColor = Qt::gray;
    setDocModified();
    emit backgroundColorChanged(m_backgroundColor);
}
示例#2
0
CharacterGeneral::CharacterGeneral(QWidget *parent, bool uniqueFormat)
        : QWidget(parent),
        m_blockSignals(false),
        m_nameVisible(true),
        m_style(0)
{
    widget.setupUi(this);

    m_layoutTab = new FontLayoutTab(true, uniqueFormat, this);

    m_characterDecorations = new FontDecorations(uniqueFormat, this);
    connect(m_characterDecorations, SIGNAL(backgroundColorChanged(QColor)), this, SLOT(slotBackgroundColorChanged(QColor)));
    connect(m_characterDecorations, SIGNAL(textColorChanged(QColor)), this, SLOT(slotTextColorChanged(QColor)));

    m_characterHighlighting = new CharacterHighlighting(uniqueFormat, this);
    connect(m_characterHighlighting, SIGNAL(underlineChanged(KCharacterStyle::LineType, KCharacterStyle::LineStyle, QColor)), this, SLOT(slotUnderlineChanged(KCharacterStyle::LineType, KCharacterStyle::LineStyle, QColor)));
    connect(m_characterHighlighting, SIGNAL(strikethroughChanged(KCharacterStyle::LineType, KCharacterStyle::LineStyle, QColor)), this, SLOT(slotStrikethroughChanged(KCharacterStyle::LineType, KCharacterStyle::LineStyle, QColor)));
    connect(m_characterHighlighting, SIGNAL(capitalizationChanged(QFont::Capitalization)), this, SLOT(slotCapitalizationChanged(QFont::Capitalization)));

    m_fontTab = new FontTab(uniqueFormat, this);
    connect(m_fontTab, SIGNAL(fontChanged(const QFont &)), this, SLOT(slotFontSelected(const QFont &)));

    m_languageTab = new LanguageTab(uniqueFormat, this);

    widget.tabs->addTab(m_fontTab, i18n("Font"));
    widget.tabs->addTab(m_characterDecorations, i18n("Decorations"));
    widget.tabs->addTab(m_characterHighlighting, i18n("Highlighting"));
    widget.tabs->addTab(m_layoutTab, i18n("Layout"));
    //widget.tabs->addTab(m_languageTab, i18n("Language"));
    m_languageTab->setVisible(false);

    connect(widget.name, SIGNAL(textChanged(const QString &)), this, SIGNAL(nameChanged(const QString&)));
    connect(widget.name, SIGNAL(textChanged(const QString &)), this, SLOT(setName(const QString&)));
}
示例#3
0
void QGLView::setBackgroundColor(const QColor &t)
{
    if (t == m_backgroundColor)
        return;
    m_backgroundColor = t;
    emit backgroundColorChanged();
    update();
}
void BusyIndicator::setBackgroundColor( const QColor& color )
{
    if ( m_backgroundColor == color )
        return;
    m_backgroundColor = color;
    updateSpinner();
    emit backgroundColorChanged();
}
示例#5
0
void QDeclarativeWebView::setBackgroundColor(const QColor& color)
{
    QPalette palette = d->view->palette();
    if (palette.base().color() == color)
        return;
    palette.setBrush(QPalette::Base, color);
    d->view->setPalette(palette);
    emit backgroundColorChanged();
}
示例#6
0
void TextLineNumbers::setBackgroundColor( const QColor& c )
{
	if ( c == mBackgroundColor )
		return;
	mBackgroundColor = c;
	QPalette p( palette() );
	p.setColor( backgroundRole(), mBackgroundColor );
	setPalette( p );
	emit backgroundColorChanged( mBackgroundColor );
}
示例#7
0
/*! \property QCustom3DLabel::backgroundColor
 *
 * \brief The color for the label background, if enabled.
 *
 * Defaults to \c{Qt::gray}.
 *
 * \sa backgroundEnabled
 */
void QCustom3DLabel::setBackgroundColor(const QColor &color)
{
    if (dptr()->m_bgrColor != color) {
        dptr()->m_bgrColor = color;
        dptr()->m_customVisuals = true;
        dptr()->handleTextureChange();
        emit backgroundColorChanged(color);
        emit dptr()->needUpdate();
    }
}
示例#8
0
void FractalModel::setBackgroundColor( const QColor& color )
{
    if ( m_backgroundColor != color ) {
        m_backgroundColor = color;
        m_presenter->setBackgroundColor( color );
        if ( m_previewPresenter )
            m_previewPresenter->setBackgroundColor( color );
        emit backgroundColorChanged();
    }
}
示例#9
0
void VCWidget::setBackgroundColor(QColor backgroundColor)
{
    if (m_backgroundColor == backgroundColor)
        return;

    m_backgroundColor = backgroundColor;
    m_hasCustomBackgroundColor = true;
    setDocModified();
    emit backgroundColorChanged(backgroundColor);
}
示例#10
0
void FilterWidget::setBackgroundColor(const QColor &c)
{
    if (c == ui->mButtonBackgroundColor->color())
        return;

    mEmitSignals = false;
    ui->mButtonBackgroundColor->setColor(c);
    mEmitSignals = true;

    emit backgroundColorChanged(c);
}
示例#11
0
void Text::setBackgroundColor()
{
    QColor new_background;
    if (m_style.style & TextStyle::Inverse) {
        new_background = m_style.foreground;
    } else {
        new_background = m_style.background;
    }
    if (new_background != m_backgroundColor) {
        m_backgroundColor = new_background;
        emit backgroundColorChanged();
    }
}
void BackgroundWidget::chooseColor()
{
    QColor color = QColorDialog::getColor( Qt::green, this );

    if( !color.isValid( ))
        return;

    colorLabel_->setText( color.name());
    colorLabel_->setPalette( QPalette( color ));

    configuration_.setBackgroundColor( color );
    emit backgroundColorChanged( color );
}
示例#13
0
文件: text.cpp 项目: pvuorela/yat
void Text::setBackgroundColor()
{
    QColor new_background;
    if (m_style.style & TextStyle::Inverse) {
        new_background = m_screen->colorPalette()->color(m_style.forground, false);
    } else {
        new_background = m_screen->colorPalette()->color(m_style.background, false);
    }
    if (new_background != m_backgroundColor) {
        m_backgroundColor = new_background;
        emit backgroundColorChanged();
    }
}
示例#14
0
文件: NoteView.cpp 项目: KDE/labplot
NoteView::NoteView(Note* notes) : m_notes(notes) {

	QHBoxLayout* layout = new QHBoxLayout(this);
	layout->setContentsMargins(0, 0, 0, 0);
	
	m_textEdit = new QTextEdit(this);

	QPalette palette = m_textEdit->palette();

	palette.setColor(QPalette::Base, m_notes->backgroundColor());
	palette.setColor(QPalette::Text, m_notes->textColor());

	m_textEdit->setPalette(palette);
	m_textEdit->setFont(m_notes->textFont());
	m_textEdit->setText(m_notes->note());

	layout->addWidget(m_textEdit);
	
	connect(m_notes, SIGNAL(backgroundColorChanged(QColor)), this, SLOT(backgroundColorChanged(QColor)));
	connect(m_notes, SIGNAL(textColorChanged(QColor)), this, SLOT(textColorChanged(QColor)));
	connect(m_notes, SIGNAL(textFontChanged(QFont)), this, SLOT(textFontChanged(QFont)));
	connect(m_textEdit, SIGNAL(textChanged()), this, SLOT(textChanged()));
}
示例#15
0
void FractalModel::setColorSettings( const Gradient& gradient, const QColor& backround, const ColorMapping& mapping )
{
    if ( m_gradient != gradient || m_backgroundColor != backround || m_colorMapping != mapping ) {
        m_gradient = gradient;
        m_backgroundColor = backround;
        m_colorMapping = mapping;
        m_presenter->setColorSettings( gradient, backround, mapping );
        if ( m_previewPresenter )
            m_previewPresenter->setColorSettings( gradient, backround, mapping );
        emit gradientChanged();
        emit backgroundColorChanged();
        emit colorMappingChanged();
    }
}
示例#16
0
void ToolSettings::swapForegroundBackground()
{
	QColor oldForeground = _foreground;
	_foreground = _background;
	_background = oldForeground;

	_currenttool->setForeground(_foreground);
	_currenttool->setBackground(_background);
	_toolprops[_currentQuickslot].setForegroundColor(_foreground);
	_toolprops[_currentQuickslot].setBackgroundColor(_background);
	updateToolSlot(_currentQuickslot, false);

	emit foregroundColorChanged(_foreground);
	emit backgroundColorChanged(_background);
}
示例#17
0
void ToolSettings::setBackgroundColor(const QColor& color)
{
	if(color != _background) {
		_background = color;

		_currenttool->setBackground(color);
		_toolprops[_currentQuickslot].setBackgroundColor(color);
		updateToolSlot(_currentQuickslot, false);

		if(_bgdialog->isVisible())
			_bgdialog->setColor(color);

		emit backgroundColorChanged(color);
	}
}
示例#18
0
void kpDualColorButton::setColor (int which, const kpColor &color)
{
    Q_ASSERT (which == 0 || which == 1);

    if (m_color [which] == color)
        return;

    m_oldColor [which] = m_color [which];
    m_color [which] = color;
    update ();

    if (which == 0)
        emit foregroundColorChanged (color);
    else
        emit backgroundColorChanged (color);
}
示例#19
0
文件: NoteDock.cpp 项目: KDE/labplot
NoteDock::NoteDock(QWidget *parent) : QWidget(parent), m_initializing(false), m_notes(0) {
	ui.setupUi(this);

	connect(ui.leName, SIGNAL(returnPressed(QString)), this, SLOT(nameChanged(QString)));
	connect(ui.leComment, SIGNAL(returnPressed(QString)), this, SLOT(commentChanged(QString)));
	
	connect(ui.kcbBgColor, SIGNAL(changed(QColor)), this, SLOT(backgroundColorChanged(QColor)));
	connect(ui.kcbTextColor, SIGNAL(changed(QColor)), this, SLOT(textColorChanged(QColor)));
	connect(ui.kfrTextFont, SIGNAL(fontSelected(QFont)), this, SLOT(textFontChanged(QFont)));

	TemplateHandler* templateHandler = new TemplateHandler(this, TemplateHandler::Worksheet);
	ui.gridLayout->addWidget(templateHandler, 8, 3);
	templateHandler->show();
	connect(templateHandler, SIGNAL(loadConfigRequested(KConfig&)), this, SLOT(loadConfigFromTemplate(KConfig&)));
	connect(templateHandler, SIGNAL(saveConfigRequested(KConfig&)), this, SLOT(saveConfigAsTemplate(KConfig&)));
}
示例#20
0
// protected virtual [base QWidget]
void kpTransparentColorCell::mouseReleaseEvent (QMouseEvent *e)
{
    if (rect ().contains (e->pos ()))
    {
        if (e->button () == Qt::LeftButton)
        {
            emit transparentColorSelected (0);
            emit foregroundColorChanged (kpColor::Transparent);
        }
        else if (e->button () == Qt::RightButton)
        {
            emit transparentColorSelected (1);
            emit backgroundColorChanged (kpColor::Transparent);
        }
    }
}
示例#21
0
 void WhiteBoardColorChooser::setColor(ColorLayer layer, const QColor& color)
 {
     switch (layer)
     {
     case ForegroundColor:
         setForegroundColor(color);
         emit foregroundColorChanged(color);
         break;
     case BackgroundColor:
         setBackgroundColor(color);
         emit backgroundColorChanged(color);
         break;
     default:
         Q_ASSERT(false);
         return;
     }
 }
int Velasquez::EditorScene::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QGraphicsScene::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: cleared(); break;
        case 1: backgroundColorChanged((*reinterpret_cast< const QColor(*)>(_a[1]))); break;
        case 2: itemAdded((*reinterpret_cast< QGraphicsItem*(*)>(_a[1]))); break;
        case 3: itemRemoved((*reinterpret_cast< QGraphicsItem*(*)>(_a[1]))); break;
        case 4: onSelectionChanged(); break;
        default: ;
        }
        _id -= 5;
    }
    return _id;
}
void BackgroundWidget::reject()
{
    // Revert to saved settings
    colorLabel_->setText( previousColor_.name( ));
    colorLabel_->setPalette( QPalette( previousColor_ ));
    backgroundLabel_->setText( previousBackgroundURI_ );

    configuration_.setBackgroundColor( previousColor_ );
    configuration_.setBackgroundUri( previousBackgroundURI_ );

    ContentPtr content;
    if( !previousBackgroundURI_.isEmpty( ))
        content = ContentFactory::getContent( previousBackgroundURI_ );

    emit backgroundContentChanged( content );
    emit backgroundColorChanged( previousColor_ );

    QDialog::reject();
}
示例#24
0
QgsAnnotationWidget::QgsAnnotationWidget( QgsAnnotationItem* item, QWidget * parent, Qt::WindowFlags f ): QWidget( parent, f ), mItem( item ), mMarkerSymbol( nullptr )
{
  setupUi( this );

  if ( mItem )
  {
    blockAllSignals( true );

    if ( mItem->hasFixedMapPosition() )
    {
      mMapPositionFixedCheckBox->setCheckState( Qt::Checked );
    }
    else
    {
      mMapPositionFixedCheckBox->setCheckState( Qt::Unchecked );
    }
    mFrameWidthSpinBox->setValue( mItem->frameBorderWidth() );
    mFrameColorButton->setColor( mItem->frameColor() );
    mFrameColorButton->setColorDialogTitle( tr( "Select frame color" ) );
    mFrameColorButton->setAllowAlpha( true );
    mFrameColorButton->setContext( QStringLiteral( "symbology" ) );
    mFrameColorButton->setNoColorString( tr( "Transparent frame" ) );
    mFrameColorButton->setShowNoColor( true );
    mBackgroundColorButton->setColor( mItem->frameBackgroundColor() );
    mBackgroundColorButton->setColorDialogTitle( tr( "Select background color" ) );
    mBackgroundColorButton->setAllowAlpha( true );
    mBackgroundColorButton->setContext( QStringLiteral( "symbology" ) );
    mBackgroundColorButton->setNoColorString( tr( "Transparent" ) );
    mBackgroundColorButton->setShowNoColor( true );

    connect( mBackgroundColorButton, SIGNAL( colorChanged( QColor ) ), this, SIGNAL( backgroundColorChanged( QColor ) ) );

    const QgsMarkerSymbol* symbol = mItem->markerSymbol();
    if ( symbol )
    {
      mMarkerSymbol.reset( symbol->clone() );
      updateCenterIcon();
    }

    blockAllSignals( false );
  }
}
示例#25
0
// protected virtual [base QWidget]
void kpDualColorButton::mouseReleaseEvent (QMouseEvent *e)
{
    m_dragStartPoint = KP_INVALID_POINT;

    if (swapPixmapRect ().contains (e->pos ()) &&
        m_color [0] != m_color [1])
    {
    #if DEBUG_KP_DUAL_COLOR_BUTTON && 1
        qCDebug(kpLogWidgets) << "kpDualColorButton::mouseReleaseEvent() swap colors:";
    #endif
        m_oldColor [0] = m_color [0];
        m_oldColor [1] = m_color [1];

        kpColor temp = m_color [0];
        m_color [0] = m_color [1];
        m_color [1] = temp;

        update ();

        emit colorsSwapped (m_color [0], m_color [1]);
        emit foregroundColorChanged (m_color [0]);
        emit backgroundColorChanged (m_color [1]);
    }
}
示例#26
0
void Configuration::setBackgroundColor(QString value)
{
  backgroundColor = value;
  backgroundColorChanged();
}
示例#27
0
CoreEngine::CoreEngine(QWidget *parent) :
        QMainWindow(parent)
{
    /*init the index of the currently selected image
     *this index is updated from qml layer and coreengine
     *it depends on how the index was changed see wheelEvent and qmlInterface
     *for more informations
     */
    this->curr_qml_index = 0;

    /*this is the default Window title*/
    this->default_title = "Qim";
    //setWindowIcon(QIcon("theme/icon/qim.icon-256.png"));

    /*extension objects instantiation*/
    this->main_local = new QLocale;

    /** the CustomDialogBox is an object which provides the dialog for machine -> user communication*/
    this->dialog_box = new CustomDialogBox();

    this->imange_data_model = new ImageDataModel();

    /*this is the config handling class it is important that the confighandler is
     *instatiated before proceed with other classes which use the config handler
     */
    this->config_handler = new ConfigHandler(this);
    this->config_dialog = new ConfigDialog(this,this,this->getConfigHandler());
    /*initialize the image handler object which provides the image and directory data*/
    this->image_handler = new ImageHandler(this);

    /*initialize the styling manager*/
//this->theme_manager = new ThemeManager(this);

    /*initialize the info handler object which contains all kinds of information about the shown image*/
    this->file_info_handler = new FileInfoHandler(this);

    /*this object is the interface object between c++ logic layer and the qml ui layer*/
    this->qml_interface = new QmlInterface(this);

    /*instatiate and load the qml declarative ui into the qml viewer*/
    this->visual_qml_view = new QDeclarativeView;

    /*initialize the context with the root context of the qml viewer*/
    this->context = this->visual_qml_view->rootContext();

    /*the zooming feature scales the image by the scale factor*/
    this->scale_factor_x = SCALEFACTORX;
    this->scale_factor_y = SCALEFACTORY;


    /*signal slot connections*/
    /** connect opacity changes in the config dialog with the QmlInterface*/
    connect(this->config_handler,SIGNAL(backgroundOpacityChanged(float)),this->qml_interface,SLOT(on_backgroundOpacityChanged(float)));
    /** connect color changes in the config dialog with the QmlInterface*/
    connect(this->config_handler,SIGNAL(backgroundColorChanged(QString)),this->qml_interface,SLOT(on_backgroundColorChanged(QString)));
    /** connect blacklisted formats line edit in the config dialog with FileSupport::initFileBlacklistMap*/
    connect(this->config_handler,SIGNAL(blacklistedFormatsChanged(QString)),this->image_handler->getFileSupport(),SLOT(onBlacklistedFormatsChanged(QString)));

    /*define visual options of the main window*/
    this->setUpMainWindow();


}
示例#28
0
void FilterWidget::on_mButtonBackgroundColor_colorChanged(const QColor &c)
{
    if (mEmitSignals)
        emit backgroundColorChanged(c);
}
ToolSettings::ToolSettings(QWidget *parent)
	: QDockWidget(parent), _currentQuickslot(0), _eraserOverride(0)
{
	// Initialize tool slots
	_toolprops.reserve(QUICK_SLOTS);
	for(int i=0;i<QUICK_SLOTS;++i)
		_toolprops.append(tools::ToolsetProperties());

	// Initialize UI
	QWidget *w = new QWidget(this);
	setWidget(w);

	auto *layout = new QVBoxLayout(w);
	layout->setMargin(3);

	auto *hlayout = new QHBoxLayout;
	hlayout->setContentsMargins(3, 3, 3, 0);
	layout->addLayout(hlayout);

	// Create quick toolchange slot buttons
	QButtonGroup *quickbuttons = new QButtonGroup(this);
	quickbuttons->setExclusive(true);
	for(int i=0;i<QUICK_SLOTS;++i) {
		auto *b = new widgets::ToolSlotButton(w);

		b->setCheckable(true);
		b->setText(QString::number(i+1));
		b->setMinimumSize(32, 32);
		b->setAutoRaise(true);

		hlayout->addWidget(b);
		quickbuttons->addButton(b, i);
		_quickslot[i] = b;
	}

	connect(quickbuttons, SIGNAL(buttonClicked(int)), this, SLOT(setToolSlot(int)));

	hlayout->addSpacerItem(new QSpacerItem(10, 1, QSizePolicy::Expanding));

	// Create foreground/background color changing widget
	_fgbgcolor = new widgets::DualColorButton(w);
	_fgbgcolor->setMinimumSize(32,32);
	hlayout->addWidget(_fgbgcolor);

	connect(_fgbgcolor, &widgets::DualColorButton::foregroundChanged, [this](const QColor &c){
		_currenttool->setForeground(c);
		_toolprops[_currentQuickslot].setForegroundColor(c);
		updateToolSlot(_currentQuickslot, false);
		emit foregroundColorChanged(c);
	});
	connect(_fgbgcolor, &widgets::DualColorButton::backgroundChanged, [this](const QColor &c){
		_currenttool->setBackground(c);
		_toolprops[_currentQuickslot].setBackgroundColor(c);
		updateToolSlot(_currentQuickslot, false);
		emit backgroundColorChanged(c);
	});

	// Create a widget stack
	_widgets = new QStackedWidget(this);
	layout->addWidget(_widgets, 1);

	_pensettings = new tools::PenSettings("pen", tr("Pen"));
	_widgets->addWidget(_pensettings->createUi(this));

	_brushsettings = new tools::BrushSettings("brush", tr("Brush"));
	_widgets->addWidget(_brushsettings->createUi(this));
	_currenttool = _brushsettings;

	_erasersettings = new tools::EraserSettings("eraser", tr("Eraser"));
	_widgets->addWidget(_erasersettings->createUi(this));

	_pickersettings = new tools::ColorPickerSettings("picker", tr("Color picker"));
	_widgets->addWidget(_pickersettings->createUi(this));

	_linesettings = new tools::SimpleSettings("line", tr("Line"), icon::fromTheme("draw-line"), tools::SimpleSettings::Line, true);
	_widgets->addWidget(_linesettings->createUi(this));

	_rectsettings = new tools::SimpleSettings("rectangle", tr("Rectangle"), icon::fromTheme("draw-rectangle"), tools::SimpleSettings::Rectangle, false);
	_widgets->addWidget(_rectsettings->createUi(this));

	_ellipsesettings = new tools::SimpleSettings("ellipse", tr("Ellipse"), icon::fromTheme("draw-ellipse"), tools::SimpleSettings::Ellipse, true);
	_widgets->addWidget(_ellipsesettings->createUi(this));

	_fillsettings = new tools::FillSettings("fill", tr("Flood fill"));
	_widgets->addWidget(_fillsettings->createUi(this));

	_textsettings = new tools::AnnotationSettings("annotation", tr("Annotation"));
	_widgets->addWidget(_textsettings->createUi(this));

	_selectionsettings = new tools::SelectionSettings("selection", tr("Selection"));
	_widgets->addWidget(_selectionsettings->createUi(this));

	_lasersettings = new tools::LaserPointerSettings("laser", tr("Laser pointer"));
	_widgets->addWidget(_lasersettings->createUi(this));

	connect(_pickersettings, SIGNAL(colorSelected(QColor)), _fgbgcolor, SLOT(setForeground(QColor)));

	// Create color changer dialogs
	auto dlg_fgcolor = new Color_Dialog(this);
	dlg_fgcolor->setAlphaEnabled(false);
	dlg_fgcolor->setWindowTitle(tr("Foreground color"));
	connect(dlg_fgcolor, SIGNAL(colorSelected(QColor)), this, SLOT(setForegroundColor(QColor)));
	connect(_fgbgcolor, SIGNAL(foregroundClicked(QColor)), dlg_fgcolor, SLOT(showColor(QColor)));

	auto dlg_bgcolor = new Color_Dialog(this);
	dlg_bgcolor->setWindowTitle(tr("Background color"));
	dlg_bgcolor->setAlphaEnabled(false);
	connect(dlg_bgcolor, SIGNAL(colorSelected(QColor)), this, SLOT(setBackgroundColor(QColor)));
	connect(_fgbgcolor, SIGNAL(backgroundClicked(QColor)), dlg_bgcolor, SLOT(showColor(QColor)));
}