summaryrefslogtreecommitdiffstats
path: root/tdeui/tdefontdialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tdeui/tdefontdialog.cpp')
-rw-r--r--tdeui/tdefontdialog.cpp30
1 files changed, 29 insertions, 1 deletions
diff --git a/tdeui/tdefontdialog.cpp b/tdeui/tdefontdialog.cpp
index 0da56a93b..d29ea60be 100644
--- a/tdeui/tdefontdialog.cpp
+++ b/tdeui/tdefontdialog.cpp
@@ -473,8 +473,18 @@ TQString TDEFontChooser::style_name(const TQString &style)
void TDEFontChooser::family_chosen_slot(const TQString& family)
{
+ TQString currentFamily;
+ if (family.isEmpty())
+ {
+ currentFamily = familyListBox->currentText();
+ }
+ else
+ {
+ currentFamily = family;
+ }
+
TQFontDatabase dbase;
- TQStringList styles = dbase.styles(family);
+ TQStringList styles = dbase.styles(currentFamily);
styleListBox->clear();
currentStyles.clear();
for ( TQStringList::Iterator it = styles.begin(); it != styles.end(); ++it ) {
@@ -492,12 +502,21 @@ void TDEFontChooser::family_chosen_slot(const TQString& family)
styleListBox->blockSignals(true);
TQListBoxItem *item = styleListBox->findItem(selectedStyle);
if (item)
+ {
styleListBox->setSelected(styleListBox->findItem(selectedStyle), true);
+ }
else
+ {
styleListBox->setSelected(0, true);
+ }
styleListBox->blockSignals(false);
style_chosen_slot(TQString::null);
+
+ if (!family.isEmpty() )
+ {
+ selectedFamily = family;
+ }
}
void TDEFontChooser::size_chosen_slot(const TQString& size){
@@ -685,6 +704,15 @@ void TDEFontChooser::getFontList( TQStringList &list, uint fontListCriteria)
list = lstSys;
}
+void TDEFontChooser::setFamilyList( TQStringList list )
+{
+ familyListBox->blockSignals(true);
+ familyListBox->clear();
+ familyListBox->insertStringList(list);
+ setFont( TDEGlobalSettings::generalFont(), usingFixed );
+ familyListBox->blockSignals(false);
+}
+
void TDEFontChooser::addFont( TQStringList &list, const char *xfont )
{
const char *ptr = strchr( xfont, '-' );