Commit 52a1d835 authored by Kurt Hindenburg's avatar Kurt Hindenburg

Allow font size to a be double (1 digit) instead of an integer.

A previous commit make the font size an integer.  Per Christoph Feck
there are valid reasons to allow x.y font sizes.  This patch restores
that ability.

An update/fix to ebc594cd

CCMAIL: christoph@maxiom.de
parent 77df2c59
......@@ -452,8 +452,8 @@ void EditProfileDialog::setupAppearancePage(const Profile::Ptr profile)
_ui->fontPreviewLabel->setFont(profileFont);
setFontInputValue(profileFont);
connect(_ui->fontSizeInput, SIGNAL(valueChanged(int)), this,
SLOT(setFontSize(int)));
connect(_ui->fontSizeInput, SIGNAL(valueChanged(double)), this,
SLOT(setFontSize(double)));
connect(_ui->selectFontButton, SIGNAL(clicked()), this,
SLOT(showFontDialog()));
......@@ -1192,10 +1192,10 @@ void EditProfileDialog::showFontDialog()
fontSelected(currentFont);
delete dialog.data();
}
void EditProfileDialog::setFontSize(int pointSize)
void EditProfileDialog::setFontSize(double pointSize)
{
QFont newFont = _ui->fontPreviewLabel->font();
newFont.setPointSize(pointSize);
newFont.setPointSizeF(pointSize);
_ui->fontPreviewLabel->setFont(newFont);
preview(Profile::Font, newFont);
......@@ -1204,7 +1204,7 @@ void EditProfileDialog::setFontSize(int pointSize)
void EditProfileDialog::setFontInputValue(const QFont& aFont)
{
_ui->fontSizeInput->setValue(aFont.pointSize());
_ui->fontSizeInput->setValue(aFont.pointSizeF());
}
ColorSchemeViewDelegate::ColorSchemeViewDelegate(QObject* aParent)
......
......@@ -118,7 +118,7 @@ private slots:
void silenceSecondsChanged(int);
// appearance page
void setFontSize(int pointSize);
void setFontSize(double pointSize);
void setFontInputValue(const QFont&);
void setAntialiasText(bool enable);
void setBoldIntense(bool enable);
......
......@@ -460,15 +460,18 @@
</widget>
</item>
<item>
<widget class="KIntNumInput" name="fontSizeInput">
<widget class="KDoubleNumInput" name="fontSizeInput">
<property name="minimum">
<number>0</number>
<double>4.000000000000000</double>
</property>
<property name="maximum">
<number>999</number>
<double>999.000000000000000</double>
</property>
<property name="sliderEnabled">
<bool>false</bool>
<property name="singleStep">
<double>1.000000000000000</double>
</property>
<property name="decimals">
<number>1</number>
</property>
</widget>
</item>
......@@ -1198,6 +1201,11 @@
</layout>
</widget>
<customwidgets>
<customwidget>
<class>KDoubleNumInput</class>
<extends>QWidget</extends>
<header>knuminput.h</header>
</customwidget>
<customwidget>
<class>KColorButton</class>
<extends>QPushButton</extends>
......@@ -1218,11 +1226,6 @@
<extends>QSpinBox</extends>
<header>knuminput.h</header>
</customwidget>
<customwidget>
<class>KIntNumInput</class>
<extends>QWidget</extends>
<header>knuminput.h</header>
</customwidget>
<customwidget>
<class>KSqueezedTextLabel</class>
<extends>QLabel</extends>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment