Example #1
0
void SubtitleDrawer::setStyle(const SubtitleStyle &style) {
	m_style = style;
	updateStyle(m_front, style);
	updateStyle(m_back, style);
	if (style.outline.enabled)
		m_back.setTextOutline(style.outline.color, style.font.height()*style.outline.width*2.0);
	else
		m_back.setTextOutline(Qt::NoPen);
}
Example #2
0
void OBSHotkeyLabel::highlightPair(bool highlight)
{
	if (!pairPartner)
		return;

	pairPartner->setProperty("hotkeyPairHover", highlight);
	updateStyle(pairPartner);
	setProperty("hotkeyPairHover", highlight);
	updateStyle(this);
}
void RenderMathMLRoot::computePreferredLogicalWidths()
{
    ASSERT(preferredLogicalWidthsDirty());

    updateStyle();

    if (!isValid()) {
        m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = 0;
        setPreferredLogicalWidthsDirty(false);
        return;
    }

    LayoutUnit preferredWidth = 0;
    if (m_kind == SquareRoot) {
        preferredWidth += m_radicalOperator.maxPreferredWidth();
        setPreferredLogicalWidthsDirty(true);
        RenderMathMLRow::computePreferredLogicalWidths();
        preferredWidth += m_maxPreferredLogicalWidth;
    } else {
        ASSERT(m_kind == RootWithIndex);
        preferredWidth += m_kernBeforeDegree;
        preferredWidth += getIndex().maxPreferredLogicalWidth();
        preferredWidth += m_kernAfterDegree;
        preferredWidth += m_radicalOperator.maxPreferredWidth();
        preferredWidth += getBase().maxPreferredLogicalWidth();
    }

    m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = preferredWidth;
    setPreferredLogicalWidthsDirty(false);
}
Example #4
0
void QSkinObject::paintEvent(QPaintEvent *event)
{
	if(skinWidget)
	{
		
		updateStyle();
		QPainter p(&widgetMask);
		QObjectList ol = skinWidget->children();
		foreach(QObject *o, ol)
		{
			if(o->isWidgetType())
			{
				QWidget* child = dynamic_cast<QWidget*>(o);  
				
				p.drawPixmap(child->geometry(),drawCtrl(child ));
				
				
			}
				
		}
		p.end();
#ifdef WIN32
		updateAlpha(); 

#else
		p.begin(skinWidget);
		p.setRenderHint(QPainter::Antialiasing);
		p.drawPixmap(0,0,widgetMask);
		p.end();
#endif
		
	}

}
void ShutdownWidget::initUI() {
    m_requireShutdownButton = new RoundItemButton(tr("Shut down"), this);
    m_requireShutdownButton->setObjectName("RequireShutdownButton");
    m_requireShutdownButton->setAutoExclusive(true);

    m_requireRestartButton = new RoundItemButton(tr("Restart"), this);
    m_requireRestartButton->setObjectName("RequireRestartButton");
    m_requireRestartButton->setAutoExclusive(true);

    m_requireSuspendBUtton = new RoundItemButton(tr("Suspend"), this);
    m_requireSuspendBUtton->setObjectName("RequireSuspendButton");
    m_requireSuspendBUtton->setAutoExclusive(true);

    m_currentSelectedBtn = m_requireShutdownButton;
    m_currentSelectedBtn->updateState(RoundItemButton::Default);

    m_btnList = new QList<RoundItemButton*>;
    m_btnList->append(m_requireShutdownButton);
    m_btnList->append(m_requireRestartButton);
    m_btnList->append(m_requireSuspendBUtton);

    m_Layout = new QHBoxLayout;
    m_Layout->setMargin(0);
    m_Layout->setSpacing(10);
    m_Layout->addStretch(0);
    m_Layout->addWidget(m_requireShutdownButton);
    m_Layout->addWidget(m_requireRestartButton);
    m_Layout->addWidget(m_requireSuspendBUtton);
    m_Layout->addStretch(0);
    setLayout(m_Layout);

    updateStyle(":/skin/requireshutdown.qss", this);
}
Example #6
0
PathDisplay::PathDisplay()
{
  style_property_ = new EnumProperty( "Line Style", "Lines",
                                      "The rendering operation to use to draw the grid lines.",
                                      this, SLOT( updateStyle() ));

  style_property_->addOption( "Lines", LINES );
  style_property_->addOption( "Billboards", BILLBOARDS );

  line_width_property_ = new FloatProperty( "Line Width", 0.03,
                                            "The width, in meters, of each path line."
                                            "Only works with the 'Billboards' style.",
                                            this, SLOT( updateLineWidth() ), this );
  line_width_property_->setMin( 0.001 );
  line_width_property_->hide();

  color_property_ = new ColorProperty( "Color", QColor( 25, 255, 0 ),
                                       "Color to draw the path.", this );

  alpha_property_ = new FloatProperty( "Alpha", 1.0,
                                       "Amount of transparency to apply to the path.", this );

  buffer_length_property_ = new IntProperty( "Buffer Length", 1,
                                             "Number of paths to display.",
                                             this, SLOT( updateBufferLength() ));
  buffer_length_property_->setMin( 1 );

  offset_property_ = new VectorProperty( "Offset", Ogre::Vector3::ZERO,
                                         "Allows you to offset the path from the origin of the reference frame.  In meters.",
                                         this, SLOT( updateOffset() ));
}
Example #7
0
/* Widgets */
Widgets::Widgets(QWidget* parent)
    : QMainWindow(parent)
{
    m_officeStyle = Q_NULL;
    setWindowTitle(tr("Qtitan Widgets Sample"));

    m_styleName = qApp->style()->objectName();

    m_mdiArea = new QMdiArea;
    m_mdiArea->setViewMode(QMdiArea::TabbedView);
    m_mdiArea->setLineWidth(3);
    m_mdiArea->setFrameShape(QFrame::Panel);
    m_mdiArea->setFrameShadow(QFrame::Sunken);

    setCentralWidget(m_mdiArea);

    setIconSize(QSize(16, 16));

    createActions();
    createDockWindows();
    createMenubar();
    createToolbar();
    statusBar();

    createMdiChild();

    QRect geom = QApplication::desktop()->availableGeometry();
    resize(2 * geom.width() / 3, 2 * geom.height() / 3);

    updateStyle(m_actOffice2007Style);
    updateTheme(m_actBlueTheme);

    readSettings();
}
Example #8
0
GridButton::GridButton(const int i , const int j , QWidget *parent)
    :QPushButton(parent)
{
    setAccessibleName(QString("GridButton"));
    row = i;
    col = j;
    XIcon = QIcon(":/new/prefix1/images/x3.png");
    color = QColor(Qt::white);
    borderTop = QColor();
    borderRight = QColor();
    borderBottom = QColor();
    borderLeft = QColor();
    borderTop.setNamedColor("#A0A0A0");
    borderRight.setNamedColor("#A0A0A0");
    borderBottom.setNamedColor("#A0A0A0");
    borderLeft.setNamedColor("#A0A0A0");
    this->setFixedSize(20,20);

    //Load the stylesheet file for widgets
    QFile stylesFile(":/new/prefix1/qss/styles.qss");
    if(stylesFile.open(QIODevice::ReadOnly | QIODevice::Text))
    {
        qss = stylesFile.readAll();
        stylesFile.close();
    }
    initBorders();
    updateStyle();
}
void LayoutButton::setButtonChecked(bool checked) {
    if (checked) {
        this->setChecked(true);
        m_textLabel->setProperty("Checked", true);
        m_iconLabel->show();
        updateStyle(":/skin/layoutbutton.qss", this);
    } else {
        this->setChecked(false);
        m_textLabel->setProperty("Checked", false);
        updateStyle(":/skin/layoutbutton.qss", this);
        m_iconLabel->hide();
    }

    updateStyleSelf();

}
LayoutButton::LayoutButton(QString text, QWidget *parent)
    : QPushButton(parent)
{
    setObjectName("LayoutButton");
    setCheckable(true);

    m_text = text;
    m_iconLabel = new QLabel(this);
    QPixmap pix(":img/tick_hover.png");
    m_iconLabel->setPixmap(pix);
    m_iconLabel->setMinimumSize(pix.size());
    m_textLabel = new QLabel;
    m_textLabel->setObjectName("LayoutTextLabel");
    m_textLabel->setText(text);
    m_iconLabel->hide();

    QHBoxLayout* m_Layout = new QHBoxLayout;
    m_Layout->setContentsMargins(20, 0, 0, 0);
    m_Layout->setSpacing(0);

    m_Layout->addSpacing(5);
    m_Layout->addWidget(m_textLabel);
    m_Layout->addStretch();
    setLayout(m_Layout);

    m_iconLabel->move(this->x() + 5, this->y() + 4);


    updateStyle(":/skin/layoutbutton.qss", this);
}
void KbLayoutWidget::initUI() {
    setObjectName("KeyboardLayoutFrame");
    setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    this->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    setSelectionMode(QAbstractItemView::NoSelection);
    setResizeMode(Adjust);

    for (int i = 0; i < m_buttons.length(); i++) {
        LayoutButton* itemButton = new LayoutButton(m_buttons[i]);
        m_layoutButtons.append(itemButton);
        itemButton->setFixedSize(widget_width, DDESESSIONCC::LAYOUTBUTTON_HEIGHT);

        QFrame* borderFrame = new QFrame;
        borderFrame->setObjectName("LayoutBorderFrame");
        QVBoxLayout* borderLayout = new QVBoxLayout;
        borderLayout->setContentsMargins(0, 0, 0, 0);
        borderLayout->setSpacing(0);
        borderLayout->addWidget(itemButton);
        borderFrame->setLayout(borderLayout);
        borderFrame->setFixedSize(widget_width, DDESESSIONCC::LAYOUTBUTTON_HEIGHT);

        QListWidgetItem* item = new QListWidgetItem(this);
        item->sizeHint();
        this->addItem(item);
        setItemWidget(item,  borderFrame);
        this->setGridSize(QSize(widget_width, DDESESSIONCC::LAYOUTBUTTON_HEIGHT));
        this->setFixedWidth(widget_width);
    }
    this->setFixedHeight(DDESESSIONCC::LAYOUTBUTTON_HEIGHT*3);



    updateStyle(":/skin/keybdlayoutwidget.qss", this);
}
void PropertyWidget_Advanced::setCurrentItem(PageItem *item)
{
	if (!m_ScMW || m_ScMW->scriptIsRunning())
		return;
	//CB We shouldn't really need to process this if our item is the same one
	//maybe we do if the item has been changed by scripter.. but that should probably
	//set some status if so.
	//FIXME: This won't work until when a canvas deselect happens, m_item must be NULL.
	//if (m_item == i)
	//	return;

	if (item && m_doc.isNull())
		setDoc(item->doc());

	m_item = item;

	disconnectSignals();
	configureWidgets();

	if (m_item)
	{
		if (m_item->asTextFrame() || m_item->asPathText() || m_item->asTable())
		{
			ParagraphStyle parStyle =  m_item->itemText.defaultStyle();
			if (m_doc->appMode == modeEdit)
				m_item->currentTextProps(parStyle);
			else if (m_doc->appMode == modeEditTable)
				m_item->asTable()->activeCell().textFrame()->currentTextProps(parStyle);
			updateStyle(parStyle);
		}
		connectSignals();
	}
}
void MAbstractLayoutPolicy::setStyleName(const QString &name)
{
    Q_D(MAbstractLayoutPolicy);
    if (name == d->styleName)
        return;
    d->styleName = name;
    updateStyle();
}
Example #14
0
void ConfigTabAppearance::showEvent(QShowEvent *event)
{
    updateThemes();
    updateStyle();
    ui->scrollAreaTheme->setMinimumWidth( ui->scrollAreaThemeContents->minimumSizeHint().width()
                                          + ui->scrollAreaTheme->verticalScrollBar()->width() + 8);
    QWidget::showEvent(event);
}
Example #15
0
TextLabelWidget::TextLabelWidget(QWidget *parent) : QLineEdit(parent)
{
	updateStyle();
	setFrame(false);
	setReadOnly(true);
	setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
	setStyleSheet(QLatin1String("QLineEdit {background:transparent;}"));
}
Example #16
0
void TextLabelWidget::clear()
{
	QLineEdit::clear();

	m_url = QUrl();

	updateStyle();
}
Example #17
0
void UIWidget::mergeStyle(const OTMLNodePtr& styleNode)
{
    applyStyle(styleNode);
    std::string name = m_style->tag();
    std::string source = m_style->source();
    m_style->merge(styleNode);
    m_style->setTag(name);
    m_style->setSource(source);
    updateStyle();
}
void KateStyleTreeWidgetItem::unsetColor( int c )
{
  if ( c == 100 && currentStyle->hasProperty(QTextFormat::BackgroundBrush) )
    currentStyle->clearProperty(QTextFormat::BackgroundBrush);
  else if ( c == 101 && currentStyle->hasProperty(KTextEditor::Attribute::SelectedBackground) )
    currentStyle->clearProperty(KTextEditor::Attribute::SelectedBackground);
  updateStyle();

  treeWidget()->emitChanged();
}
Example #19
0
void GuiSettingsWidget::colorChanged(int index)
{
	SettingsProvider *settings = device()->settingsProvider();
	if(!settings) return;
	
	const QColor &selection = guiColors[index];
	settings->setValue(GUI_COLOR_KEY, selection);
	updateStyle(device());
	settings->sync();
}
/* ********************************************************************* */
void LogBookConfigDialog::createDialogContent()
{
	ui->setupUi(dialog);
	connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close()));
	setupWidgets();
	setupListViews();

	//Initialize the style
	updateStyle();
}
Example #21
0
GridDisplay::GridDisplay()
: Display()
{
  frame_property_ = new TfFrameProperty( "Reference Frame", TfFrameProperty::FIXED_FRAME_STRING,
                                         "The TF frame this grid will use for its origin.",
                                         this, 0, true );

  cell_count_property_ = new IntProperty( "Plane Cell Count", 10,
                                          "The number of cells to draw in the plane of the grid.",
                                          this, SLOT( updateCellCount() ));
  cell_count_property_->setMin( 1 );

  height_property_ = new IntProperty( "Normal Cell Count", 0,
                                      "The number of cells to draw along the normal vector of the grid. "
                                      " Setting to anything but 0 makes the grid 3D.",
                                      this, SLOT( updateHeight() ));
  height_property_->setMin( 0 );

  cell_size_property_ = new FloatProperty( "Cell Size", 1.0f,
                                           "The length, in meters, of the side of each cell.",
                                           this, SLOT( updateCellSize() ));
  cell_size_property_->setMin( 0.0001 );

  style_property_ = new EnumProperty( "Line Style", "Lines",
                                      "The rendering operation to use to draw the grid lines.",
                                      this, SLOT( updateStyle() ));
  style_property_->addOption( "Lines", Grid::Lines );
  style_property_->addOption( "Billboards", Grid::Billboards );

  line_width_property_ = new FloatProperty( "Line Width", 0.03,
                                            "The width, in meters, of each grid line.",
                                            style_property_, SLOT( updateLineWidth() ), this );
  line_width_property_->setMin( 0.001 );
  line_width_property_->hide();

  color_property_ = new ColorProperty( "Color", Qt::gray,
                                       "The color of the grid lines.",
                                       this, SLOT( updateColor() ));
  alpha_property_ = new FloatProperty( "Alpha", 0.5f,
                                       "The amount of transparency to apply to the grid lines.",
                                       this, SLOT( updateColor() ));
  alpha_property_->setMin( 0.0f );
  alpha_property_->setMax( 1.0f );

  plane_property_ = new EnumProperty( "Plane", "XY",
                                      "The plane to draw the grid along.",
                                      this, SLOT( updatePlane() ));
  plane_property_->addOption( "XY", XY );
  plane_property_->addOption( "XZ", XZ );
  plane_property_->addOption( "YZ", YZ );

  offset_property_ = new VectorProperty( "Offset", Ogre::Vector3::ZERO,
                                         "Allows you to offset the grid from the origin of the reference frame.  In meters.",
                                         this, SLOT( updateOffset() ));
}
Example #22
0
void NodeLabel::setText(const QString & text)
{
    // update the text
    m_text = QStaticText(text);
    m_text.setTextFormat(Qt::PlainText);
    QTextOption textOption =
        QTextOption(Qt::AlignHCenter | Qt::AlignBaseline);
    textOption.setUseDesignMetrics(false);
    m_text.setTextOption(textOption);
    updateStyle();
}
Example #23
0
void PropertiesPalette_Text::handleLineSpacingMode(int id)
{
	if ((m_haveDoc) && (m_haveItem))
	{
		Selection tempSelection(this, false);
		tempSelection.addItem(m_item, true);
		m_doc->itemSelection_SetLineSpacingMode(id, &tempSelection);
		updateStyle(((m_doc->appMode == modeEdit) || (m_doc->appMode == modeEditTable)) ? m_item->currentStyle() : m_item->itemText.defaultStyle());
		m_doc->regionsChanged()->update(QRect());
	}
}
Example #24
0
void UIWidget::setStyle(const std::string& styleName)
{
    OTMLNodePtr styleNode = g_ui.getStyle(styleName);
    if(!styleNode) {
        logTraceError("unable to retrive style '", styleName, "': not a defined style");
        return;
    }
    applyStyle(styleNode);
    m_style = styleNode;
    updateStyle();
}
Example #25
0
bool TextLabelWidget::event(QEvent *event)
{
	const bool result(QLineEdit::event(event));

	if (event->type() == QEvent::ApplicationPaletteChange || event->type() == QEvent::StyleChange)
	{
		updateStyle();
	}

	return result;
}
Example #26
0
void UIWidget::setStyle(const std::string& styleName)
{
    OTMLNodePtr styleNode = g_ui.getStyle(styleName);
    if(!styleNode) {
        g_logger.traceError(stdext::format("unable to retrieve style '%s': not a defined style", styleName));
        return;
    }
    styleNode = styleNode->clone();
    applyStyle(styleNode);
    m_style = styleNode;
    updateStyle();
}
Example #27
0
void MapCloudDisplay::onInitialize()
{
	MFDClass::onInitialize();

	transformer_class_loader_ = new pluginlib::ClassLoader<rviz::PointCloudTransformer>( "rviz", "rviz::PointCloudTransformer" );
	loadTransformers();

	updateStyle();
	updateBillboardSize();
	updateAlpha();

	spinner_.start();
}
Example #28
0
CanvasWidget::CanvasWidget(QWidget *parent) :
    QWidget(parent), selected(NULL), transformation(NONE)
{
    epsilon.x = 20;
    epsilon.y = 20;
    creatingType = 1;
    zigzagPointsAmount = 5;
    defaultOffsetParallelogram = 30.0;
    currentBackColor = Color(1, 1, 1, 1);
    currentLineColor = Color(.0, 0, 0, 1);
    arrowsTipCoefficient = 0.2;

    updateStyle();
}
Example #29
0
/* ********************************************************************* */
void TargetsDialog::createDialogContent()
{
	ui->setupUi(dialog);
	ui->targetsListView->setModel(tableModel);
	ui->targetsListView->setModelColumn(1);
	ui->typeComboBox->setModel(typeTableModel);
	ui->typeComboBox->setModelColumn(typeTableModel->fieldIndex("type"));
	
	setupConnections();
	ui->targetsListView->setCurrentIndex(tableModel->index(0, 1));	

	//Initialize the style
	updateStyle();
}
void PropertiesPalette_Text::setCurrentItem(PageItem *i)
{
	if (!m_ScMW || m_ScMW->scriptIsRunning())
		return;
	//CB We shouldn't really need to process this if our item is the same one
	//maybe we do if the item has been changed by scripter.. but that should probably
	//set some status if so.
	//FIXME: This won't work until when a canvas deselect happens, m_item must be NULL.
	//if (m_item == i)
	//	return;

	if (!m_doc)
		setDoc(i->doc());

	m_haveItem = false;
	m_item = i;

	showFirstLinePolicy(m_item->firstLineOffset());

	if ((m_item->isGroup()) && (!m_item->isSingleSel))
	{
		setEnabled(false);
	}

	m_haveItem = true;

	if (!sender())
	{
		colorWidgets->handleSelectionChanged();
		distanceWidgets->handleSelectionChanged();
		parEffectWidgets->handleSelectionChanged();
	}

	if (m_item->asTextFrame() || m_item->asPathText() || m_item->asTable())
	{
		ParagraphStyle parStyle =  m_item->itemText.defaultStyle();
		if (m_doc->appMode == modeEdit || m_doc->appMode == modeEditTable)
			m_item->currentTextProps(parStyle);
		updateStyle(parStyle);
	}
	if (m_item->asOSGFrame())
	{
		setEnabled(false);
	}
	if (m_item->asSymbolFrame())
	{
		setEnabled(false);
	}
}