[haiku-commits] r33947 - haiku/trunk/src/apps/terminal

  • From: stefano.ceccherini@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sun, 8 Nov 2009 13:30:02 +0100 (CET)

Author: jackburton
Date: 2009-11-08 13:30:01 +0100 (Sun, 08 Nov 2009)
New Revision: 33947
Changeset: http://dev.haiku-os.org/changeset/33947/haiku

Modified:
   haiku/trunk/src/apps/terminal/AppearPrefView.cpp
   haiku/trunk/src/apps/terminal/AppearPrefView.h
   haiku/trunk/src/apps/terminal/PrefHandler.cpp
Log:
Also set a default style in the preferences. Mark the menuitem with the
default family/style.


Modified: haiku/trunk/src/apps/terminal/AppearPrefView.cpp
===================================================================
--- haiku/trunk/src/apps/terminal/AppearPrefView.cpp    2009-11-08 12:22:57 UTC 
(rev 33946)
+++ haiku/trunk/src/apps/terminal/AppearPrefView.cpp    2009-11-08 12:30:01 UTC 
(rev 33947)
@@ -61,7 +61,8 @@
        BRect r(5, 5, 261, 25);
 
        BMenu *menu = _MakeFontMenu(MSG_HALF_FONT_CHANGED,
-               PrefHandler::Default()->getString(PREF_HALF_FONT_FAMILY));
+               PrefHandler::Default()->getString(PREF_HALF_FONT_FAMILY),
+               PrefHandler::Default()->getString(PREF_HALF_FONT_STYLE));
        fFont = new BMenuField(r, "font", "Font:", menu);
        fFont->SetDivider(colorDividerSize);
        fFont->SetAlignment(B_ALIGN_RIGHT);
@@ -227,7 +228,8 @@
 
 
 BMenu *
-AppearancePrefView::_MakeFontMenu(uint32 command, const char *defaultFontName)
+AppearancePrefView::_MakeFontMenu(uint32 command,
+       const char *defaultFamily, const char *defaultStyle)
 {
        BPopUpMenu *menu = new BPopUpMenu("");
        int32 numFamilies = count_font_families();
@@ -252,7 +254,8 @@
                                                BMenuItem *item = new 
BMenuItem(itemLabel,
                                                        message);
                                                menu->AddItem(item);
-                                               if (!strcmp(defaultFontName, 
family))
+                                               if (!strcmp(defaultFamily, 
family)
+                                                       && 
!strcmp(defaultStyle, style))
                                                        item->SetMarked(true);
                                        }
                                }

Modified: haiku/trunk/src/apps/terminal/AppearPrefView.h
===================================================================
--- haiku/trunk/src/apps/terminal/AppearPrefView.h      2009-11-08 12:22:57 UTC 
(rev 33946)
+++ haiku/trunk/src/apps/terminal/AppearPrefView.h      2009-11-08 12:30:01 UTC 
(rev 33947)
@@ -29,7 +29,8 @@
                virtual void    GetPreferredSize(float *_width, float *_height);
 
        private:
-               BMenu*                  _MakeFontMenu(uint32 command, const 
char *defaultFont);
+               BMenu*                  _MakeFontMenu(uint32 command, const 
char *defaultFamily,
+                                               const char *defaultStyle);
                BMenu*                  _MakeSizeMenu(uint32 command, uint8 
defaultSize);
 
                BMenuField              *fFont;

Modified: haiku/trunk/src/apps/terminal/PrefHandler.cpp
===================================================================
--- haiku/trunk/src/apps/terminal/PrefHandler.cpp       2009-11-08 12:22:57 UTC 
(rev 33946)
+++ haiku/trunk/src/apps/terminal/PrefHandler.cpp       2009-11-08 12:30:01 UTC 
(rev 33947)
@@ -35,6 +35,7 @@
        { PREF_ROWS,                            "25" },
 
        { PREF_HALF_FONT_FAMILY,        "Courier10 BT" },
+       { PREF_HALF_FONT_STYLE,         "Regular" },
        { PREF_HALF_FONT_SIZE,          "12" },
 
        { PREF_TEXT_FORE_COLOR,         "  0,   0,   0" },


Other related posts: