@@ -411,8 +411,9 @@ void MainWindow::draw() {
411411 float topBarWidth = ImGui::GetWindowSize ().x ;
412412
413413 ImVec2 btnSize (30 * style::uiScale, 30 * style::uiScale);
414+ int toolbarButtonPadding = style::scale (5 .0f );
414415 ImGui::PushID (ImGui::GetID (" sdrpp_menu_btn" ));
415- if (ImGui::ImageButton (icons::MENU , btnSize, ImVec2 (0 , 0 ), ImVec2 (1 , 1 ), 5 , ImVec4 (0 , 0 , 0 , 0 ), textCol) || ImGui::IsKeyPressed (ImGuiKey_Menu, false )) {
416+ if (ImGui::ImageButton (icons::MENU , btnSize, ImVec2 (0 , 0 ), ImVec2 (1 , 1 ), toolbarButtonPadding , ImVec4 (0 , 0 , 0 , 0 ), textCol) || ImGui::IsKeyPressed (ImGuiKey_Menu, false )) {
416417 showMenu = !showMenu;
417418 core::configManager.acquire ();
418419 core::configManager.conf [" showMenu" ] = showMenu;
@@ -426,14 +427,14 @@ void MainWindow::draw() {
426427 if (playButtonLocked && !tmpPlaySate) { style::beginDisabled (); }
427428 if (playing) {
428429 ImGui::PushID (ImGui::GetID (" sdrpp_stop_btn" ));
429- if (ImGui::ImageButton (icons::STOP , btnSize, ImVec2 (0 , 0 ), ImVec2 (1 , 1 ), 5 , ImVec4 (0 , 0 , 0 , 0 ), textCol) || ImGui::IsKeyPressed (ImGuiKey_End, false )) {
430+ if (ImGui::ImageButton (icons::STOP , btnSize, ImVec2 (0 , 0 ), ImVec2 (1 , 1 ), toolbarButtonPadding , ImVec4 (0 , 0 , 0 , 0 ), textCol) || ImGui::IsKeyPressed (ImGuiKey_End, false )) {
430431 setPlayState (false );
431432 }
432433 ImGui::PopID ();
433434 }
434435 else { // TODO: Might need to check if there even is a device
435436 ImGui::PushID (ImGui::GetID (" sdrpp_play_btn" ));
436- if (ImGui::ImageButton (icons::PLAY , btnSize, ImVec2 (0 , 0 ), ImVec2 (1 , 1 ), 5 , ImVec4 (0 , 0 , 0 , 0 ), textCol) || ImGui::IsKeyPressed (ImGuiKey_End, false )) {
437+ if (ImGui::ImageButton (icons::PLAY , btnSize, ImVec2 (0 , 0 ), ImVec2 (1 , 1 ), toolbarButtonPadding , ImVec4 (0 , 0 , 0 , 0 ), textCol) || ImGui::IsKeyPressed (ImGuiKey_End, false )) {
437438 setPlayState (true );
438439 }
439440 ImGui::PopID ();
@@ -454,15 +455,15 @@ void MainWindow::draw() {
454455 float volumeWidth;
455456 {
456457 float itemSpacing = ImGui::GetStyle ().ItemSpacing .x ;
457- float tuningCost = btnSize.x + 2 * 5 * style::uiScale + itemSpacing; // btn + padding + gap
458+ float tuningCost = btnSize.x + 2 * toolbarButtonPadding + itemSpacing; // btn + padding + gap
458459 float freqCost = gui::freqSelect.getWidth () + itemSpacing;
459460 float snrMinWidth = ImGui::GetSNRMeterMinWidth ();
460461 float snrOffset = 87 .0f * style::uiScale;
461462 float rightReserve = snrMinWidth + snrOffset;
462463 float available = topBarWidth - ImGui::GetCursorPosX () - freqCost - tuningCost - rightReserve;
463464 volumeWidth = std::clamp (available, 100 .0f * style::uiScale, 248 .0f * style::uiScale);
464465 }
465- sigpath::sinkManager.showVolumeSlider (gui::waterfall.selectedVFO , " ##_sdrpp_main_volume_" , volumeWidth, btnSize.x , 5 , true );
466+ sigpath::sinkManager.showVolumeSlider (gui::waterfall.selectedVFO , " ##_sdrpp_main_volume_" , volumeWidth, btnSize.x , toolbarButtonPadding , true );
466467
467468 ImGui::SameLine ();
468469
@@ -474,7 +475,7 @@ void MainWindow::draw() {
474475 ImGui::SetCursorPosY (origY);
475476 if (tuningMode == tuner::TUNER_MODE_CENTER ) {
476477 ImGui::PushID (ImGui::GetID (" sdrpp_ena_st_btn" ));
477- if (ImGui::ImageButton (icons::CENTER_TUNING , btnSize, ImVec2 (0 , 0 ), ImVec2 (1 , 1 ), 5 , ImVec4 (0 , 0 , 0 , 0 ), textCol)) {
478+ if (ImGui::ImageButton (icons::CENTER_TUNING , btnSize, ImVec2 (0 , 0 ), ImVec2 (1 , 1 ), toolbarButtonPadding , ImVec4 (0 , 0 , 0 , 0 ), textCol)) {
478479 tuningMode = tuner::TUNER_MODE_NORMAL ;
479480 gui::waterfall.VFOMoveSingleClick = false ;
480481 core::configManager.acquire ();
@@ -485,7 +486,7 @@ void MainWindow::draw() {
485486 }
486487 else { // TODO: Might need to check if there even is a device
487488 ImGui::PushID (ImGui::GetID (" sdrpp_dis_st_btn" ));
488- if (ImGui::ImageButton (icons::NORMAL_TUNING , btnSize, ImVec2 (0 , 0 ), ImVec2 (1 , 1 ), 5 , ImVec4 (0 , 0 , 0 , 0 ), textCol)) {
489+ if (ImGui::ImageButton (icons::NORMAL_TUNING , btnSize, ImVec2 (0 , 0 ), ImVec2 (1 , 1 ), toolbarButtonPadding , ImVec4 (0 , 0 , 0 , 0 ), textCol)) {
489490 tuningMode = tuner::TUNER_MODE_CENTER ;
490491 gui::waterfall.VFOMoveSingleClick = true ;
491492 tuner::tune (tuner::TUNER_MODE_CENTER , gui::waterfall.selectedVFO , gui::freqSelect.frequency );
0 commit comments