mirror of
https://github.com/AlexandreRouma/SDRPlusPlus.git
synced 2025-06-28 21:37:50 +02:00
bugfix + part of the new command arg system
This commit is contained in:
@ -450,7 +450,7 @@ void MainWindow::draw() {
|
||||
// Handle menu resize
|
||||
ImVec2 winSize = ImGui::GetWindowSize();
|
||||
ImVec2 mousePos = ImGui::GetMousePos();
|
||||
if (!lockWaterfallControls) {
|
||||
if (!lockWaterfallControls && showMenu) {
|
||||
float curY = ImGui::GetCursorPosY();
|
||||
bool click = ImGui::IsMouseClicked(ImGuiMouseButton_Left);
|
||||
bool down = ImGui::IsMouseDown(ImGuiMouseButton_Left);
|
||||
@ -639,6 +639,7 @@ void MainWindow::draw() {
|
||||
ImGui::SetCursorPosX((ImGui::GetWindowSize().x / 2.0) - (ImGui::CalcTextSize("Min").x / 2.0));
|
||||
ImGui::TextUnformatted("Min");
|
||||
ImGui::SetCursorPosX((ImGui::GetWindowSize().x / 2.0) - 10 * style::uiScale);
|
||||
ImGui::SetItemUsingMouseWheel();
|
||||
if (ImGui::VSliderFloat("##_9_", wfSliderSize, &fftMin, 0.0, -160.0f, "")) {
|
||||
fftMin = std::min<float>(fftMax - 10, fftMin);
|
||||
core::configManager.acquire();
|
||||
|
@ -7,6 +7,7 @@
|
||||
#include <gui/main_window.h>
|
||||
#include <signal_path/signal_path.h>
|
||||
#include <gui/style.h>
|
||||
#include <utils/optionlist.h>
|
||||
|
||||
namespace displaymenu {
|
||||
bool showWaterfall;
|
||||
@ -18,6 +19,10 @@ namespace displaymenu {
|
||||
std::string colorMapAuthor = "";
|
||||
int selectedWindow = 0;
|
||||
int fftRate = 20;
|
||||
int uiScaleId = 0;
|
||||
bool restartRequired = false;
|
||||
|
||||
OptionList<float, float> uiScales;
|
||||
|
||||
const int FFTSizes[] = {
|
||||
524288,
|
||||
@ -85,6 +90,17 @@ namespace displaymenu {
|
||||
|
||||
selectedWindow = std::clamp<int>((int)core::configManager.conf["fftWindow"], 0, _FFT_WINDOW_COUNT - 1);
|
||||
gui::mainWindow.setFFTWindow(selectedWindow);
|
||||
|
||||
// Define and load UI scales
|
||||
uiScales.define(0.5f, "50%", 0.5f);
|
||||
uiScales.define(1.0f, "100%", 1.0f);
|
||||
uiScales.define(1.5f, "150%", 1.5f);
|
||||
uiScales.define(2.0f, "200%", 2.0f);
|
||||
uiScales.define(2.5f, "250%", 2.5f);
|
||||
uiScales.define(3.0f, "300%", 3.0f);
|
||||
uiScales.define(3.5f, "350%", 3.5f);
|
||||
uiScales.define(4.0f, "400%", 4.0f);
|
||||
uiScaleId = uiScales.valueId(style::uiScale);
|
||||
}
|
||||
|
||||
void draw(void* ctx) {
|
||||
@ -112,6 +128,15 @@ namespace displaymenu {
|
||||
core::configManager.release(true);
|
||||
}
|
||||
|
||||
ImGui::LeftLabel("High-DPI Scaling");
|
||||
ImGui::FillWidth();
|
||||
if (ImGui::Combo("##sdrpp_ui_scale", &uiScaleId, uiScales.txt)) {
|
||||
core::configManager.acquire();
|
||||
core::configManager.conf["uiScale"] = uiScales[uiScaleId];
|
||||
core::configManager.release(true);
|
||||
restartRequired = true;
|
||||
}
|
||||
|
||||
ImGui::LeftLabel("FFT Framerate");
|
||||
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
|
||||
if (ImGui::InputInt("##sdrpp_fft_rate", &fftRate, 1, 10)) {
|
||||
@ -153,5 +178,9 @@ namespace displaymenu {
|
||||
}
|
||||
ImGui::Text("Color map Author: %s", colorMapAuthor.c_str());
|
||||
}
|
||||
|
||||
if (restartRequired) {
|
||||
ImGui::TextColored(ImVec4(1.0f, 1.0f, 0.0f, 1.0f), "Restart required.");
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user