Switched to ImGui::TextUnfort

This commit is contained in:
AlexandreRouma 2022-01-26 14:50:16 +01:00
parent e158eabbf4
commit 03f0704dff
14 changed files with 42 additions and 71 deletions

View File

@ -22,7 +22,7 @@ namespace credits {
ImGui::BeginPopupModal("Credits", NULL, ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoMove); ImGui::BeginPopupModal("Credits", NULL, ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoMove);
ImGui::PushFont(style::hugeFont); ImGui::PushFont(style::hugeFont);
ImGui::Text("SDR++ "); ImGui::TextUnformatted("SDR++ ");
ImGui::PopFont(); ImGui::PopFont();
ImGui::SameLine(); ImGui::SameLine();
ImGui::Image(icons::LOGO, ImVec2(128, 128)); ImGui::Image(icons::LOGO, ImVec2(128, 128));
@ -30,29 +30,29 @@ namespace credits {
ImGui::Spacing(); ImGui::Spacing();
ImGui::Spacing(); ImGui::Spacing();
ImGui::Text("This software is brought to you by Alexandre Rouma (ON5RYZ) with the help of\n\n"); ImGui::TextUnformatted("This software is brought to you by Alexandre Rouma (ON5RYZ) with the help of\n\n");
ImGui::Columns(4, "CreditColumns", true); ImGui::Columns(4, "CreditColumns", true);
ImGui::Text("Contributors"); ImGui::TextUnformatted("Contributors");
for (int i = 0; i < sdrpp_credits::contributorCount; i++) { for (int i = 0; i < sdrpp_credits::contributorCount; i++) {
ImGui::BulletText("%s", sdrpp_credits::contributors[i]); ImGui::BulletText("%s", sdrpp_credits::contributors[i]);
} }
ImGui::NextColumn(); ImGui::NextColumn();
ImGui::Text("Libraries"); ImGui::TextUnformatted("Libraries");
for (int i = 0; i < sdrpp_credits::libraryCount; i++) { for (int i = 0; i < sdrpp_credits::libraryCount; i++) {
ImGui::BulletText("%s", sdrpp_credits::libraries[i]); ImGui::BulletText("%s", sdrpp_credits::libraries[i]);
} }
ImGui::NextColumn(); ImGui::NextColumn();
ImGui::Text("Hardware Donators"); ImGui::TextUnformatted("Hardware Donators");
for (int i = 0; i < sdrpp_credits::hardwareDonatorCount; i++) { for (int i = 0; i < sdrpp_credits::hardwareDonatorCount; i++) {
ImGui::BulletText("%s", sdrpp_credits::hardwareDonators[i]); ImGui::BulletText("%s", sdrpp_credits::hardwareDonators[i]);
} }
ImGui::NextColumn(); ImGui::NextColumn();
ImGui::Text("Patrons"); ImGui::TextUnformatted("Patrons");
for (int i = 0; i < sdrpp_credits::patronCount; i++) { for (int i = 0; i < sdrpp_credits::patronCount; i++) {
ImGui::BulletText("%s", sdrpp_credits::patrons[i]); ImGui::BulletText("%s", sdrpp_credits::patrons[i]);
} }
@ -62,7 +62,7 @@ namespace credits {
ImGui::Spacing(); ImGui::Spacing();
ImGui::Spacing(); ImGui::Spacing();
ImGui::Spacing(); ImGui::Spacing();
ImGui::Text("SDR++ v" VERSION_STR " (Built at " __TIME__ ", " __DATE__ ")"); ImGui::TextUnformatted("SDR++ v" VERSION_STR " (Built at " __TIME__ ", " __DATE__ ")");
ImGui::EndPopup(); ImGui::EndPopup();
ImGui::PopStyleColor(); ImGui::PopStyleColor();

View File

@ -30,40 +30,11 @@ namespace LoadingScreen {
ImGui::BeginPopupModal("Credits", NULL, ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoBackground); ImGui::BeginPopupModal("Credits", NULL, ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoBackground);
ImGui::PushFont(style::hugeFont); ImGui::PushFont(style::hugeFont);
ImGui::Text("SDR++ "); ImGui::TextUnformatted("SDR++ ");
ImGui::PopFont(); ImGui::PopFont();
ImGui::SameLine(); ImGui::SameLine();
ImGui::Image(icons::LOGO, ImVec2(128, 128)); ImGui::Image(icons::LOGO, ImVec2(128, 128));
// ImGui::Spacing();
// ImGui::Spacing();
// ImGui::Spacing();
// ImGui::Text("This software is brought to you by\n\n");
// ImGui::Columns(3, "CreditColumns", true);
// ImGui::Text("Contributors");
// for (int i = 0; i < sdrpp_credits::contributorCount; i++) {
// ImGui::BulletText("%s", sdrpp_credits::contributors[i]);
// }
// ImGui::NextColumn();
// ImGui::Text("Libraries");
// for (int i = 0; i < sdrpp_credits::libraryCount; i++) {
// ImGui::BulletText("%s", sdrpp_credits::libraries[i]);
// }
// ImGui::NextColumn();
// ImGui::Text("Patrons");
// for (int i = 0; i < sdrpp_credits::patronCount; i++) {
// ImGui::BulletText("%s", sdrpp_credits::patrons[i]);
// }
// ImGui::Columns(1, "CreditColumnsEnd", true);
// ImGui::Spacing();
// ImGui::Spacing();
// ImGui::Spacing();
ImVec2 origPos = ImGui::GetCursorPos(); ImVec2 origPos = ImGui::GetCursorPos();
ImGui::SetCursorPosY(origPos.y + 50); ImGui::SetCursorPosY(origPos.y + 50);
ImGui::Text("%s", msg.c_str()); ImGui::Text("%s", msg.c_str());

View File

@ -601,7 +601,7 @@ void MainWindow::draw() {
ImGui::BeginChild("WaterfallControls"); ImGui::BeginChild("WaterfallControls");
ImGui::SetCursorPosX((ImGui::GetWindowSize().x / 2.0) - (ImGui::CalcTextSize("Zoom").x / 2.0)); ImGui::SetCursorPosX((ImGui::GetWindowSize().x / 2.0) - (ImGui::CalcTextSize("Zoom").x / 2.0));
ImGui::Text("Zoom"); ImGui::TextUnformatted("Zoom");
ImGui::SetCursorPosX((ImGui::GetWindowSize().x / 2.0) - 10); ImGui::SetCursorPosX((ImGui::GetWindowSize().x / 2.0) - 10);
if (ImGui::VSliderFloat("##_7_", ImVec2(20.0, 150.0), &bw, 1.0, 0.0, "")) { if (ImGui::VSliderFloat("##_7_", ImVec2(20.0, 150.0), &bw, 1.0, 0.0, "")) {
double factor = (double)bw * (double)bw; double factor = (double)bw * (double)bw;
@ -620,7 +620,7 @@ void MainWindow::draw() {
ImGui::NewLine(); ImGui::NewLine();
ImGui::SetCursorPosX((ImGui::GetWindowSize().x / 2.0) - (ImGui::CalcTextSize("Max").x / 2.0)); ImGui::SetCursorPosX((ImGui::GetWindowSize().x / 2.0) - (ImGui::CalcTextSize("Max").x / 2.0));
ImGui::Text("Max"); ImGui::TextUnformatted("Max");
ImGui::SetCursorPosX((ImGui::GetWindowSize().x / 2.0) - 10); ImGui::SetCursorPosX((ImGui::GetWindowSize().x / 2.0) - 10);
if (ImGui::VSliderFloat("##_8_", ImVec2(20.0, 150.0), &fftMax, 0.0, -160.0f, "")) { if (ImGui::VSliderFloat("##_8_", ImVec2(20.0, 150.0), &fftMax, 0.0, -160.0f, "")) {
fftMax = std::max<float>(fftMax, fftMin + 10); fftMax = std::max<float>(fftMax, fftMin + 10);
@ -632,7 +632,7 @@ void MainWindow::draw() {
ImGui::NewLine(); ImGui::NewLine();
ImGui::SetCursorPosX((ImGui::GetWindowSize().x / 2.0) - (ImGui::CalcTextSize("Min").x / 2.0)); ImGui::SetCursorPosX((ImGui::GetWindowSize().x / 2.0) - (ImGui::CalcTextSize("Min").x / 2.0));
ImGui::Text("Min"); ImGui::TextUnformatted("Min");
ImGui::SetCursorPosX((ImGui::GetWindowSize().x / 2.0) - 10); ImGui::SetCursorPosX((ImGui::GetWindowSize().x / 2.0) - 10);
if (ImGui::VSliderFloat("##_9_", ImVec2(20.0, 150.0), &fftMin, 0.0, -160.0f, "")) { if (ImGui::VSliderFloat("##_9_", ImVec2(20.0, 150.0), &fftMin, 0.0, -160.0f, "")) {
fftMin = std::min<float>(fftMax - 10, fftMin); fftMin = std::min<float>(fftMax - 10, fftMin);

View File

@ -56,7 +56,7 @@ namespace module_manager_menu {
confirmOpened = true; confirmOpened = true;
} }
ImGui::SetCursorPos(ImVec2(origPos.x + 2, origPos.y - 5)); ImGui::SetCursorPos(ImVec2(origPos.x + 2, origPos.y - 5));
ImGui::Text("_"); ImGui::TextUnformatted("_");
} }
ImGui::EndTable(); ImGui::EndTable();
} }

View File

@ -668,7 +668,7 @@ namespace SmGui {
} }
void Text(const char* str) { void Text(const char* str) {
if (!options::opts.serverMode) { ImGui::Text("%s", str); return; } if (!options::opts.serverMode) { ImGui::TextUnformatted(str); return; }
if (rdl) { if (rdl) {
rdl->pushStep(DRAW_STEP_TEXT, false); rdl->pushStep(DRAW_STEP_TEXT, false);
rdl->pushString(str); rdl->pushString(str);

View File

@ -449,8 +449,8 @@ namespace ImGui {
ImGui::Text("SNR: %0.1fdB", snr); ImGui::Text("SNR: %0.1fdB", snr);
} }
else { else {
ImGui::Text("Strength: ---.-dBFS"); ImGui::TextUnformatted("Strength: ---.-dBFS");
ImGui::Text("SNR: ---.-dB"); ImGui::TextUnformatted("SNR: ---.-dB");
} }
} }

View File

@ -160,62 +160,62 @@ private:
if (!_this->lsf.valid) { if (!_this->lsf.valid) {
ImGui::TableNextRow(); ImGui::TableNextRow();
ImGui::TableSetColumnIndex(0); ImGui::TableSetColumnIndex(0);
ImGui::Text("Source"); ImGui::TextUnformatted("Source");
ImGui::TableSetColumnIndex(1); ImGui::TableSetColumnIndex(1);
ImGui::Text("--"); ImGui::TextUnformatted("--");
ImGui::TableNextRow(); ImGui::TableNextRow();
ImGui::TableSetColumnIndex(0); ImGui::TableSetColumnIndex(0);
ImGui::Text("Destination"); ImGui::TextUnformatted("Destination");
ImGui::TableSetColumnIndex(1); ImGui::TableSetColumnIndex(1);
ImGui::Text("--"); ImGui::TextUnformatted("--");
ImGui::TableNextRow(); ImGui::TableNextRow();
ImGui::TableSetColumnIndex(0); ImGui::TableSetColumnIndex(0);
ImGui::Text("Data Type"); ImGui::TextUnformatted("Data Type");
ImGui::TableSetColumnIndex(1); ImGui::TableSetColumnIndex(1);
ImGui::Text("--"); ImGui::TextUnformatted("--");
ImGui::TableNextRow(); ImGui::TableNextRow();
ImGui::TableSetColumnIndex(0); ImGui::TableSetColumnIndex(0);
ImGui::Text("Encryption"); ImGui::TextUnformatted("Encryption");
ImGui::TableSetColumnIndex(1); ImGui::TableSetColumnIndex(1);
ImGui::Text("-- (Subtype --)"); ImGui::TextUnformatted("-- (Subtype --)");
ImGui::TableNextRow(); ImGui::TableNextRow();
ImGui::TableSetColumnIndex(0); ImGui::TableSetColumnIndex(0);
ImGui::Text("CAN"); ImGui::TextUnformatted("CAN");
ImGui::TableSetColumnIndex(1); ImGui::TableSetColumnIndex(1);
ImGui::Text("--"); ImGui::TextUnformatted("--");
} }
else { else {
ImGui::TableNextRow(); ImGui::TableNextRow();
ImGui::TableSetColumnIndex(0); ImGui::TableSetColumnIndex(0);
ImGui::Text("Source"); ImGui::TextUnformatted("Source");
ImGui::TableSetColumnIndex(1); ImGui::TableSetColumnIndex(1);
ImGui::TextUnformatted(_this->lsf.src.c_str()); ImGui::TextUnformatted(_this->lsf.src.c_str());
ImGui::TableNextRow(); ImGui::TableNextRow();
ImGui::TableSetColumnIndex(0); ImGui::TableSetColumnIndex(0);
ImGui::Text("Destination"); ImGui::TextUnformatted("Destination");
ImGui::TableSetColumnIndex(1); ImGui::TableSetColumnIndex(1);
ImGui::TextUnformatted(_this->lsf.dst.c_str()); ImGui::TextUnformatted(_this->lsf.dst.c_str());
ImGui::TableNextRow(); ImGui::TableNextRow();
ImGui::TableSetColumnIndex(0); ImGui::TableSetColumnIndex(0);
ImGui::Text("Data Type"); ImGui::TextUnformatted("Data Type");
ImGui::TableSetColumnIndex(1); ImGui::TableSetColumnIndex(1);
ImGui::TextUnformatted(M17DataTypesTxt[_this->lsf.dataType]); ImGui::TextUnformatted(M17DataTypesTxt[_this->lsf.dataType]);
ImGui::TableNextRow(); ImGui::TableNextRow();
ImGui::TableSetColumnIndex(0); ImGui::TableSetColumnIndex(0);
ImGui::Text("Encryption"); ImGui::TextUnformatted("Encryption");
ImGui::TableSetColumnIndex(1); ImGui::TableSetColumnIndex(1);
ImGui::Text("%s (Subtype %d)", M17EncryptionTypesTxt[_this->lsf.encryptionType], _this->lsf.encryptionSubType); ImGui::Text("%s (Subtype %d)", M17EncryptionTypesTxt[_this->lsf.encryptionType], _this->lsf.encryptionSubType);
ImGui::TableNextRow(); ImGui::TableNextRow();
ImGui::TableSetColumnIndex(0); ImGui::TableSetColumnIndex(0);
ImGui::Text("CAN"); ImGui::TextUnformatted("CAN");
ImGui::TableSetColumnIndex(1); ImGui::TableSetColumnIndex(1);
ImGui::Text("%d", _this->lsf.channelAccessNum); ImGui::Text("%d", _this->lsf.channelAccessNum);
} }

View File

@ -157,7 +157,7 @@ private:
if (ImGui::Button(CONCAT("Record##_recorder_rec_", _this->name), ImVec2(menuWidth, 0))) { if (ImGui::Button(CONCAT("Record##_recorder_rec_", _this->name), ImVec2(menuWidth, 0))) {
_this->startRecording(); _this->startRecording();
} }
ImGui::Text("Idle --.--MB"); ImGui::TextUnformatted("Idle --.--MB");
} }
if (!_this->folderSelect.pathIsValid() && _this->enabled) { style::endDisabled(); } if (!_this->folderSelect.pathIsValid() && _this->enabled) { style::endDisabled(); }

View File

@ -478,7 +478,7 @@ private:
// Bookmark delete confirm dialog // Bookmark delete confirm dialog
// List delete confirmation // List delete confirmation
if (ImGui::GenericDialog(("freq_manager_del_list_confirm" + _this->name).c_str(), _this->deleteBookmarksOpen, GENERIC_DIALOG_BUTTONS_YES_NO, [_this]() { if (ImGui::GenericDialog(("freq_manager_del_list_confirm" + _this->name).c_str(), _this->deleteBookmarksOpen, GENERIC_DIALOG_BUTTONS_YES_NO, [_this]() {
ImGui::Text("Deleting selected bookmaks. Are you sure?"); ImGui::TextUnformatted("Deleting selected bookmaks. Are you sure?");
}) == GENERIC_DIALOG_BUTTON_YES) { }) == GENERIC_DIALOG_BUTTON_YES) {
for (auto& _name : selectedNames) { _this->bookmarks.erase(_name); } for (auto& _name : selectedNames) { _this->bookmarks.erase(_name); }
_this->saveByName(_this->selectedListName); _this->saveByName(_this->selectedListName);

View File

@ -183,7 +183,7 @@ private:
_this->startServer(); _this->startServer();
} }
ImGui::Text("Status:"); ImGui::TextUnformatted("Status:");
ImGui::SameLine(); ImGui::SameLine();
if (_this->client && _this->client->isOpen()) { if (_this->client && _this->client->isOpen()) {
ImGui::TextColored(ImVec4(0.0, 1.0, 0.0, 1.0), "Connected"); ImGui::TextColored(ImVec4(0.0, 1.0, 0.0, 1.0), "Connected");
@ -192,7 +192,7 @@ private:
ImGui::TextColored(ImVec4(1.0, 1.0, 0.0, 1.0), "Listening"); ImGui::TextColored(ImVec4(1.0, 1.0, 0.0, 1.0), "Listening");
} }
else { else {
ImGui::Text("Idle"); ImGui::TextUnformatted("Idle");
} }
} }

View File

@ -114,7 +114,7 @@ private:
} }
ImGui::TableSetColumnIndex(1); ImGui::TableSetColumnIndex(1);
ImGui::Text("todo"); ImGui::TextUnformatted("todo");
} }
ImGui::EndTable(); ImGui::EndTable();
} }

