@@ -690,147 +690,161 @@ struct Skin {
690
690
ImGui::NewLine ();
691
691
692
692
if (activeSettingsTab == WINAMP) {
693
- ImGui::PushStyleVar (ImGuiStyleVar_GrabMinSize, 40 .0f );
694
- ImGui::PushStyleVar (ImGuiStyleVar_ScrollbarSize, 40 .0f );
695
- if (ImGui::BeginCombo (" ##" , skinList->at (selectedSkinIdx).name .c_str (), ImGuiComboFlags_HeightRegular)) {
696
- for (int n = 0 ; n < skinList->size (); n++) {
697
- const bool is_selected = (selectedSkinIdx == n);
698
- if (ImGui::Selectable (skinList->at (n).name .c_str (), is_selected)) {
699
- selectedSkinIdx = n;
700
- }
701
- }
702
- ImGui::EndCombo ();
703
- }
704
- ImGui::PopStyleVar (2 );
693
+ Winamp ();
694
+ } else if (activeSettingsTab == CASSETTE) {
695
+ Cassette ();
696
+ } else if (activeSettingsTab == DIGITAL_CLOCK) {
697
+ DigitalClock ();
698
+ }
699
+ }
705
700
706
- ImGui::SameLine ();
707
- if (activeSkinVariant == WINAMP) {
708
- if (ImGui::Button (" Load skin" )) {
709
- loadStatusStr = " Loading " + skinList->at (selectedSkinIdx).name ;
710
- winamp.changeSkin (skinList->at (selectedSkinIdx).fullPath );
711
- needLoad = true ;
701
+ void Winamp () {
702
+ ImGui::PushStyleVar (ImGuiStyleVar_GrabMinSize, 40 .0f );
703
+ ImGui::PushStyleVar (ImGuiStyleVar_ScrollbarSize, 40 .0f );
704
+ if (ImGui::BeginCombo (" ##" , skinList->at (selectedSkinIdx).name .c_str (), ImGuiComboFlags_HeightRegular)) {
705
+ for (int n = 0 ; n < skinList->size (); n++) {
706
+ const bool is_selected = (selectedSkinIdx == n);
707
+ if (ImGui::Selectable (skinList->at (n).name .c_str (), is_selected)) {
708
+ selectedSkinIdx = n;
712
709
}
713
710
}
711
+ ImGui::EndCombo ();
712
+ }
713
+ ImGui::PopStyleVar (2 );
714
714
715
- if (!loadStatusStr.empty ()) {
716
- ImGui::Text (" %s" , loadStatusStr.c_str ());
715
+ ImGui::SameLine ();
716
+ if (activeSkinVariant == WINAMP) {
717
+ if (ImGui::Button (" Load skin" )) {
718
+ loadStatusStr = " Loading " + skinList->at (selectedSkinIdx).name ;
719
+ winamp.changeSkin (skinList->at (selectedSkinIdx).fullPath );
720
+ needLoad = true ;
717
721
}
722
+ }
718
723
719
- ImGui::NewLine ();
724
+ if (!loadStatusStr.empty ()) {
725
+ ImGui::Text (" %s" , loadStatusStr.c_str ());
726
+ }
720
727
721
- if (ImGui::Checkbox (" Use bitmap font" , &config->winamp .useBitmapFont )) {
722
- config->Save ();
723
- if (activeSkinVariant == WINAMP) {
724
- winamp.Format (true );
725
- }
726
- }
728
+ ImGui::NewLine ();
727
729
728
- if (ImGui::Checkbox (" Use bitmap font in playlist" , &config->winamp .useBitmapFontInPlaylist )) {
729
- config->Save ();
730
- if (activeSkinVariant == WINAMP) {
731
- winamp.Format (true );
732
- }
730
+ if (ImGui::Checkbox (" Use bitmap font" , &config->winamp .useBitmapFont )) {
731
+ config->Save ();
732
+ if (activeSkinVariant == WINAMP) {
733
+ winamp.Format (true );
733
734
}
735
+ }
734
736
735
- if (ImGui::Checkbox (" Prefer time remaining" , &config->winamp .preferTimeRemaining )) {
736
- config->Save ();
737
+ if (ImGui::Checkbox (" Use bitmap font in playlist" , &config->winamp .useBitmapFontInPlaylist )) {
738
+ config->Save ();
739
+ if (activeSkinVariant == WINAMP) {
740
+ winamp.Format (true );
737
741
}
742
+ }
738
743
739
- if (ImGui::Checkbox (" Show clutterbar" , &config->winamp .showClutterbar )) {
740
- config->Save ();
741
- }
742
- } else if (activeSettingsTab == CASSETTE) {
743
- if (ImGui::Checkbox (" Randomize?" , &config->cassette .randomize )) {
744
- config->Save ();
745
- }
744
+ if (ImGui::Checkbox (" Prefer time remaining" , &config->winamp .preferTimeRemaining )) {
745
+ config->Save ();
746
+ }
746
747
747
- static ImGuiTableFlags flags = ImGuiTableFlags_ScrollY | ImGuiTableFlags_RowBg | ImGuiTableFlags_BordersOuter |
748
- ImGuiTableFlags_BordersV | ImGuiTableFlags_SizingStretchProp;
748
+ if (ImGui::Checkbox (" Show clutterbar" , &config->winamp .showClutterbar )) {
749
+ config->Save ();
750
+ }
749
751
750
- ImVec2 outer_size = ImVec2 (0 .0f , ImGui::GetTextLineHeightWithSpacing () * 7 );
752
+ if (ImGui::Checkbox (" Skin transparency" , &config->winamp .skinTransparency )) {
753
+ config->Save ();
754
+ }
755
+ }
751
756
752
- ImGui::PushStyleVar (ImGuiStyleVar_GrabMinSize, 40 .0f );
753
- ImGui::PushStyleVar (ImGuiStyleVar_ScrollbarSize, 40 .0f );
754
- if (ImGui::BeginTable (" configTable" , 3 , flags, outer_size)) {
755
- ImGui::TableSetupScrollFreeze (0 , 1 ); // Make top row always visible
756
- ImGui::TableSetupColumn (" Codec" , ImGuiTableColumnFlags_None);
757
- ImGui::TableSetupColumn (" Tape" , ImGuiTableColumnFlags_None);
758
- ImGui::TableSetupColumn (" Reel" , ImGuiTableColumnFlags_None);
759
- ImGui::TableHeadersRow ();
760
-
761
- for (auto &tt : config->cassette .data ) {
762
- ImGui::TableNextRow ();
763
- ImGui::TableNextColumn ();
764
- ImGui::Text (" %s" , tt.second .name .c_str ());
765
-
766
- ImGui::TableNextColumn ();
767
- if (ImGui::BeginCombo ((" ##" + tt.second .name + " tape" ).c_str (), tt.second .tape .c_str (), ImGuiComboFlags_HeightSmall)) {
768
- for (auto &n : *tapeList) {
769
- if (!n.valid ) {
770
- continue ;
771
- }
757
+ void Cassette () {
758
+ if (ImGui::Checkbox (" Randomize?" , &config->cassette .randomize )) {
759
+ config->Save ();
760
+ }
772
761
773
- if (ImGui::Selectable (n.name .c_str (), false )) {
774
- tt.second .tape = n.name ;
775
- config->cassette .data .at (tt.first ).tape = n.name ;
776
- config->Save ();
762
+ static ImGuiTableFlags flags = ImGuiTableFlags_ScrollY | ImGuiTableFlags_RowBg | ImGuiTableFlags_BordersOuter |
763
+ ImGuiTableFlags_BordersV | ImGuiTableFlags_SizingStretchProp;
777
764
778
- if (activeSkinVariant == CASSETTE) {
779
- cassette.UnloadUnused ();
780
- cassette.LoadTape (n.name );
781
- cassette.SelectTape ();
782
- }
765
+ ImVec2 outer_size = ImVec2 (0 .0f , ImGui::GetTextLineHeightWithSpacing () * 7 );
766
+
767
+ ImGui::PushStyleVar (ImGuiStyleVar_GrabMinSize, 40 .0f );
768
+ ImGui::PushStyleVar (ImGuiStyleVar_ScrollbarSize, 40 .0f );
769
+ if (ImGui::BeginTable (" configTable" , 3 , flags, outer_size)) {
770
+ ImGui::TableSetupScrollFreeze (0 , 1 ); // Make top row always visible
771
+ ImGui::TableSetupColumn (" Codec" , ImGuiTableColumnFlags_None);
772
+ ImGui::TableSetupColumn (" Tape" , ImGuiTableColumnFlags_None);
773
+ ImGui::TableSetupColumn (" Reel" , ImGuiTableColumnFlags_None);
774
+ ImGui::TableHeadersRow ();
775
+
776
+ for (auto &tt : config->cassette .data ) {
777
+ ImGui::TableNextRow ();
778
+ ImGui::TableNextColumn ();
779
+ ImGui::Text (" %s" , tt.second .name .c_str ());
780
+
781
+ ImGui::TableNextColumn ();
782
+ if (ImGui::BeginCombo ((" ##" + tt.second .name + " tape" ).c_str (), tt.second .tape .c_str (), ImGuiComboFlags_HeightSmall)) {
783
+ for (auto &n : *tapeList) {
784
+ if (!n.valid ) {
785
+ continue ;
786
+ }
787
+
788
+ if (ImGui::Selectable (n.name .c_str (), false )) {
789
+ tt.second .tape = n.name ;
790
+ config->cassette .data .at (tt.first ).tape = n.name ;
791
+ config->Save ();
792
+
793
+ if (activeSkinVariant == CASSETTE) {
794
+ cassette.UnloadUnused ();
795
+ cassette.LoadTape (n.name );
796
+ cassette.SelectTape ();
783
797
}
784
798
}
785
- ImGui::EndCombo ();
786
799
}
800
+ ImGui::EndCombo ();
801
+ }
787
802
788
- ImGui::TableNextColumn ();
789
- if (ImGui::BeginCombo ((" ##" + tt.second .name + " reel" ).c_str (), tt.second .reel .c_str (), ImGuiComboFlags_HeightSmall)) {
790
- for (auto &n : *reelList) {
791
- if (!n.valid ) {
792
- continue ;
793
- }
803
+ ImGui::TableNextColumn ();
804
+ if (ImGui::BeginCombo ((" ##" + tt.second .name + " reel" ).c_str (), tt.second .reel .c_str (), ImGuiComboFlags_HeightSmall)) {
805
+ for (auto &n : *reelList) {
806
+ if (!n.valid ) {
807
+ continue ;
808
+ }
794
809
795
- if (ImGui::Selectable (n.name .c_str (), false )) {
796
- tt.second .reel = n.name ;
797
- config->cassette .data .at (tt.first ).reel = n.name ;
798
- config->Save ();
810
+ if (ImGui::Selectable (n.name .c_str (), false )) {
811
+ tt.second .reel = n.name ;
812
+ config->cassette .data .at (tt.first ).reel = n.name ;
813
+ config->Save ();
799
814
800
- if (activeSkinVariant == CASSETTE) {
801
- cassette.UnloadUnused ();
802
- cassette.LoadReel (n.name );
803
- cassette.SelectTape ();
804
- }
815
+ if (activeSkinVariant == CASSETTE) {
816
+ cassette.UnloadUnused ();
817
+ cassette.LoadReel (n.name );
818
+ cassette.SelectTape ();
805
819
}
806
820
}
807
- ImGui::EndCombo ();
808
821
}
822
+ ImGui::EndCombo ();
809
823
}
810
- ImGui::EndTable ();
811
824
}
812
- ImGui::PopStyleVar (2 );
825
+ ImGui::EndTable ();
826
+ }
827
+ ImGui::PopStyleVar (2 );
813
828
814
- if (ImGui::Button (" Reset" )) {
815
- DLOG (" resetting cassette config\n " );
816
- cassette.config ->Default ();
817
- config->Save ();
818
- if (activeSkinVariant == CASSETTE) {
819
- cassette.SelectTape ();
820
- cassette.LoadImages ();
821
- cassette.UnloadUnused ();
822
- }
829
+ if (ImGui::Button (" Reset" )) {
830
+ DLOG (" resetting cassette config\n " );
831
+ cassette.config ->Default ();
832
+ config->Save ();
833
+ if (activeSkinVariant == CASSETTE) {
834
+ cassette.SelectTape ();
835
+ cassette.LoadImages ();
836
+ cassette.UnloadUnused ();
823
837
}
824
- } else if (activeSettingsTab == DIGITAL_CLOCK) {
825
- DigitalClock ();
826
838
}
827
839
}
828
840
829
841
void DigitalClock () {
830
842
ImGui::PushStyleVar (ImGuiStyleVar_GrabMinSize, 40 .0f );
831
843
ImGui::PushStyleVar (ImGuiStyleVar_ScrollbarSize, 40 .0f );
832
844
if (ImGui::BeginCombo (
833
- " ##digiClockColor" , digitalClock.GetColorPreview (config->digitalClock .color ).c_str (), ImGuiComboFlags_HeightRegular
845
+ " ##digiClockColor" ,
846
+ DigitalClock::DigitalClock::GetColorPreview (config->digitalClock .color ).c_str (),
847
+ ImGuiComboFlags_HeightRegular
834
848
)) {
835
849
for (const auto &entry : DigitalClock::colorsDigitalClock) {
836
850
if (ImGui::Selectable (entry.first .c_str (), false )) {
0 commit comments