Ticket #3651: 3651-Enh2.patch

File 3651-Enh2.patch, 1.8 KB (added by dsizzle, 9 years ago)

Consolidated patch for enhancement 2

  • src/apps/charactermap/CharacterWindow.cpp

    From 8a3d305e9b02ec5fc9a28ffff894ec8eacf6cef6 Mon Sep 17 00:00:00 2001
    From: dsizzle <dcieslak@yahoo.com>
    Date: Tue, 25 Nov 2014 20:04:23 +0000
    Subject: [PATCH] 3651: Enhancement 2 - change Font Size label to show font
     family and style
    
    ---
     src/apps/charactermap/CharacterWindow.cpp | 17 ++++++++++++++++-
     1 file changed, 16 insertions(+), 1 deletion(-)
    
    diff --git a/src/apps/charactermap/CharacterWindow.cpp b/src/apps/charactermap/CharacterWindow.cpp
    index acfbe0f..1f860b8 100644
    a b CharacterWindow::CharacterWindow()  
    171171
    172172    const char* family;
    173173    const char* style;
     174    BString displayName;
     175   
    174176    if (settings.FindString("font family", &family) == B_OK
    175177        && settings.FindString("font style", &style) == B_OK) {
    176178        _SetFont(family, style);
     179        displayName << family << " " << style;
     180    } else {
     181        font_family currentFontFamily;
     182        font_style currentFontStyle;
     183        fCharacterView->CharacterFont().GetFamilyAndStyle(&currentFontFamily,
     184            &currentFontStyle);
     185        displayName << currentFontFamily << " " << currentFontStyle;
    177186    }
    178187
    179188    int32 fontSize;
    CharacterWindow::CharacterWindow()  
    193202        fCharacterView, 0, false, true);
    194203
    195204    fFontSizeSlider = new FontSizeSlider("fontSizeSlider",
    196         B_TRANSLATE("Font size:"),
     205        displayName,
    197206        new BMessage(kMsgFontSizeChanged), kMinFontSize, kMaxFontSize);
    198207    fFontSizeSlider->SetValue(fontSize);
    199208
    CharacterWindow::MessageReceived(BMessage* message)  
    342351                fSelectedFontItem = item;
    343352
    344353                _SetFont(item->Menu()->Name(), item->Label());
     354               
     355                BString displayName;
     356                displayName << item->Menu()->Name() << " " << item->Label();
     357           
     358                fFontSizeSlider->SetLabel(displayName);
     359               
    345360                item = item->Menu()->Superitem();
    346361                item->SetMarked(true);
    347362            }