Skip to content

Commit 76bac1a

Browse files
authored
Merge pull request #1648 from wwivbbs/1622-fsed-color-matching
FSED TopBar and BottomBar colors made to match - Fix #1622
2 parents f3ee24c + bae32e3 commit 76bac1a

File tree

2 files changed

+14
-11
lines changed

2 files changed

+14
-11
lines changed

bbs/readmail.cpp

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -322,9 +322,9 @@ static std::string from_name(const mailrec& m, const Network& net, const slrec&
322322
return a()->names()->UserName(m.fromuser);
323323
}
324324
} else {
325-
if (nn == 255) {
326-
return fmt::format("#{} @{}.", m.fromuser, m.fromsys, net.name);
327-
}
325+
// if (nn == 255) {
326+
// return fmt::format("#{} @{}.", m.fromuser, m.fromsys, net.name);
327+
// }
328328
if (auto o = readfile(&m.msg, "email")) {
329329
if (const auto idx = o.value().find('\r'); idx != std::string::npos) {
330330
const std::string from = o.value().substr(0, idx);
@@ -346,12 +346,12 @@ static std::string from_name(const mailrec& m, const Network& net, const slrec&
346346
static std::tuple<Network, int> network_and_num(const mailrec& m) {
347347
Network net{};
348348
auto nn = network_number_from(&m);
349-
if (nn <= a()->nets().size()) {
349+
if (nn < a()->nets().size()) {
350350
net = a()->nets()[nn];
351351
} else {
352352
net.sysnum = static_cast<uint16_t>(-1);
353353
net.type = network_type_t::unknown;
354-
net.name = fmt::format("<deleted network #{}>", nn);
354+
net.name = fmt::format("<net #{}>", nn);
355355
nn = 255;
356356
}
357357
return std::make_tuple(net, nn);
@@ -404,7 +404,9 @@ void readmail(bool newmail_only) {
404404
curmail = 0;
405405
} else {
406406
bout.outstr("\r\n\n|#2You have mail from:\r\n");
407-
bout.print("|#9{}\r\n", std::string(a()->user()->screen_width() - 1, '-'));
407+
std::string box = okansi() ? "\xDA\xC0\xBF\xD9\xC4\xB3" : "++++-|";
408+
// 0 upperleft 1 lowerleft 2 upperright 3 lowerright 4 = - 5 = |"
409+
bout.print("|#7\xDA{}\xBF\r\n", std::string(a()->user()->screen_width() - 3, box[4]));
408410
for (auto i = 0; i < mw && !abort; i++) {
409411
if (!read_same_email(mloc, mw, i, m, false, 0)) {
410412
continue;
@@ -417,11 +419,12 @@ void readmail(bool newmail_only) {
417419
auto [net, nn] = network_and_num(m);
418420
set_net_num(nn);
419421
const auto current_line =
420-
fmt::format("|#2{:>3}{}|#1{:<45.45}|#7| |#1{:<25.25}", i + 1, (m.status & status_seen ? " " : "|#3*"),
421-
from_name(m, net, sl, nn), stripcolors(m.title));
422+
fmt::format("|#7{}|#2{:>3}{}|#1{:<45.45}|#7{} |#1{:<25.25} |#7{}", box[5], i + 1, (m.status & status_seen ? " " : "|#3*"),
423+
from_name(m, net, sl, nn), box[5], stripcolors(m.title),box[5]);
422424
bout.bpla(current_line, &abort);
423425
}
424-
bout.print("|#9{}\r\n", std::string(a()->user()->screen_width() - 1, '-'));
426+
bout.print("|#7\xC0{}\xD9\r\n", std::string(a()->user()->screen_width() - 3, box[4]));
427+
// bout.print("|#9{}\r\n", std::string(a()->user()->screen_width() - 1, '-'));
425428
bout.outstr("|#9(|#2Q|#9=|#2Quit|#9, |#2Enter|#9=|#2First Message|#9) \r\n");
426429
bout.outstr("|#9Enter message number: ");
427430
const auto res = bin.input_number_hotkey(curmail + 1, {'Q'}, curmail + 1, mw, true);

common/full_screen.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ void FullScreenView::DrawBottomBar(const std::string& text) {
9595
const auto saved_color = bout.curatr();
9696
auto at_exit = finally([=] { bout.setc(saved_color); });
9797

98-
bout_.print("|09{:c}{}{:c}", static_cast<unsigned char>(198),
98+
bout_.print("|#7{:c}{}{:c}", static_cast<unsigned char>(198),
9999
std::string(screen_width_ - 2, static_cast<unsigned char>(205)),
100100
static_cast<unsigned char>(181));
101101

@@ -105,7 +105,7 @@ void FullScreenView::DrawBottomBar(const std::string& text) {
105105

106106
const auto x = screen_width_ - 10 - ssize(text);
107107
bout_.goxy(x, y);
108-
bout_.print("|09{:c}|17|14 {} |16|09{:c}", static_cast<unsigned char>(181), text,
108+
bout_.print("|#7{:c}|17|14 {} |16|09{:c}", static_cast<unsigned char>(181), text,
109109
static_cast<unsigned char>(198));
110110
}
111111

0 commit comments

Comments
 (0)