diff --git a/src/apps/terminal/AppearPrefView.cpp b/src/apps/terminal/AppearPrefView.cpp index d9a689cf5c..ca74a5ea36 100644 --- a/src/apps/terminal/AppearPrefView.cpp +++ b/src/apps/terminal/AppearPrefView.cpp @@ -61,9 +61,9 @@ AppearancePrefView::AppearancePrefView(const char* name, B_TRANSLATE("Blinking cursor"), new BMessage(MSG_BLINK_CURSOR_CHANGED)); - fBrightInsteadOfBold = new BCheckBox( - B_TRANSLATE("Use bright instead of bold text"), - new BMessage(MSG_BRIGHT_INSTEAD_OF_BOLD_CHANGED)); + fAllowBold = new BCheckBox( + B_TRANSLATE("Allow bold text"), + new BMessage(MSG_ALLOW_BOLD_CHANGED)); fWarnOnExit = new BCheckBox( B_TRANSLATE("Confirm exit if active programs exist"), @@ -139,7 +139,7 @@ AppearancePrefView::AppearancePrefView(const char* name, .Add(fColorControl = new BColorControl(BPoint(10, 10), B_CELLS_32x8, 8.0, "", new BMessage(MSG_COLOR_CHANGED))) .Add(fBlinkCursor) - .Add(fBrightInsteadOfBold) + .Add(fAllowBold) .Add(fWarnOnExit); fTabTitle->SetAlignment(B_ALIGN_RIGHT, B_ALIGN_LEFT); @@ -171,7 +171,7 @@ AppearancePrefView::Revert() fWindowTitle->SetText(pref->getString(PREF_WINDOW_TITLE)); fBlinkCursor->SetValue(pref->getBool(PREF_BLINK_CURSOR)); - fBrightInsteadOfBold->SetValue(pref->getBool(PREF_BRIGHT_INSTEAD_OF_BOLD)); + fAllowBold->SetValue(pref->getBool(PREF_ALLOW_BOLD)); fWarnOnExit->SetValue(pref->getBool(PREF_WARN_ON_EXIT)); _SetCurrentColorScheme(); @@ -193,7 +193,7 @@ AppearancePrefView::AttachedToWindow() fTabTitle->SetTarget(this); fWindowTitle->SetTarget(this); fBlinkCursor->SetTarget(this); - fBrightInsteadOfBold->SetTarget(this); + fAllowBold->SetTarget(this); fWarnOnExit->SetTarget(this); fFontField->Menu()->SetTargetForItems(this); @@ -329,11 +329,11 @@ AppearancePrefView::MessageReceived(BMessage* msg) } break; - case MSG_BRIGHT_INSTEAD_OF_BOLD_CHANGED: - if (PrefHandler::Default()->getBool(PREF_BRIGHT_INSTEAD_OF_BOLD) - != fBrightInsteadOfBold->Value()) { - PrefHandler::Default()->setBool(PREF_BRIGHT_INSTEAD_OF_BOLD, - fBrightInsteadOfBold->Value()); + case MSG_ALLOW_BOLD_CHANGED: + if (PrefHandler::Default()->getBool(PREF_ALLOW_BOLD) + != fAllowBold->Value()) { + PrefHandler::Default()->setBool(PREF_ALLOW_BOLD, + fAllowBold->Value()); modified = true; } break; diff --git a/src/apps/terminal/AppearPrefView.h b/src/apps/terminal/AppearPrefView.h index 7d6de490fe..5482937ca7 100644 --- a/src/apps/terminal/AppearPrefView.h +++ b/src/apps/terminal/AppearPrefView.h @@ -24,7 +24,7 @@ static const uint32 MSG_COLOR_SCHEME_CHANGED = 'mccs'; static const uint32 MSG_TAB_TITLE_SETTING_CHANGED = 'mtts'; static const uint32 MSG_WINDOW_TITLE_SETTING_CHANGED = 'mwts'; static const uint32 MSG_BLINK_CURSOR_CHANGED = 'mbcc'; -static const uint32 MSG_BRIGHT_INSTEAD_OF_BOLD_CHANGED = 'bibc'; +static const uint32 MSG_ALLOW_BOLD_CHANGED = 'mabc'; static const uint32 MSG_WARN_ON_EXIT_CHANGED = 'mwec'; static const uint32 MSG_COLS_CHANGED = 'mccl'; static const uint32 MSG_HISTORY_CHANGED = 'mhst'; @@ -77,7 +77,7 @@ private: const char* style, const char* size); BCheckBox* fBlinkCursor; - BCheckBox* fBrightInsteadOfBold; + BCheckBox* fAllowBold; BCheckBox* fWarnOnExit; BMenuField* fFontField; diff --git a/src/apps/terminal/TermConst.h b/src/apps/terminal/TermConst.h index f1d965f431..0f25319623 100644 --- a/src/apps/terminal/TermConst.h +++ b/src/apps/terminal/TermConst.h @@ -132,8 +132,7 @@ static const char* const PREF_ROWS = "Rows"; static const char* const PREF_TEXT_ENCODING = "Text encoding"; static const char* const PREF_BLINK_CURSOR = "Blinking cursor"; -static const char* const PREF_BRIGHT_INSTEAD_OF_BOLD = - "Bright instead of bold text"; +static const char* const PREF_ALLOW_BOLD = "Allow bold text"; static const char* const PREF_WARN_ON_EXIT = "Warn on exit"; static const char* const PREF_CURSOR_STYLE = "Cursor style"; static const char* const PREF_EMULATE_BOLD = "Emulate bold"; diff --git a/src/apps/terminal/TermView.cpp b/src/apps/terminal/TermView.cpp index 2a4da3c5d5..6565dceb22 100644 --- a/src/apps/terminal/TermView.cpp +++ b/src/apps/terminal/TermView.cpp @@ -283,7 +283,7 @@ TermView::_InitObject(const ShellParameters& shellParameters) fFontHeight = 0; fFontAscent = 0; fEmulateBold = false; - fBrightInsteadOfBold = false; + fAllowBold = false; fFrameResized = false; fResizeViewDisableCount = 0; fLastActivityTime = 0; @@ -779,8 +779,8 @@ TermView::SetTermFont(const BFont *font) fEmulateBold = PrefHandler::Default() == NULL ? false : PrefHandler::Default()->getBool(PREF_EMULATE_BOLD); - fBrightInsteadOfBold = PrefHandler::Default() == NULL ? false - : PrefHandler::Default()->getBool(PREF_BRIGHT_INSTEAD_OF_BOLD); + fAllowBold = PrefHandler::Default() == NULL ? false + : PrefHandler::Default()->getBool(PREF_ALLOW_BOLD); _ScrollTo(0, false); if (fScrollBar != NULL) @@ -962,7 +962,7 @@ TermView::_DrawLinePart(int32 x1, int32 y1, uint32 attr, char *buf, if (highlight != NULL) attr = highlight->Highlighter()->AdjustTextAttributes(attr); - inView->SetFont(IS_BOLD(attr) && !fEmulateBold && !fBrightInsteadOfBold + inView->SetFont(IS_BOLD(attr) && !fEmulateBold && fAllowBold ? &fBoldFont : &fHalfFont); // Set pen point @@ -1005,7 +1005,11 @@ TermView::_DrawLinePart(int32 x1, int32 y1, uint32 attr, char *buf, // Draw character. if (IS_BOLD(attr)) { - if (fBrightInsteadOfBold) { + if (fEmulateBold) { + inView->MovePenTo(x1 - 1, y1 + fFontAscent - 1); + inView->DrawString((char *)buf); + inView->SetDrawingMode(B_OP_BLEND); + } else { rgb_color bright = rgb_fore; bright.red = saturated_add(bright.red, 64); @@ -1013,10 +1017,6 @@ TermView::_DrawLinePart(int32 x1, int32 y1, uint32 attr, char *buf, bright.blue = saturated_add(bright.blue, 64); inView->SetHighColor(bright); - } else if (fEmulateBold) { - inView->MovePenTo(x1 - 1, y1 + fFontAscent - 1); - inView->DrawString((char *)buf); - inView->SetDrawingMode(B_OP_BLEND); } } diff --git a/src/apps/terminal/TermView.h b/src/apps/terminal/TermView.h index f444653e40..10b42862a7 100644 --- a/src/apps/terminal/TermView.h +++ b/src/apps/terminal/TermView.h @@ -275,7 +275,7 @@ private: int fFontAscent; struct escapement_delta fEscapement; bool fEmulateBold; - bool fBrightInsteadOfBold; + bool fAllowBold; // frame resized flag. bool fFrameResized; diff --git a/src/apps/terminal/TermWindow.cpp b/src/apps/terminal/TermWindow.cpp index 6350e6a4d6..81896f7aaa 100644 --- a/src/apps/terminal/TermWindow.cpp +++ b/src/apps/terminal/TermWindow.cpp @@ -840,7 +840,7 @@ TermWindow::MessageReceived(BMessage *message) case MSG_HALF_FONT_CHANGED: case MSG_FULL_FONT_CHANGED: - case MSG_BRIGHT_INSTEAD_OF_BOLD_CHANGED: + case MSG_ALLOW_BOLD_CHANGED: { BFont font; _GetPreferredFont(font);