[Uml-devel] KDE/kdesdk/umbrello/umbrello

Oliver Kellogg okellogg at users.sourceforge.net
Mon May 16 16:33:28 UTC 2005


SVN commit 414515 by okellogg:

UMLView::setFont(): Add optional changeAllWidgets arg, see
http://sourceforge.net/mailarchive/forum.php?thread_id=7035813&forum_id=460


 M  +3 -1      trunk/KDE/kdesdk/umbrello/umbrello/dialogs/umlviewdialog.cpp  
 M  +10 -2     trunk/KDE/kdesdk/umbrello/umbrello/umlview.cpp  
 M  +2 -2      trunk/KDE/kdesdk/umbrello/umbrello/umlview.h  


--- trunk/KDE/kdesdk/umbrello/umbrello/dialogs/umlviewdialog.cpp #414514:414515
@@ -133,7 +133,9 @@
 			break;
 
 		case Font:
-			m_pView->setFont( m_pChooser->font() );
+			kdDebug() << "UMLViewDialog::applyPage: setting font "
+				  << m_pChooser->font().toString() << endl;
+			m_pView->setFont( m_pChooser->font(), true );
 			break;
 
 		case Class:
--- trunk/KDE/kdesdk/umbrello/umbrello/umlview.cpp #414514:414515
@@ -3010,8 +3010,14 @@
 	return m_Options.uiState.font;
 }
 
-void UMLView::setFont( QFont font ) {
+void UMLView::setFont(QFont font, bool changeAllWidgets /* = false */) {
 	m_Options.uiState.font = font;
+	if (!changeAllWidgets)
+		return;
+	for (UMLWidgetListIt wit(m_WidgetList); wit.current(); ++wit) {
+		UMLWidget *w = wit.current();
+		w->setFont(font);
+	}
 }
 
 void UMLView::setClassWidgetOptions( ClassOptionsPage * page ) {
@@ -3328,8 +3334,10 @@
 	QString localid = qElement.attribute( "localid", "0" );
 	//optionstate uistate
 	QString font = qElement.attribute( "font", "" );
-	if( !font.isEmpty() )
+	if (!font.isEmpty()) {
 		m_Options.uiState.font.fromString( font );
+		m_Options.uiState.font.setUnderline(false);
+	}
 	QString fillcolor = qElement.attribute( "fillcolor", "" );
 	QString linecolor = qElement.attribute( "linecolor", "" );
 	QString linewidth = qElement.attribute( "linewidth", "" );
--- trunk/KDE/kdesdk/umbrello/umbrello/umlview.h #414514:414515
@@ -270,9 +270,9 @@
 	QFont getFont() const;
 
 	/**
-	 * Sets the font for the view and all the widgets on the view.
+	 * Sets the font for the view and optionally all the widgets on the view.
 	 */
-	void setFont( QFont font );
+	void setFont(QFont font, bool changeAllWidgets = false);
 
 	/**
 	 * Returns whether to show operation signatures.




More information about the umbrello-devel mailing list