mirror of
https://github.com/AlexandreRouma/SDRPlusPlus.git
synced 2024-11-10 12:47:40 +01:00
Fixes to the UI
This commit is contained in:
parent
e744520d50
commit
7079ddb74e
@ -24,9 +24,10 @@ namespace sdrpp_credits {
|
||||
|
||||
const char* libraries[] = {
|
||||
"Dear ImGui (ocornut)",
|
||||
"fftw3 (fftw.org)",
|
||||
"glew (Nigel Stewart)",
|
||||
"glfw (Camilla Löwy)",
|
||||
"json (nlohmann)",
|
||||
"RtAudio",
|
||||
"SoapySDR (PothosWare)",
|
||||
"spdlog (gabime)",
|
||||
"Portable File Dialogs"
|
||||
};
|
||||
|
@ -15,6 +15,10 @@ namespace credits {
|
||||
|
||||
void show() {
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(20.0f, 20.0f));
|
||||
ImGui::PushStyleColor(ImGuiCol_Border, ImVec4(0,0,0,0));
|
||||
ImVec2 dispSize = ImGui::GetIO().DisplaySize;
|
||||
ImVec2 center = ImVec2(dispSize.x/2.0f, dispSize.y/2.0f);
|
||||
ImGui::SetNextWindowPos(center, ImGuiCond_Always, ImVec2(0.5f, 0.5f));
|
||||
ImGui::OpenPopup("Credits");
|
||||
ImGui::BeginPopupModal("Credits", NULL, ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoMove);
|
||||
|
||||
@ -55,11 +59,8 @@ namespace credits {
|
||||
ImGui::Spacing();
|
||||
ImGui::Text("SDR++ v" VERSION_STR " (Built at " __TIME__ ", " __DATE__ ")");
|
||||
|
||||
ImVec2 dispSize = ImGui::GetIO().DisplaySize;
|
||||
ImVec2 winSize = ImGui::GetWindowSize();
|
||||
ImGui::SetWindowPos(ImVec2(std::round((dispSize.x/2) - (winSize.x/2)), std::round((dispSize.y/2) - (winSize.y/2))));
|
||||
|
||||
ImGui::EndPopup();
|
||||
ImGui::PopStyleVar(1);
|
||||
ImGui::PopStyleColor();
|
||||
ImGui::PopStyleVar();
|
||||
}
|
||||
}
|
@ -680,7 +680,9 @@ private:
|
||||
std::string hoveredBookmarkName;
|
||||
|
||||
if (_this->bookmarkDisplayMode == BOOKMARK_DISP_MODE_TOP) {
|
||||
for (auto const bm : _this->waterfallBookmarks) {
|
||||
int count = _this->waterfallBookmarks.size();
|
||||
for (int i = count-1; i >= 0; i--) {
|
||||
auto& bm = _this->waterfallBookmarks[i];
|
||||
double centerXpos = args.fftRectMin.x + std::round((bm.bookmark.frequency - args.lowFreq) * args.freqToPixelRatio);
|
||||
ImVec2 nameSize = ImGui::CalcTextSize(bm.bookmarkName.c_str());
|
||||
ImVec2 rectMin = ImVec2(centerXpos-(nameSize.x/2)-5, args.fftRectMin.y);
|
||||
@ -697,7 +699,9 @@ private:
|
||||
}
|
||||
}
|
||||
else if (_this->bookmarkDisplayMode == BOOKMARK_DISP_MODE_BOTTOM) {
|
||||
for (auto const bm : _this->waterfallBookmarks) {
|
||||
int count = _this->waterfallBookmarks.size();
|
||||
for (int i = count-1; i >= 0; i--) {
|
||||
auto& bm = _this->waterfallBookmarks[i];
|
||||
double centerXpos = args.fftRectMin.x + std::round((bm.bookmark.frequency - args.lowFreq) * args.freqToPixelRatio);
|
||||
ImVec2 nameSize = ImGui::CalcTextSize(bm.bookmarkName.c_str());
|
||||
ImVec2 rectMin = ImVec2(centerXpos-(nameSize.x/2)-5, args.fftRectMax.y-nameSize.y);
|
||||
|
Loading…
Reference in New Issue
Block a user