Updated to use B_TRANSLATE* macros. relates to #5408.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36680 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -63,7 +63,7 @@ APRView::APRView(const char *name, uint32 flags)
|
|||||||
fDecorMenu->AddItem(new BMenuItem(name.String(),
|
fDecorMenu->AddItem(new BMenuItem(name.String(),
|
||||||
new BMessage(DECORATOR_CHANGED)));
|
new BMessage(DECORATOR_CHANGED)));
|
||||||
}
|
}
|
||||||
|
|
||||||
BMenuField *field = new BMenuField("Window Style", fDecorMenu);
|
BMenuField *field = new BMenuField("Window Style", fDecorMenu);
|
||||||
// TODO: use this menu field.
|
// TODO: use this menu field.
|
||||||
}
|
}
|
||||||
@@ -79,13 +79,13 @@ APRView::APRView(const char *name, uint32 flags)
|
|||||||
|
|
||||||
// Set up list of color attributes
|
// Set up list of color attributes
|
||||||
fAttrList = new BListView("AttributeList", B_SINGLE_SELECTION_LIST);
|
fAttrList = new BListView("AttributeList", B_SINGLE_SELECTION_LIST);
|
||||||
|
|
||||||
fScrollView = new BScrollView("ScrollView", fAttrList, 0, false, true);
|
fScrollView = new BScrollView("ScrollView", fAttrList, 0, false, true);
|
||||||
fScrollView->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
fScrollView->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
||||||
|
|
||||||
for (int32 i = 0; i < color_description_count(); i++) {
|
for (int32 i = 0; i < color_description_count(); i++) {
|
||||||
const ColorDescription& description = *get_color_description(i);
|
const ColorDescription& description = *get_color_description(i);
|
||||||
const char* text = TR(description.text);
|
const char* text = B_TRANSLATE(description.text);
|
||||||
color_which which = description.which;
|
color_which which = description.which;
|
||||||
fAttrList->AddItem(new ColorWhichItem(text, which));
|
fAttrList->AddItem(new ColorWhichItem(text, which));
|
||||||
}
|
}
|
||||||
@@ -164,8 +164,8 @@ APRView::MessageReceived(BMessage *msg)
|
|||||||
{
|
{
|
||||||
// Received from the color fPicker when its color changes
|
// Received from the color fPicker when its color changes
|
||||||
rgb_color color = fPicker->ValueAsColor();
|
rgb_color color = fPicker->ValueAsColor();
|
||||||
SetCurrentColor(color);
|
SetCurrentColor(color);
|
||||||
|
|
||||||
Window()->PostMessage(kMsgUpdate);
|
Window()->PostMessage(kMsgUpdate);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -225,7 +225,7 @@ void
|
|||||||
APRView::LoadSettings()
|
APRView::LoadSettings()
|
||||||
{
|
{
|
||||||
for (int32 i = 0; i < color_description_count(); i++) {
|
for (int32 i = 0; i < color_description_count(); i++) {
|
||||||
color_which which = get_color_description(i)->which;
|
color_which which = get_color_description(i)->which;
|
||||||
fCurrentSet.SetColor(which, ui_color(which));
|
fCurrentSet.SetColor(which, ui_color(which));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -244,7 +244,7 @@ void
|
|||||||
APRView::UpdateAllColors()
|
APRView::UpdateAllColors()
|
||||||
{
|
{
|
||||||
for (int32 i = 0; i < color_description_count(); i++) {
|
for (int32 i = 0; i < color_description_count(); i++) {
|
||||||
color_which which = get_color_description(i)->which;
|
color_which which = get_color_description(i)->which;
|
||||||
rgb_color color = fCurrentSet.GetColor(which);
|
rgb_color color = fCurrentSet.GetColor(which);
|
||||||
set_ui_color(which, color);
|
set_ui_color(which, color);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,27 +25,28 @@ static const uint32 kMsgSetDefaults = 'dflt';
|
|||||||
static const uint32 kMsgRevert = 'rvrt';
|
static const uint32 kMsgRevert = 'rvrt';
|
||||||
|
|
||||||
APRWindow::APRWindow(BRect frame)
|
APRWindow::APRWindow(BRect frame)
|
||||||
: BWindow(frame, TR("Appearance"), B_TITLED_WINDOW,
|
: BWindow(frame, B_TRANSLATE("Appearance"), B_TITLED_WINDOW,
|
||||||
B_NOT_ZOOMABLE | B_AUTO_UPDATE_SIZE_LIMITS,
|
B_NOT_ZOOMABLE | B_AUTO_UPDATE_SIZE_LIMITS,
|
||||||
B_ALL_WORKSPACES)
|
B_ALL_WORKSPACES)
|
||||||
{
|
{
|
||||||
|
|
||||||
SetLayout(new BGroupLayout(B_HORIZONTAL));
|
SetLayout(new BGroupLayout(B_HORIZONTAL));
|
||||||
|
|
||||||
fDefaultsButton = new BButton("defaults", TR("Defaults"),
|
fDefaultsButton = new BButton("defaults", B_TRANSLATE("Defaults"),
|
||||||
new BMessage(kMsgSetDefaults), B_WILL_DRAW);
|
new BMessage(kMsgSetDefaults), B_WILL_DRAW);
|
||||||
|
|
||||||
fRevertButton = new BButton("revert", TR("Revert"),
|
fRevertButton = new BButton("revert", B_TRANSLATE("Revert"),
|
||||||
new BMessage(kMsgRevert), B_WILL_DRAW);
|
new BMessage(kMsgRevert), B_WILL_DRAW);
|
||||||
|
|
||||||
BTabView* tabView = new BTabView("tabview", B_WIDTH_FROM_LABEL);
|
BTabView* tabView = new BTabView("tabview", B_WIDTH_FROM_LABEL);
|
||||||
|
|
||||||
fAntialiasingSettings = new AntialiasingSettingsView(TR("Antialiasing"));
|
fAntialiasingSettings = new AntialiasingSettingsView(
|
||||||
fColorsView = new APRView(TR("Colors"), B_WILL_DRAW);
|
B_TRANSLATE("Antialiasing"));
|
||||||
|
fColorsView = new APRView(B_TRANSLATE("Colors"), B_WILL_DRAW);
|
||||||
|
|
||||||
tabView->AddTab(fColorsView);
|
tabView->AddTab(fColorsView);
|
||||||
tabView->AddTab(fAntialiasingSettings);
|
tabView->AddTab(fAntialiasingSettings);
|
||||||
|
|
||||||
fDefaultsButton->SetEnabled(fColorsView->IsDefaultable()
|
fDefaultsButton->SetEnabled(fColorsView->IsDefaultable()
|
||||||
|| fAntialiasingSettings->IsDefaultable());
|
|| fAntialiasingSettings->IsDefaultable());
|
||||||
fRevertButton->SetEnabled(false);
|
fRevertButton->SetEnabled(false);
|
||||||
|
|||||||
@@ -38,11 +38,12 @@
|
|||||||
static const int32 kMsgSetAntialiasing = 'anti';
|
static const int32 kMsgSetAntialiasing = 'anti';
|
||||||
static const int32 kMsgSetHinting = 'hint';
|
static const int32 kMsgSetHinting = 'hint';
|
||||||
static const int32 kMsgSetAverageWeight = 'avrg';
|
static const int32 kMsgSetAverageWeight = 'avrg';
|
||||||
static const char* kSubpixelLabel = TR_MARK("LCD subpixel");
|
static const char* kSubpixelLabel = B_TRANSLATE_MARK("LCD subpixel");
|
||||||
static const char* kGrayscaleLabel = TR_MARK("Grayscale");
|
static const char* kGrayscaleLabel = B_TRANSLATE_MARK("Grayscale");
|
||||||
static const char* kNoHintingLabel = TR_MARK("Off");
|
static const char* kNoHintingLabel = B_TRANSLATE_MARK("Off");
|
||||||
static const char* kMonospacedHintingLabel = TR_MARK("Monospaced fonts only");
|
static const char* kMonospacedHintingLabel =
|
||||||
static const char* kFullHintingLabel = TR_MARK("On");
|
B_TRANSLATE_MARK("Monospaced fonts only");
|
||||||
|
static const char* kFullHintingLabel = B_TRANSLATE_MARK("On");
|
||||||
|
|
||||||
|
|
||||||
// #pragma mark - private libbe API
|
// #pragma mark - private libbe API
|
||||||
@@ -86,20 +87,21 @@ AntialiasingSettingsView::AntialiasingSettingsView(const char* name)
|
|||||||
// antialiasing menu
|
// antialiasing menu
|
||||||
_BuildAntialiasingMenu();
|
_BuildAntialiasingMenu();
|
||||||
fAntialiasingMenuField = new BMenuField("antialiasing",
|
fAntialiasingMenuField = new BMenuField("antialiasing",
|
||||||
TR("Antialiasing type:"), fAntialiasingMenu, NULL);
|
B_TRANSLATE("Antialiasing type:"), fAntialiasingMenu, NULL);
|
||||||
|
|
||||||
// "average weight" in subpixel filtering
|
// "average weight" in subpixel filtering
|
||||||
fAverageWeightControl = new BSlider("averageWeightControl",
|
fAverageWeightControl = new BSlider("averageWeightControl",
|
||||||
TR("Reduce colored edges filter strength:"),
|
B_TRANSLATE("Reduce colored edges filter strength:"),
|
||||||
new BMessage(kMsgSetAverageWeight), 0, 255, B_HORIZONTAL);
|
new BMessage(kMsgSetAverageWeight), 0, 255, B_HORIZONTAL);
|
||||||
fAverageWeightControl->SetLimitLabels(TR("Off"), TR("Strong"));
|
fAverageWeightControl->SetLimitLabels(B_TRANSLATE("Off"),
|
||||||
|
B_TRANSLATE("Strong"));
|
||||||
fAverageWeightControl->SetHashMarks(B_HASH_MARKS_BOTTOM);
|
fAverageWeightControl->SetHashMarks(B_HASH_MARKS_BOTTOM);
|
||||||
fAverageWeightControl->SetHashMarkCount(255 / 15);
|
fAverageWeightControl->SetHashMarkCount(255 / 15);
|
||||||
fAverageWeightControl->SetEnabled(false);
|
fAverageWeightControl->SetEnabled(false);
|
||||||
|
|
||||||
// hinting menu
|
// hinting menu
|
||||||
_BuildHintingMenu();
|
_BuildHintingMenu();
|
||||||
fHintingMenuField = new BMenuField("hinting", TR("Glyph hinting:"),
|
fHintingMenuField = new BMenuField("hinting", B_TRANSLATE("Glyph hinting:"),
|
||||||
fHintingMenu, NULL);
|
fHintingMenu, NULL);
|
||||||
|
|
||||||
#ifdef DISABLE_HINTING_CONTROL
|
#ifdef DISABLE_HINTING_CONTROL
|
||||||
@@ -117,11 +119,11 @@ AntialiasingSettingsView::AntialiasingSettingsView(const char* name)
|
|||||||
BTextView* subpixelAntialiasingDisabledLabel = new BTextView(
|
BTextView* subpixelAntialiasingDisabledLabel = new BTextView(
|
||||||
textBounds, "unavailable label", textBounds, &infoFont, &infoColor,
|
textBounds, "unavailable label", textBounds, &infoFont, &infoColor,
|
||||||
B_FOLLOW_NONE, B_WILL_DRAW | B_SUPPORTS_LAYOUT);
|
B_FOLLOW_NONE, B_WILL_DRAW | B_SUPPORTS_LAYOUT);
|
||||||
subpixelAntialiasingDisabledLabel->SetText(TR("Subpixel based anti-aliasing "
|
subpixelAntialiasingDisabledLabel->SetText(B_TRANSLATE(
|
||||||
"in combination with glyph hinting is not available in this build of "
|
"Subpixel based anti-aliasing in combination with glyph hinting is not "
|
||||||
"Haiku to avoid possible patent issues. To enable this feature, you "
|
"available in this build of Haiku to avoid possible patent issues. To "
|
||||||
"have to build Haiku yourself and enable certain options in the "
|
"enable this feature, you have to build Haiku yourself and enable "
|
||||||
"libfreetype configuration header."));
|
"certain options in the libfreetype configuration header."));
|
||||||
subpixelAntialiasingDisabledLabel->SetViewColor(
|
subpixelAntialiasingDisabledLabel->SetViewColor(
|
||||||
ui_color(B_PANEL_BACKGROUND_COLOR));
|
ui_color(B_PANEL_BACKGROUND_COLOR));
|
||||||
subpixelAntialiasingDisabledLabel->MakeEditable(false);
|
subpixelAntialiasingDisabledLabel->MakeEditable(false);
|
||||||
@@ -228,19 +230,19 @@ AntialiasingSettingsView::MessageReceived(BMessage *msg)
|
|||||||
void
|
void
|
||||||
AntialiasingSettingsView::_BuildAntialiasingMenu()
|
AntialiasingSettingsView::_BuildAntialiasingMenu()
|
||||||
{
|
{
|
||||||
fAntialiasingMenu = new BPopUpMenu(TR("Antialiasing menu"));
|
fAntialiasingMenu = new BPopUpMenu(B_TRANSLATE("Antialiasing menu"));
|
||||||
|
|
||||||
BMessage* message = new BMessage(kMsgSetAntialiasing);
|
BMessage* message = new BMessage(kMsgSetAntialiasing);
|
||||||
message->AddBool("antialiasing", false);
|
message->AddBool("antialiasing", false);
|
||||||
|
|
||||||
BMenuItem* item = new BMenuItem(TR(kGrayscaleLabel), message);
|
BMenuItem* item = new BMenuItem(B_TRANSLATE(kGrayscaleLabel), message);
|
||||||
|
|
||||||
fAntialiasingMenu->AddItem(item);
|
fAntialiasingMenu->AddItem(item);
|
||||||
|
|
||||||
message = new BMessage(kMsgSetAntialiasing);
|
message = new BMessage(kMsgSetAntialiasing);
|
||||||
message->AddBool("antialiasing", true);
|
message->AddBool("antialiasing", true);
|
||||||
|
|
||||||
item = new BMenuItem(TR(kSubpixelLabel), message);
|
item = new BMenuItem(B_TRANSLATE(kSubpixelLabel), message);
|
||||||
|
|
||||||
fAntialiasingMenu->AddItem(item);
|
fAntialiasingMenu->AddItem(item);
|
||||||
}
|
}
|
||||||
@@ -249,19 +251,22 @@ AntialiasingSettingsView::_BuildAntialiasingMenu()
|
|||||||
void
|
void
|
||||||
AntialiasingSettingsView::_BuildHintingMenu()
|
AntialiasingSettingsView::_BuildHintingMenu()
|
||||||
{
|
{
|
||||||
fHintingMenu = new BPopUpMenu(TR("Hinting menu"));
|
fHintingMenu = new BPopUpMenu(B_TRANSLATE("Hinting menu"));
|
||||||
|
|
||||||
BMessage* message = new BMessage(kMsgSetHinting);
|
BMessage* message = new BMessage(kMsgSetHinting);
|
||||||
message->AddInt8("hinting", HINTING_MODE_OFF);
|
message->AddInt8("hinting", HINTING_MODE_OFF);
|
||||||
fHintingMenu->AddItem(new BMenuItem(TR(kNoHintingLabel), message));
|
fHintingMenu->AddItem(new BMenuItem(B_TRANSLATE(kNoHintingLabel),
|
||||||
|
message));
|
||||||
|
|
||||||
message = new BMessage(kMsgSetHinting);
|
message = new BMessage(kMsgSetHinting);
|
||||||
message->AddInt8("hinting", HINTING_MODE_ON);
|
message->AddInt8("hinting", HINTING_MODE_ON);
|
||||||
fHintingMenu->AddItem(new BMenuItem(TR(kFullHintingLabel), message));
|
fHintingMenu->AddItem(new BMenuItem(B_TRANSLATE(kFullHintingLabel),
|
||||||
|
message));
|
||||||
|
|
||||||
message = new BMessage(kMsgSetHinting);
|
message = new BMessage(kMsgSetHinting);
|
||||||
message->AddInt8("hinting", HINTING_MODE_MONOSPACED_ONLY);
|
message->AddInt8("hinting", HINTING_MODE_MONOSPACED_ONLY);
|
||||||
fHintingMenu->AddItem(new BMenuItem(TR(kMonospacedHintingLabel), message));
|
fHintingMenu->AddItem(new BMenuItem(B_TRANSLATE(kMonospacedHintingLabel),
|
||||||
|
message));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -269,7 +274,9 @@ void
|
|||||||
AntialiasingSettingsView::_SetCurrentAntialiasing()
|
AntialiasingSettingsView::_SetCurrentAntialiasing()
|
||||||
{
|
{
|
||||||
BMenuItem *item = fAntialiasingMenu->FindItem(
|
BMenuItem *item = fAntialiasingMenu->FindItem(
|
||||||
fCurrentSubpixelAntialiasing ? TR(kSubpixelLabel) : TR(kGrayscaleLabel));
|
fCurrentSubpixelAntialiasing
|
||||||
|
? B_TRANSLATE(kSubpixelLabel)
|
||||||
|
: B_TRANSLATE(kGrayscaleLabel));
|
||||||
if (item != NULL)
|
if (item != NULL)
|
||||||
item->SetMarked(true);
|
item->SetMarked(true);
|
||||||
if (fCurrentSubpixelAntialiasing)
|
if (fCurrentSubpixelAntialiasing)
|
||||||
@@ -293,7 +300,7 @@ AntialiasingSettingsView::_SetCurrentHinting()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
BMenuItem *item = fHintingMenu->FindItem(TR(label));
|
BMenuItem *item = fHintingMenu->FindItem(B_TRANSLATE(label));
|
||||||
if (item != NULL)
|
if (item != NULL)
|
||||||
item->SetMarked(true);
|
item->SetMarked(true);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,31 +24,35 @@
|
|||||||
|
|
||||||
static ColorDescription sColorDescriptionTable[] =
|
static ColorDescription sColorDescriptionTable[] =
|
||||||
{
|
{
|
||||||
{ B_PANEL_BACKGROUND_COLOR, TR_MARK("Panel background") },
|
{ B_PANEL_BACKGROUND_COLOR, B_TRANSLATE_MARK("Panel background") },
|
||||||
{ B_PANEL_TEXT_COLOR, TR_MARK("Panel text") },
|
{ B_PANEL_TEXT_COLOR, B_TRANSLATE_MARK("Panel text") },
|
||||||
{ B_DOCUMENT_BACKGROUND_COLOR, TR_MARK("Document background") },
|
{ B_DOCUMENT_BACKGROUND_COLOR, B_TRANSLATE_MARK("Document background") },
|
||||||
{ B_DOCUMENT_TEXT_COLOR, TR_MARK("Document text") },
|
{ B_DOCUMENT_TEXT_COLOR, B_TRANSLATE_MARK("Document text") },
|
||||||
{ B_CONTROL_BACKGROUND_COLOR, TR_MARK("Control background") },
|
{ B_CONTROL_BACKGROUND_COLOR, B_TRANSLATE_MARK("Control background") },
|
||||||
{ B_CONTROL_TEXT_COLOR, TR_MARK("Control text") },
|
{ B_CONTROL_TEXT_COLOR, B_TRANSLATE_MARK("Control text") },
|
||||||
{ B_CONTROL_BORDER_COLOR, TR_MARK("Control border") },
|
{ B_CONTROL_BORDER_COLOR, B_TRANSLATE_MARK("Control border") },
|
||||||
{ B_CONTROL_HIGHLIGHT_COLOR, TR_MARK("Control highlight") },
|
{ B_CONTROL_HIGHLIGHT_COLOR, B_TRANSLATE_MARK("Control highlight") },
|
||||||
{ B_NAVIGATION_BASE_COLOR, TR_MARK("Navigation base") },
|
{ B_NAVIGATION_BASE_COLOR, B_TRANSLATE_MARK("Navigation base") },
|
||||||
{ B_NAVIGATION_PULSE_COLOR, TR_MARK("Navigation pulse") },
|
{ B_NAVIGATION_PULSE_COLOR, B_TRANSLATE_MARK("Navigation pulse") },
|
||||||
{ B_SHINE_COLOR, TR_MARK("Shine") },
|
{ B_SHINE_COLOR, B_TRANSLATE_MARK("Shine") },
|
||||||
{ B_SHADOW_COLOR, TR_MARK("Shadow") },
|
{ B_SHADOW_COLOR, B_TRANSLATE_MARK("Shadow") },
|
||||||
{ B_MENU_BACKGROUND_COLOR, TR_MARK("Menu background") },
|
{ B_MENU_BACKGROUND_COLOR, B_TRANSLATE_MARK("Menu background") },
|
||||||
{ B_MENU_SELECTED_BACKGROUND_COLOR, TR_MARK("Selected menu item background") },
|
{ B_MENU_SELECTED_BACKGROUND_COLOR,
|
||||||
{ B_MENU_ITEM_TEXT_COLOR, TR_MARK("Menu item text") },
|
B_TRANSLATE_MARK("Selected menu item background") },
|
||||||
{ B_MENU_SELECTED_ITEM_TEXT_COLOR, TR_MARK("Selected menu item text") },
|
{ B_MENU_ITEM_TEXT_COLOR, B_TRANSLATE_MARK("Menu item text") },
|
||||||
{ B_MENU_SELECTED_BORDER_COLOR, TR_MARK("Selected menu item border") },
|
{ B_MENU_SELECTED_ITEM_TEXT_COLOR,
|
||||||
{ B_TOOL_TIP_BACKGROUND_COLOR, TR_MARK("Tooltip background") },
|
B_TRANSLATE_MARK("Selected menu item text") },
|
||||||
{ B_TOOL_TIP_TEXT_COLOR, TR_MARK("Tooltip text") },
|
{ B_MENU_SELECTED_BORDER_COLOR,
|
||||||
{ B_SUCCESS_COLOR, TR_MARK("Success") },
|
B_TRANSLATE_MARK("Selected menu item border") },
|
||||||
{ B_FAILURE_COLOR, TR_MARK("Failure") },
|
{ B_TOOL_TIP_BACKGROUND_COLOR, B_TRANSLATE_MARK("Tooltip background") },
|
||||||
{ B_WINDOW_TAB_COLOR, TR_MARK("Window tab") },
|
{ B_TOOL_TIP_TEXT_COLOR, B_TRANSLATE_MARK("Tooltip text") },
|
||||||
{ B_WINDOW_TEXT_COLOR, TR_MARK("Window tab text") },
|
{ B_SUCCESS_COLOR, B_TRANSLATE_MARK("Success") },
|
||||||
{ B_WINDOW_INACTIVE_TAB_COLOR, TR_MARK("Inactive window tab") },
|
{ B_FAILURE_COLOR, B_TRANSLATE_MARK("Failure") },
|
||||||
{ B_WINDOW_INACTIVE_TEXT_COLOR, TR_MARK("Inactive window tab text") }
|
{ B_WINDOW_TAB_COLOR, B_TRANSLATE_MARK("Window tab") },
|
||||||
|
{ B_WINDOW_TEXT_COLOR, B_TRANSLATE_MARK("Window tab text") },
|
||||||
|
{ B_WINDOW_INACTIVE_TAB_COLOR, B_TRANSLATE_MARK("Inactive window tab") },
|
||||||
|
{ B_WINDOW_INACTIVE_TEXT_COLOR,
|
||||||
|
B_TRANSLATE_MARK("Inactive window tab text") }
|
||||||
};
|
};
|
||||||
|
|
||||||
const int32 sColorDescriptionCount = sizeof(sColorDescriptionTable)
|
const int32 sColorDescriptionCount = sizeof(sColorDescriptionTable)
|
||||||
|
|||||||
Reference in New Issue
Block a user