mirror of
https://github.com/JakubMelka/PDF4QT.git
synced 2025-06-05 21:59:17 +02:00
Signature plugin: icons
This commit is contained in:
@@ -50,12 +50,21 @@ PDFPageContentEditorStyleSettings::PDFPageContentEditorStyleSettings(QWidget* pa
|
||||
ui->penStyleCombo->addItem(tr("Dash-dot"), int(Qt::DashDotLine));
|
||||
ui->penStyleCombo->addItem(tr("Dash-dot-dot"), int(Qt::DashDotDotLine));
|
||||
|
||||
ui->brushStyleCombo->addItem(tr("None"), int(Qt::NoBrush));
|
||||
ui->brushStyleCombo->addItem(tr("Solid"), int(Qt::SolidPattern));
|
||||
ui->brushStyleCombo->addItem(tr("Horizontal"), int(Qt::HorPattern));
|
||||
ui->brushStyleCombo->addItem(tr("Vertical"), int(Qt::VerPattern));
|
||||
ui->brushStyleCombo->addItem(tr("B-Diagonal"), int(Qt::BDiagPattern));
|
||||
ui->brushStyleCombo->addItem(tr("F-Diagonal"), int(Qt::FDiagPattern));
|
||||
ui->brushStyleCombo->addItem(tr("Cross"), int(Qt::CrossPattern));
|
||||
|
||||
connect(ui->fontComboBox, &QFontComboBox::currentFontChanged, this, &PDFPageContentEditorStyleSettings::onFontChanged);
|
||||
connect(ui->selectPenColorButton, &QToolButton::clicked, this, &PDFPageContentEditorStyleSettings::onSelectPenColorButtonClicked);
|
||||
connect(ui->selectBrushColorButton, &QToolButton::clicked, this, &PDFPageContentEditorStyleSettings::onSelectBrushColorButtonClicked);
|
||||
connect(ui->selectFontButton, &QToolButton::clicked, this, &PDFPageContentEditorStyleSettings::onSelectFontButtonClicked);
|
||||
connect(ui->penWidthEdit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &PDFPageContentEditorStyleSettings::onPenWidthChanged);
|
||||
connect(ui->penStyleCombo, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &PDFPageContentEditorStyleSettings::onPenStyleChanged);
|
||||
connect(ui->brushStyleCombo, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &PDFPageContentEditorStyleSettings::onBrushStyleChanged);
|
||||
connect(ui->textAngleEdit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &PDFPageContentEditorStyleSettings::onTextAngleChanged);
|
||||
connect(ui->penColorCombo->lineEdit(), &QLineEdit::editingFinished, this, &PDFPageContentEditorStyleSettings::onPenColorComboTextChanged);
|
||||
connect(ui->penColorCombo, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &PDFPageContentEditorStyleSettings::onPenColorComboIndexChanged);
|
||||
@@ -121,6 +130,9 @@ void PDFPageContentEditorStyleSettings::loadFromElement(const PDFPageContentElem
|
||||
ui->penColorLabel->setEnabled(hasPenColor);
|
||||
ui->selectPenColorButton->setEnabled(hasPenColor);
|
||||
|
||||
ui->brushStyleLabel->setEnabled(hasBrush);
|
||||
ui->brushStyleCombo->setEnabled(hasBrush);
|
||||
|
||||
ui->brushColorCombo->setEnabled(hasBrush);
|
||||
ui->brushColorLabel->setEnabled(hasBrush);
|
||||
ui->selectBrushColorButton->setEnabled(hasBrush);
|
||||
@@ -187,6 +199,7 @@ void PDFPageContentEditorStyleSettings::setBrush(const QBrush& brush, bool force
|
||||
const bool oldBlockSignals = blockSignals(true);
|
||||
|
||||
m_brush = brush;
|
||||
ui->brushStyleCombo->setCurrentIndex(ui->brushStyleCombo->findData(int(brush.style())));
|
||||
setColorToComboBox(ui->brushColorCombo, brush.color());
|
||||
|
||||
blockSignals(oldBlockSignals);
|
||||
@@ -358,6 +371,16 @@ void PDFPageContentEditorStyleSettings::onPenStyleChanged()
|
||||
}
|
||||
}
|
||||
|
||||
void PDFPageContentEditorStyleSettings::onBrushStyleChanged()
|
||||
{
|
||||
Qt::BrushStyle brushStyle = static_cast<Qt::BrushStyle>(ui->brushStyleCombo->currentData().toInt());
|
||||
if (m_brush.style() != brushStyle)
|
||||
{
|
||||
m_brush.setStyle(brushStyle);
|
||||
emit brushChanged(m_brush);
|
||||
}
|
||||
}
|
||||
|
||||
void PDFPageContentEditorStyleSettings::onPenColorComboTextChanged()
|
||||
{
|
||||
QColor color(ui->penColorCombo->currentText());
|
||||
|
@@ -82,6 +82,7 @@ private slots:
|
||||
void onTextAngleChanged(double value);
|
||||
void onAlignmentRadioButtonClicked(int alignment);
|
||||
void onPenStyleChanged();
|
||||
void onBrushStyleChanged();
|
||||
void onPenColorComboTextChanged();
|
||||
void onPenColorComboIndexChanged();
|
||||
void onBrushColorComboTextChanged();
|
||||
|
@@ -7,13 +7,20 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>344</width>
|
||||
<height>304</height>
|
||||
<height>310</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Style Settings</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="7" column="0">
|
||||
<widget class="QLabel" name="textAlignmentLabel">
|
||||
<property name="text">
|
||||
<string>Text Alignment</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="penStyleLabel">
|
||||
<property name="text">
|
||||
@@ -21,6 +28,42 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="0">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::MinimumExpanding</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QComboBox" name="brushColorCombo">
|
||||
<property name="editable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1" colspan="2">
|
||||
<widget class="QComboBox" name="penStyleCombo"/>
|
||||
</item>
|
||||
<item row="0" column="1" colspan="2">
|
||||
<widget class="QDoubleSpinBox" name="penWidthEdit"/>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QComboBox" name="penColorCombo">
|
||||
<property name="editable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="penWidthLabel">
|
||||
<property name="text">
|
||||
@@ -28,30 +71,14 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QFontComboBox" name="fontComboBox"/>
|
||||
</item>
|
||||
<item row="4" column="2">
|
||||
<widget class="QToolButton" name="selectFontButton">
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1" colspan="2">
|
||||
<widget class="QDoubleSpinBox" name="penWidthEdit"/>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="brushColorLabel">
|
||||
<property name="text">
|
||||
<string>Brush Color</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1" colspan="2">
|
||||
<widget class="QComboBox" name="penStyleCombo"/>
|
||||
</item>
|
||||
<item row="6" column="1" colspan="2">
|
||||
<item row="7" column="1" colspan="2">
|
||||
<layout class="QGridLayout" name="textAlignmentLayout">
|
||||
<item row="1" column="0">
|
||||
<widget class="QRadioButton" name="al21Button">
|
||||
@@ -131,38 +158,18 @@
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="7" column="0">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
<item row="6" column="1" colspan="2">
|
||||
<widget class="QDoubleSpinBox" name="textAngleEdit">
|
||||
<property name="minimum">
|
||||
<double>-90.000000000000000</double>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::MinimumExpanding</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QComboBox" name="brushColorCombo">
|
||||
<property name="editable">
|
||||
<bool>true</bool>
|
||||
<property name="maximum">
|
||||
<double>90.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="fontLabel">
|
||||
<property name="text">
|
||||
<string>Font</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QToolButton" name="selectPenColorButton">
|
||||
<item row="4" column="2">
|
||||
<widget class="QToolButton" name="selectBrushColorButton">
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
@@ -175,44 +182,47 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="2">
|
||||
<widget class="QToolButton" name="selectBrushColorButton">
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="fontLabel">
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
<string>Font</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<widget class="QFontComboBox" name="fontComboBox"/>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<widget class="QLabel" name="textAlignmentLabel">
|
||||
<property name="text">
|
||||
<string>Text Alignment</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QComboBox" name="penColorCombo">
|
||||
<property name="editable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="textAngleLabel">
|
||||
<property name="text">
|
||||
<string>Text Angle</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1" colspan="2">
|
||||
<widget class="QDoubleSpinBox" name="textAngleEdit">
|
||||
<property name="minimum">
|
||||
<double>-90.000000000000000</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>90.000000000000000</double>
|
||||
<item row="1" column="2">
|
||||
<widget class="QToolButton" name="selectPenColorButton">
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="2">
|
||||
<widget class="QToolButton" name="selectFontButton">
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="brushStyleLabel">
|
||||
<property name="text">
|
||||
<string>Brush Style</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1" colspan="2">
|
||||
<widget class="QComboBox" name="brushStyleCombo"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
|
Reference in New Issue
Block a user