Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 9678685c authored by Robert Knight's avatar Robert Knight

Preview font changes in the font selector dialog in open terminal displays.

svn path=/branches/work/konsole-split-view/; revision=660882
parent 1fc49220
......@@ -121,6 +121,8 @@ void ColorSchemeEditor::editColorItem( QTableWidgetItem* item )
ColorEntry entry(_colors->colorTable()[item->row()]);
entry.color = dialog->color();
_colors->setColorTableEntry(item->row(),entry);
emit colorsChanged(_colors);
}
void ColorSchemeEditor::setDescription(const QString& text)
{
......
......@@ -55,6 +55,10 @@ public:
/** Returns the edited color scheme. */
ColorScheme* colorScheme() const;
signals:
/** Emitted when the colors in the color scheme change. */
void colorsChanged(ColorScheme* scheme);
public slots:
/** Sets the text displayed in the description edit field. */
void setDescription(const QString& description);
......
......@@ -585,12 +585,19 @@ void EditProfileDialog::toggleResizeWindow(bool enable)
{
_tempProfile->setProperty(Profile::AllowProgramsToResizeWindow,enable);
}
#if 0
void EditProfileDialog::previewFont(const QFont& font)
void EditProfileDialog::fontSelected(const QFont& font)
{
preview(Profile::Font,font);
qDebug() << "font selected";
QSlider* slider = _ui->fontSizeSlider;
_ui->fontSizeSlider->setRange( qMin(slider->minimum(),font.pointSize()) ,
qMax(slider->maximum(),font.pointSize()) );
_ui->fontSizeSlider->setValue(font.pointSize());
_ui->fontPreviewLabel->setFont(font);
_tempProfile->setProperty(Profile::Font,font);
preview(Profile::Font,font);
}
#endif
void EditProfileDialog::showFontDialog()
{
//TODO Only permit selection of mono-spaced fonts.
......@@ -598,22 +605,11 @@ void EditProfileDialog::showFontDialog()
// at present.
QFont currentFont = _ui->fontPreviewLabel->font();
KFontDialog dialog;
if ( dialog.exec() == KFontDialog::Accepted )
{
QFont currentFont = dialog.font();
QSlider* slider = _ui->fontSizeSlider;
_ui->fontSizeSlider->setRange( qMin(slider->minimum(),currentFont.pointSize()) ,
qMax(slider->maximum(),currentFont.pointSize()) );
_ui->fontSizeSlider->setValue(currentFont.pointSize());
_ui->fontPreviewLabel->setFont(currentFont);
_tempProfile->setProperty(Profile::Font,currentFont);
KFontDialog* dialog = new KFontDialog(this);
dialog->setFont(currentFont);
preview(Profile::Font,currentFont);
}
connect( dialog , SIGNAL(fontSelected(const QFont&)) , this , SLOT(fontSelected(const QFont&)) );
dialog->show();
}
void EditProfileDialog::setFontSize(int pointSize)
{
......
......@@ -103,6 +103,7 @@ private slots:
void removeColorScheme();
void colorSchemeSelected();
void previewColorScheme(const QModelIndex& index);
void fontSelected(const QFont&);
//void previewFont(const QFont&);
// scrolling page
......
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