Skip to content

Commit

Permalink
Merge pull request #1648 from wwivbbs/1622-fsed-color-matching
Browse files Browse the repository at this point in the history
FSED TopBar and BottomBar colors made to match - Fix #1622
  • Loading branch information
ericpareja authored Dec 14, 2024
2 parents f3ee24c + bae32e3 commit 76bac1a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
21 changes: 12 additions & 9 deletions bbs/readmail.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -322,9 +322,9 @@ static std::string from_name(const mailrec& m, const Network& net, const slrec&
return a()->names()->UserName(m.fromuser);
}
} else {
if (nn == 255) {
return fmt::format("#{} @{}.", m.fromuser, m.fromsys, net.name);
}
// if (nn == 255) {
// return fmt::format("#{} @{}.", m.fromuser, m.fromsys, net.name);
// }
if (auto o = readfile(&m.msg, "email")) {
if (const auto idx = o.value().find('\r'); idx != std::string::npos) {
const std::string from = o.value().substr(0, idx);
Expand All @@ -346,12 +346,12 @@ static std::string from_name(const mailrec& m, const Network& net, const slrec&
static std::tuple<Network, int> network_and_num(const mailrec& m) {
Network net{};
auto nn = network_number_from(&m);
if (nn <= a()->nets().size()) {
if (nn < a()->nets().size()) {
net = a()->nets()[nn];
} else {
net.sysnum = static_cast<uint16_t>(-1);
net.type = network_type_t::unknown;
net.name = fmt::format("<deleted network #{}>", nn);
net.name = fmt::format("<net #{}>", nn);
nn = 255;
}
return std::make_tuple(net, nn);
Expand Down Expand Up @@ -404,7 +404,9 @@ void readmail(bool newmail_only) {
curmail = 0;
} else {
bout.outstr("\r\n\n|#2You have mail from:\r\n");
bout.print("|#9{}\r\n", std::string(a()->user()->screen_width() - 1, '-'));
std::string box = okansi() ? "\xDA\xC0\xBF\xD9\xC4\xB3" : "++++-|";
// 0 upperleft 1 lowerleft 2 upperright 3 lowerright 4 = - 5 = |"
bout.print("|#7\xDA{}\xBF\r\n", std::string(a()->user()->screen_width() - 3, box[4]));
for (auto i = 0; i < mw && !abort; i++) {
if (!read_same_email(mloc, mw, i, m, false, 0)) {
continue;
Expand All @@ -417,11 +419,12 @@ void readmail(bool newmail_only) {
auto [net, nn] = network_and_num(m);
set_net_num(nn);
const auto current_line =
fmt::format("|#2{:>3}{}|#1{:<45.45}|#7| |#1{:<25.25}", i + 1, (m.status & status_seen ? " " : "|#3*"),
from_name(m, net, sl, nn), stripcolors(m.title));
fmt::format("|#7{}|#2{:>3}{}|#1{:<45.45}|#7{} |#1{:<25.25} |#7{}", box[5], i + 1, (m.status & status_seen ? " " : "|#3*"),
from_name(m, net, sl, nn), box[5], stripcolors(m.title),box[5]);
bout.bpla(current_line, &abort);
}
bout.print("|#9{}\r\n", std::string(a()->user()->screen_width() - 1, '-'));
bout.print("|#7\xC0{}\xD9\r\n", std::string(a()->user()->screen_width() - 3, box[4]));
// bout.print("|#9{}\r\n", std::string(a()->user()->screen_width() - 1, '-'));
bout.outstr("|#9(|#2Q|#9=|#2Quit|#9, |#2Enter|#9=|#2First Message|#9) \r\n");
bout.outstr("|#9Enter message number: ");
const auto res = bin.input_number_hotkey(curmail + 1, {'Q'}, curmail + 1, mw, true);
Expand Down
4 changes: 2 additions & 2 deletions common/full_screen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ void FullScreenView::DrawBottomBar(const std::string& text) {
const auto saved_color = bout.curatr();
auto at_exit = finally([=] { bout.setc(saved_color); });

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

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

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

Expand Down

0 comments on commit 76bac1a

Please # to comment.