View File

@ -60,7 +60,7 @@ public:
// Fill rows here // Fill rows here
ImGui::TableNextRow(); ImGui::TableNextRow();
ImGui::TableSetColumnIndex(0); ImGui::TableSetColumnIndex(0);
ImGui::Text("Every day at 00:00:00"); ImGui::TextUnformatted("Every day at 00:00:00");
ImGui::EndTable(); ImGui::EndTable();
} }

View File

@ -182,7 +182,7 @@ public:
config.release(true); config.release(true);
} }
ImGui::Text("Status:"); ImGui::TextUnformatted("Status:");
ImGui::SameLine(); ImGui::SameLine();
if (conn && conn->isOpen()) { if (conn && conn->isOpen()) {
ImGui::TextColored(ImVec4(0.0, 1.0, 0.0, 1.0), (modeId == SINK_MODE_TCP) ? "Connected" : "Sending"); ImGui::TextColored(ImVec4(0.0, 1.0, 0.0, 1.0), (modeId == SINK_MODE_TCP) ? "Connected" : "Sending");
@ -191,7 +191,7 @@ public:
ImGui::TextColored(ImVec4(1.0, 1.0, 0.0, 1.0), "Listening"); ImGui::TextColored(ImVec4(1.0, 1.0, 0.0, 1.0), "Listening");
} }
else { else {
ImGui::Text("Idle"); ImGui::TextUnformatted("Idle");
} }
} }

