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) ...@@ -452,8 +452,8 @@ void EditProfileDialog::setupAppearancePage(const Profile::Ptr profile)
_ui->fontPreviewLabel->setFont(profileFont); _ui->fontPreviewLabel->setFont(profileFont);
setFontInputValue(profileFont); setFontInputValue(profileFont);
connect(_ui->fontSizeInput, SIGNAL(valueChanged(int)), this, connect(_ui->fontSizeInput, SIGNAL(valueChanged(double)), this,
SLOT(setFontSize(int))); SLOT(setFontSize(double)));
connect(_ui->selectFontButton, SIGNAL(clicked()), this, connect(_ui->selectFontButton, SIGNAL(clicked()), this,
SLOT(showFontDialog())); SLOT(showFontDialog()));
...@@ -1192,10 +1192,10 @@ void EditProfileDialog::showFontDialog() ...@@ -1192,10 +1192,10 @@ void EditProfileDialog::showFontDialog()
fontSelected(currentFont); fontSelected(currentFont);
delete dialog.data(); delete dialog.data();
} }
void EditProfileDialog::setFontSize(int pointSize) void EditProfileDialog::setFontSize(double pointSize)
{ {
QFont newFont = _ui->fontPreviewLabel->font(); QFont newFont = _ui->fontPreviewLabel->font();
newFont.setPointSize(pointSize); newFont.setPointSizeF(pointSize);
_ui->fontPreviewLabel->setFont(newFont); _ui->fontPreviewLabel->setFont(newFont);
preview(Profile::Font, newFont); preview(Profile::Font, newFont);
...@@ -1204,7 +1204,7 @@ void EditProfileDialog::setFontSize(int pointSize) ...@@ -1204,7 +1204,7 @@ void EditProfileDialog::setFontSize(int pointSize)
void EditProfileDialog::setFontInputValue(const QFont& aFont) void EditProfileDialog::setFontInputValue(const QFont& aFont)
{ {
_ui->fontSizeInput->setValue(aFont.pointSize()); _ui->fontSizeInput->setValue(aFont.pointSizeF());
} }
ColorSchemeViewDelegate::ColorSchemeViewDelegate(QObject* aParent) ColorSchemeViewDelegate::ColorSchemeViewDelegate(QObject* aParent)
......
...@@ -118,7 +118,7 @@ private slots: ...@@ -118,7 +118,7 @@ private slots:
void silenceSecondsChanged(int); void silenceSecondsChanged(int);
// appearance page // appearance page
void setFontSize(int pointSize); void setFontSize(double pointSize);
void setFontInputValue(const QFont&); void setFontInputValue(const QFont&);
void setAntialiasText(bool enable); void setAntialiasText(bool enable);
void setBoldIntense(bool enable); void setBoldIntense(bool enable);
......
...@@ -460,15 +460,18 @@ ...@@ -460,15 +460,18 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="KIntNumInput" name="fontSizeInput"> <widget class="KDoubleNumInput" name="fontSizeInput">
<property name="minimum"> <property name="minimum">
<number>0</number> <double>4.000000000000000</double>
</property> </property>
<property name="maximum"> <property name="maximum">
<number>999</number> <double>999.000000000000000</double>
</property> </property>
<property name="sliderEnabled"> <property name="singleStep">
<bool>false</bool> <double>1.000000000000000</double>
</property>
<property name="decimals">
<number>1</number>
</property> </property>
</widget> </widget>
</item> </item>
...@@ -1198,6 +1201,11 @@ ...@@ -1198,6 +1201,11 @@
</layout> </layout>
</widget> </widget>
<customwidgets> <customwidgets>
<customwidget>
<class>KDoubleNumInput</class>
<extends>QWidget</extends>
<header>knuminput.h</header>
</customwidget>
<customwidget> <customwidget>
<class>KColorButton</class> <class>KColorButton</class>
<extends>QPushButton</extends> <extends>QPushButton</extends>
...@@ -1218,11 +1226,6 @@ ...@@ -1218,11 +1226,6 @@
<extends>QSpinBox</extends> <extends>QSpinBox</extends>
<header>knuminput.h</header> <header>knuminput.h</header>
</customwidget> </customwidget>
<customwidget>
<class>KIntNumInput</class>
<extends>QWidget</extends>
<header>knuminput.h</header>
</customwidget>
<customwidget> <customwidget>
<class>KSqueezedTextLabel</class> <class>KSqueezedTextLabel</class>
<extends>QLabel</extends> <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