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()
|
171 | 171 | |
172 | 172 | const char* family; |
173 | 173 | const char* style; |
| 174 | BString displayName; |
| 175 | |
174 | 176 | if (settings.FindString("font family", &family) == B_OK |
175 | 177 | && settings.FindString("font style", &style) == B_OK) { |
176 | 178 | _SetFont(family, style); |
| 179 | displayName << family << " " << style; |
| 180 | } else { |
| 181 | font_family currentFontFamily; |
| 182 | font_style currentFontStyle; |
| 183 | fCharacterView->CharacterFont().GetFamilyAndStyle(¤tFontFamily, |
| 184 | ¤tFontStyle); |
| 185 | displayName << currentFontFamily << " " << currentFontStyle; |
177 | 186 | } |
178 | 187 | |
179 | 188 | int32 fontSize; |
… |
… |
CharacterWindow::CharacterWindow()
|
193 | 202 | fCharacterView, 0, false, true); |
194 | 203 | |
195 | 204 | fFontSizeSlider = new FontSizeSlider("fontSizeSlider", |
196 | | B_TRANSLATE("Font size:"), |
| 205 | displayName, |
197 | 206 | new BMessage(kMsgFontSizeChanged), kMinFontSize, kMaxFontSize); |
198 | 207 | fFontSizeSlider->SetValue(fontSize); |
199 | 208 | |
… |
… |
CharacterWindow::MessageReceived(BMessage* message)
|
342 | 351 | fSelectedFontItem = item; |
343 | 352 | |
344 | 353 | _SetFont(item->Menu()->Name(), item->Label()); |
| 354 | |
| 355 | BString displayName; |
| 356 | displayName << item->Menu()->Name() << " " << item->Label(); |
| 357 | |
| 358 | fFontSizeSlider->SetLabel(displayName); |
| 359 | |
345 | 360 | item = item->Menu()->Superitem(); |
346 | 361 | item->SetMarked(true); |
347 | 362 | } |