Beispiel #1
0
void PropertiesPalette_Table::updateBorders()
{
	if (!m_doc || !m_item || !m_item->isTable())
		return;

	PageItem_Table* table = m_item->asTable();
	TableSideSelector::Sides selectedSides = sideSelector->selection();

	m_doc->dontResize = true;
	if (m_doc->appMode != modeEditTable)
	{
		if (selectedSides & TableSideSelector::Left)
			table->setLeftBorder(m_currentBorder);
		if (selectedSides & TableSideSelector::Right)
			table->setRightBorder(m_currentBorder);
		if (selectedSides & TableSideSelector::Top)
			table->setTopBorder(m_currentBorder);
		if (selectedSides & TableSideSelector::Bottom)
			table->setBottomBorder(m_currentBorder);
	}
	else
	{
		TableCell cell = table->activeCell();
		if (selectedSides & TableSideSelector::Left)
			cell.setLeftBorder(m_currentBorder);
		if (selectedSides & TableSideSelector::Right)
			cell.setRightBorder(m_currentBorder);
		if (selectedSides & TableSideSelector::Top)
			cell.setTopBorder(m_currentBorder);
		if (selectedSides & TableSideSelector::Bottom)
			cell.setBottomBorder(m_currentBorder);
	}
	table->adjustTable();
	table->update();
}
Beispiel #2
0
void PropertiesPalette_Table::on_buttonClearTableStyle_clicked()
{
	if (!m_item || !m_item->isTable())
		return;
	PageItem_Table* table = m_item->asTable();
	table->unsetDirectFormatting();
	table->update();
}
Beispiel #3
0
void PropertiesPalette_Table::on_buttonClearCellStyle_clicked()
{
	if (!m_item || !m_item->isTable())
		return;
	m_doc->dontResize = true;
	PageItem_Table* table = m_item->asTable();
	table->activeCell().unsetDirectFormatting();
	table->adjustTable();
	table->update();
}
Beispiel #4
0
void PropertiesPalette_Table::on_fillShade_valueChanged(int shade)
{
	if (!m_item || !m_item->isTable())
		return;

	QString color = fillColor->currentColor();
	if (color == CommonStrings::tr_NoneColor)
		color = CommonStrings::None;
	PageItem_Table* table = m_item->asTable();
	if (m_doc->appMode != modeEditTable)
	{
		table->setFillColor(color);
		table->setFillShade(shade);
	}
	else
	{
		TableCell cell = table->activeCell();
		cell.setFillColor(color);
		cell.setFillShade(shade);
	}
	table->update();
}
Beispiel #5
0
void PropertiesPalette_Table::on_fillColor_activated(const QString& colorName)
{
	if (!m_item || !m_item->isTable())
		return;
	QString color = colorName;
	if (colorName == CommonStrings::tr_NoneColor)
		color = CommonStrings::None;
	PageItem_Table* table = m_item->asTable();
	if (m_doc->appMode != modeEditTable)
	{
		table->setFillColor(color);
		table->setFillShade(fillShade->value());
	}
	else
	{
		TableCell cell = table->activeCell();
		cell.setFillColor(color);
		cell.setFillShade(fillShade->value());
	}

	table->update();
}