Commit 87cb4ec1 authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

More title widget cleanups

svn path=/trunk/kdenlive/; revision=4215
parent 6a9528fe
......@@ -84,7 +84,7 @@ TitleWidget::TitleWidget(KUrl url, Timecode tc, QString projectTitlePath, Render
textOutlineAlpha->setDecimals(0);
textOutlineAlpha->setValue(255);
textOutlineAlpha->setToolTip(i18n("Outline color opacity"));
textOutline->setMinimum(0);
textOutline->setMaximum(200);
textOutline->setDecimals(0);
......@@ -102,7 +102,25 @@ TitleWidget::TitleWidget(KUrl url, Timecode tc, QString projectTitlePath, Render
itemrotate->setDecimals(0);
itemrotate->setValue(0);
itemrotate->setToolTip(i18n("Rotation"));
rectBAlpha->setMinimum(0);
rectBAlpha->setMaximum(255);
rectBAlpha->setDecimals(0);
rectBAlpha->setValue(255);
rectBAlpha->setToolTip(i18n("Color opacity"));
rectFAlpha->setMinimum(0);
rectFAlpha->setMaximum(255);
rectFAlpha->setDecimals(0);
rectFAlpha->setValue(255);
rectFAlpha->setToolTip(i18n("Border opacity"));
rectLineWidth->setMinimum(0);
rectLineWidth->setMaximum(100);
rectLineWidth->setDecimals(0);
rectLineWidth->setValue(0);
rectLineWidth->setToolTip(i18n("Border width"));
itemzoom->setSuffix(i18n("%"));
m_frameWidth = render->renderWidth();
m_frameHeight = render->renderHeight();
......@@ -125,11 +143,11 @@ TitleWidget::TitleWidget(KUrl url, Timecode tc, QString projectTitlePath, Render
connect(font_family, SIGNAL(editTextChanged(const QString &)), this, SLOT(slotFontText(const QString&)));
connect(rectFAlpha, SIGNAL(valueChanged(int)), this, SLOT(rectChanged()));
connect(rectBAlpha, SIGNAL(valueChanged(int)), this, SLOT(rectChanged()));
connect(rectFAlpha, SIGNAL(valueChanged(qreal, bool)), this, SLOT(rectChanged()));
connect(rectBAlpha, SIGNAL(valueChanged(qreal, bool)), this, SLOT(rectChanged()));
connect(rectFColor, SIGNAL(clicked()), this, SLOT(rectChanged()));
connect(rectBColor, SIGNAL(clicked()), this, SLOT(rectChanged()));
connect(rectLineWidth, SIGNAL(valueChanged(int)), this, SLOT(rectChanged()));
connect(rectLineWidth, SIGNAL(valueChanged(qreal, bool)), this, SLOT(rectChanged()));
/*connect(startViewportX, SIGNAL(valueChanged(int)), this, SLOT(setupViewports()));
connect(startViewportY, SIGNAL(valueChanged(int)), this, SLOT(setupViewports()));
......@@ -857,8 +875,8 @@ void TitleWidget::selectionChanged()
cursor.select(QTextCursor::Document);
QColor color = cursor.charFormat().foreground().color();
textAlpha->setValue(color.alpha());
color.setAlpha(255);
fontColorButton->setColor(color);
color.setAlpha(255);
fontColorButton->setColor(color);
if (!i->data(101).isNull()) {
textOutline->blockSignals(true);
......@@ -868,10 +886,10 @@ void TitleWidget::selectionChanged()
if (!i->data(102).isNull()) {
textOutlineColor->blockSignals(true);
textOutlineAlpha->blockSignals(true);
color = QColor(i->data(102).toString());
color = QColor(i->data(102).toString());
textOutlineAlpha->setValue(color.alpha());
color.setAlpha(255);
textOutlineColor->setColor(color);
color.setAlpha(255);
textOutlineColor->setColor(color);
textOutlineColor->blockSignals(false);
textOutlineAlpha->blockSignals(false);
}
......@@ -1695,6 +1713,9 @@ void TitleWidget::writeChoices()
titleConfig.writeEntry("font_pixel_size", font_size->value());
titleConfig.writeEntry("font_color", fontColorButton->color());
titleConfig.writeEntry("font_alpha", textAlpha->value());
titleConfig.writeEntry("font_outline", textOutline->value());
titleConfig.writeEntry("font_outline_color", textOutlineColor->color());
titleConfig.writeEntry("font_outline_alpha", textOutlineAlpha->value());
titleConfig.writeEntry("font_weight", font_weight_box->itemData(font_weight_box->currentIndex()).toInt());
titleConfig.writeEntry("font_italic", buttonItalic->isChecked());
titleConfig.writeEntry("font_underlined", buttonUnder->isChecked());
......@@ -1725,6 +1746,11 @@ void TitleWidget::readChoices()
m_scene->slotUpdateFontSize(font_size->value());
fontColorButton->setColor(titleConfig.readEntry("font_color", fontColorButton->color()));
textAlpha->setValue(titleConfig.readEntry("font_alpha", textAlpha->value()));
textOutlineColor->setColor(titleConfig.readEntry("font_outline_color", textOutlineColor->color()));
textOutlineAlpha->setValue(titleConfig.readEntry("font_outline_alpha", textOutlineAlpha->value()));
textOutline->setValue(titleConfig.readEntry("font_outline", textOutline->value()));
int weight;
if (titleConfig.readEntry("font_bold", false)) weight = QFont::Bold;
else weight = titleConfig.readEntry("font_weight", font_weight_box->itemData(font_weight_box->currentIndex()).toInt());
......
......@@ -746,315 +746,294 @@
</layout>
</widget>
<widget class="QWidget" name="page_7">
<layout class="QGridLayout" name="gridLayout_14">
<layout class="QGridLayout" name="gridLayout_13">
<item row="0" column="0">
<layout class="QGridLayout" name="gridLayout_13">
<item row="0" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Fill color</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="KColorButton" name="rectBColor">
<property name="color">
<color>
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</property>
<property name="defaultColor">
<color>
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QSlider" name="rectBAlpha">
<property name="maximum">
<number>255</number>
</property>
<property name="value">
<number>255</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="Line" name="line_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item row="0" column="4">
<widget class="QLabel" name="label_11">
<property name="text">
<string>Border color</string>
</property>
</widget>
</item>
<item row="0" column="5">
<widget class="KColorButton" name="rectFColor">
<property name="color">
<color>
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</property>
<property name="defaultColor">
<color>
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</property>
</widget>
</item>
<item row="0" column="6">
<widget class="QSlider" name="rectFAlpha">
<property name="maximum">
<number>255</number>
</property>
<property name="value">
<number>0</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="0" column="7">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Width</string>
</property>
</widget>
</item>
<item row="0" column="8">
<widget class="QSpinBox" name="rectLineWidth"/>
</item>
<item row="0" column="9">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>241</width>
<height>28</height>
</size>
</property>
</spacer>
</item>
</layout>
<widget class="QLabel" name="label_2">
<property name="text">
<string>Fill color</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="KColorButton" name="rectBColor">
<property name="color">
<color>
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</property>
<property name="defaultColor">
<color>
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="KoSliderCombo" name="rectBAlpha"/>
</item>
<item row="0" column="3">
<widget class="Line" name="line_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item row="0" column="4">
<widget class="QLabel" name="label_11">
<property name="text">
<string>Border color</string>
</property>
</widget>
</item>
<item row="0" column="5">
<widget class="KColorButton" name="rectFColor">
<property name="color">
<color>
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</property>
<property name="defaultColor">
<color>
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</property>
</widget>
</item>
<item row="0" column="6">
<widget class="KoSliderCombo" name="rectFAlpha"/>
</item>
<item row="0" column="7">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Width</string>
</property>
</widget>
</item>
<item row="0" column="8">
<widget class="KoSliderCombo" name="rectLineWidth"/>
</item>
<item row="0" column="9">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>359</width>
<height>28</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<widget class="QWidget" name="page_8">
<layout class="QGridLayout" name="gridLayout_16">
<layout class="QGridLayout" name="gridLayout_14">
<item row="0" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QLabel" name="label_17">
<property name="text">
<string>Font</string>
</property>
</widget>
</item>
<item>
<widget class="QFontComboBox" name="font_family"/>
</item>
<item>
<widget class="QSpinBox" name="font_size">
<property name="minimum">
<number>8</number>
</property>
<property name="maximum">
<number>1000</number>
</property>
<property name="value">
<number>20</number>
</property>
</widget>
</item>
<item>
<widget class="KColorButton" name="fontColorButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="flat">
<bool>false</bool>
</property>
<property name="color">
<color>
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</property>
<property name="defaultColor">
<color>
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</property>
</widget>
</item>
<item>
<widget class="KoSliderCombo" name="textAlpha"/>
</item>
<item>
<widget class="QComboBox" name="font_weight_box"/>
</item>
<item>
<widget class="QToolButton" name="buttonItalic">
<property name="text">
<string>...</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="buttonUnder">
<property name="text">
<string>...</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="Line" name="line_4">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_18">
<property name="text">
<string>Outline</string>
</property>
</widget>
</item>
<item>
<widget class="KoSliderCombo" name="textOutline"/>
</item>
<item>
<widget class="KColorButton" name="textOutlineColor"/>
</item>
<item>
<widget class="KoSliderCombo" name="textOutlineAlpha"/>
</item>
<item>
<widget class="Line" name="line_5">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="buttonAlignNone">
<property name="text">
<string>...</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>true</bool>
</property>
<property name="autoExclusive">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="buttonAlignLeft">
<property name="text">
<string>...</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>false</bool>
</property>
<property name="autoExclusive">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="buttonAlignCenter">
<property name="text">
<string>...</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="autoExclusive">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="buttonAlignRight">
<property name="text">
<string>...</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="autoExclusive">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="buttonInsertUnicode">
<property name="text">
<string>...</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>52</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
<widget class="QLabel" name="label_17">
<property name="text">
<string>Font</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QFontComboBox" name="font_family"/>
</item>
<item row="0" column="2">
<widget class="QSpinBox" name="font_size">
<property name="minimum">
<number>8</number>
</property>
<property name="maximum">
<number>1000</number>
</property>
<property name="value">
<number>20</number>
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="KColorButton" name="fontColorButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="flat">
<bool>false</bool>
</property>
<property name="color">
<color>
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</property>
<property name="defaultColor">
<color>
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</property>
</widget>
</item>
<item row="0" column="4">
<widget class="KoSliderCombo" name="textAlpha"/>
</item>
<item row="0" column="5">
<widget class="QComboBox" name="font_weight_box"/>
</item>
<item row="0" column="6">
<widget class="QToolButton" name="buttonItalic">
<property name="text">
<string>...</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="7">
<widget class="QToolButton" name="buttonUnder">
<property name="text">
<string>...</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="8">
<widget class="Line" name="line_4">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item row="0" column="9">
<widget class="QLabel" name="label_18">
<property name="text">
<string>Outline</string>
</property>
</widget>
</item>
<item row="0" column="10">
<widget class="KoSliderCombo" name="textOutline"/>
</item>
<item row="0" column="11">
<widget class="KColorButton" name="textOutlineColor">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="0" column="12">
<widget class="KoSliderCombo" name="textOutlineAlpha"/>
</item>
<item row="0" column="13">
<widget class="Line" name="line_5">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item row="0" column="14">
<widget class="QToolButton" name="buttonAlignNone">
<property name="text">
<string>...</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>true</bool>
</property>