View File

@ -147,7 +147,7 @@ private:
gui::mainWindow.playButtonLocked = !connected; gui::mainWindow.playButtonLocked = !connected;
ImGui::GenericDialog("##sdrpp_srv_src_err_dialog", _this->serverBusy, GENERIC_DIALOG_BUTTONS_OK, [=](){ ImGui::GenericDialog("##sdrpp_srv_src_err_dialog", _this->serverBusy, GENERIC_DIALOG_BUTTONS_OK, [=](){
ImGui::Text("This server is already in use."); ImGui::TextUnformatted("This server is already in use.");
}); });
if (connected) { style::beginDisabled(); } if (connected) { style::beginDisabled(); }
@ -210,7 +210,7 @@ private:
_this->client->bytes = 0; _this->client->bytes = 0;
} }
ImGui::Text("Status:"); ImGui::TextUnformatted("Status:");
ImGui::SameLine(); ImGui::SameLine();
ImGui::TextColored(ImVec4(0.0f, 1.0f, 0.0f, 1.0f), "Connected (%.3f Mbit/s)", _this->datarate); ImGui::TextColored(ImVec4(0.0f, 1.0f, 0.0f, 1.0f), "Connected (%.3f Mbit/s)", _this->datarate);
@ -219,9 +219,9 @@ private:
_this->client->showMenu(); _this->client->showMenu();
} }
else { else {
ImGui::Text("Status:"); ImGui::TextUnformatted("Status:");
ImGui::SameLine(); ImGui::SameLine();
ImGui::Text("Not connected (--.--- Mbit/s)"); ImGui::TextUnformatted("Not connected (--.--- Mbit/s)");
} }
} }