From 32ac8d0823de1bc1c71a4d367db689cb002ed329 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Wed, 15 Apr 2009 19:40:03 +0000 Subject: [PATCH] Patch by Maxime Simon: In the default font handling, make menu and plain font synonymous, since they are the same font by default. This fixes the Default button enabled/disabled state and ticket #3759. Thanks a lot! git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30181 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/preferences/fonts/FontSelectionView.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/preferences/fonts/FontSelectionView.cpp b/src/preferences/fonts/FontSelectionView.cpp index 8fe5b9a24c..fb59afcb3e 100644 --- a/src/preferences/fonts/FontSelectionView.cpp +++ b/src/preferences/fonts/FontSelectionView.cpp @@ -381,7 +381,14 @@ FontSelectionView::SetDefaults() font_family family; font_style style; float size; - if (_get_system_default_font_(Name(), family, style, &size) != B_OK) { + const char* fontName; + + if (!strcmp(Name(), "menu")) + fontName = "plain"; + else + fontName = Name(); + + if (_get_system_default_font_(fontName, family, style, &size) != B_OK) { Revert(); return; } @@ -425,8 +432,14 @@ FontSelectionView::IsDefaultable() font_family defaultFamily; font_style defaultStyle; float defaultSize; + const char* fontName; - if (_get_system_default_font_(Name(), defaultFamily, defaultStyle, &defaultSize) != B_OK) + if (!strcmp(Name(), "menu")) + fontName = "plain"; + else + fontName = Name(); + + if (_get_system_default_font_(fontName, defaultFamily, defaultStyle, &defaultSize) != B_OK) return false; font_family currentFamily;