@@ -211,7 +211,7 @@ const void RenderComponents()
211211 {
212212 /* * Not currently uninstalling, the user is selecting components to be uninstalled */
213213 if (!isUninstalling) {
214- state.isSelected = RenderCheckBox (state.isSelected , formattedComponent. c_str () , strPathList. c_str () , false , true )->isChecked ;
214+ state.isSelected = RenderCheckBox (state.isSelected , formattedComponent, strPathList, false , true )->isChecked ;
215215 continue ;
216216 }
217217
@@ -348,34 +348,66 @@ const void RenderUninstallSelect(std::shared_ptr<RouterNav> router, float xPos)
348348 RenderBottomNavBar (" InstallPrompt" , xPos, [router, xPos]
349349 {
350350 static bool isButtonHovered = false ;
351- float currentColor = EaseInOutFloat (" ##NextButton" , 1 .0f , 0 .8f , isButtonHovered, 0 .3f );
352-
353- PushStyleColor (ImGuiCol_Button, ImVec4 (currentColor, currentColor, currentColor, 1 .0f ));
354- PushStyleColor (ImGuiCol_ButtonHovered, ImVec4 (currentColor, currentColor, currentColor, 1 .0f ));
355- PushStyleColor (ImGuiCol_ButtonActive, ImVec4 (0 .8f , 0 .8f , 0 .8f , 1 .0f ));
356351
357352 if (uninstallFinished) {
353+ float currentColor = EaseInOutFloat (" ##NextButton" , 1 .0f , 0 .8f , isButtonHovered, 0 .3f );
354+
355+ PushStyleColor (ImGuiCol_Button, ImVec4 (currentColor, currentColor, currentColor, 1 .0f ));
356+ PushStyleColor (ImGuiCol_ButtonHovered, ImVec4 (currentColor, currentColor, currentColor, 1 .0f ));
357+ PushStyleColor (ImGuiCol_ButtonActive, ImVec4 (0 .8f , 0 .8f , 0 .8f , 1 .0f ));
358+
358359 if (Button (" Exit" , ImVec2 (xPos + GetContentRegionAvail ().x , GetContentRegionAvail ().y ))) {
359360 std::exit (0 );
360361 }
362+
363+ if (isButtonHovered) {
364+ SetMouseCursor (ImGuiMouseCursor_Hand);
365+ }
366+
367+ PopStyleColor (3 );
368+ isButtonHovered = IsItemHovered () || (IsItemHovered (ImGuiHoveredFlags_AllowWhenBlockedByActiveItem) && IsMouseDown (ImGuiMouseButton_Left));
369+ } else if (isUninstalling) {
370+ PushStyleColor (ImGuiCol_ChildBg, ImVec4 (0 .6f , 0 .6f , 0 .6f , 1 .0f ));
371+ PushStyleVar (ImGuiStyleVar_ChildRounding, ScaleX (10 .0f ));
372+
373+ const float childWidth = GetContentRegionAvail ().x ;
374+ const float childHeight = GetContentRegionAvail ().y ;
375+
376+ BeginChild (" ##ButtonIsBusy" , { xPos + childWidth, childHeight }, true , ImGuiWindowFlags_NoScrollbar);
377+ {
378+ const float spinnerSize = ScaleX (12 .f );
379+ SetCursorPos ({ childWidth / 2 - spinnerSize, spinnerSize });
380+
381+ Spinner<SpinnerTypeT::e_st_ang>(" SpinnerAngNoBg" , Radius{ spinnerSize }, Thickness{ ScaleX (2 ) }, Color{ ImColor (0 , 0 , 0 , 255 ) },
382+ BgColor{ ImColor (255 , 255 , 255 , 0 ) }, Speed{ 6 }, Angle{ IM_PI }, Mode{ 0 });
383+ }
384+ EndChild ();
385+ PopStyleColor ();
386+ PopStyleVar ();
387+
388+ if (IsItemHovered ()) {
389+ SetMouseCursor (ImGuiMouseCursor_NotAllowed);
390+ }
361391 } else {
362- if (Button (" Uninstall" , ImVec2 (xPos + GetContentRegionAvail ().x , GetContentRegionAvail ().y ))) {
363- if (isUninstalling) {
364- return ;
365- }
392+ float currentColor = EaseInOutFloat (" ##NextButton" , 1 .0f , 0 .8f , isButtonHovered, 0 .3f );
393+
394+ PushStyleColor (ImGuiCol_Button, ImVec4 (currentColor, currentColor, currentColor, 1 .0f ));
395+ PushStyleColor (ImGuiCol_ButtonHovered, ImVec4 (currentColor, currentColor, currentColor, 1 .0f ));
396+ PushStyleColor (ImGuiCol_ButtonActive, ImVec4 (0 .8f , 0 .8f , 0 .8f , 1 .0f ));
366397
398+ if (Button (" Uninstall" , ImVec2 (xPos + GetContentRegionAvail ().x , GetContentRegionAvail ().y ))) {
367399 std::cout << " Uninstalling components..." << std::endl;
368400
369401 isUninstalling = true ;
370402 std::thread (StartUninstall).detach ();
371403 }
372- }
373404
374- if (isButtonHovered) {
375- SetMouseCursor (ImGuiMouseCursor_Hand);
376- }
405+ if (isButtonHovered) {
406+ SetMouseCursor (ImGuiMouseCursor_Hand);
407+ }
377408
378- PopStyleColor (3 );
379- isButtonHovered = IsItemHovered () || (IsItemHovered (ImGuiHoveredFlags_AllowWhenBlockedByActiveItem) && IsMouseDown (ImGuiMouseButton_Left));
409+ PopStyleColor (3 );
410+ isButtonHovered = IsItemHovered () || (IsItemHovered (ImGuiHoveredFlags_AllowWhenBlockedByActiveItem) && IsMouseDown (ImGuiMouseButton_Left));
411+ }
380412 });
381413}
0 commit comments