MCPcopy Create free account
hub / github.com/audacity/audacity / Populate

Method Populate

src/WhatsNewDialog.cpp:137–331  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

135}
136
137void WhatsNewDialog::Populate(ShuttleGui& S)
138{
139 bool showSplashScreen;
140 gPrefs->Read(wxT("/GUI/ShowSplashScreen"), &showSplashScreen, true );
141
142#if defined (__WXOSX__) || defined(__WXMSW__)
143 const int width = 572;
144 const int height = 322;
145#else
146 const int width = FromDIP(572);
147 const int height = FromDIP(322);
148#endif
149
150 std::vector<CarouselSnapshot> snapshots;
151 snapshots.reserve(5);
152
153 // Render bitmaps at physical-pixel size so they stay sharp on HiDPI/Retina,
154 // and tag them with the matching scale factor so wx lays them out using the
155 // intended logical size (width x height points), not the physical size.
156 //
157 // Skipped on Windows: in wx 3.1.3 the MSW wxBitmap ignores the scale factor
158 // (see msw/bitmap.h: WXUNUSED(scale), GetScaleFactor() hardcoded to 1.0).
159 // Multiplying the rescale target by GetContentScaleFactor() there would just
160 // produce an oversized bitmap drawn at its physical size, making the image
161 // bigger than the carousel slot and the surrounding buttons look smaller
162 // in relation.
163#if defined(__WXMSW__)
164 const double scale = 1.0;
165#else
166 const double scale = GetContentScaleFactor();
167#endif
168 auto makeBitmap = [&](const unsigned char* data, size_t len) {
169 wxImage img = LoadEmbeddedImage(data, len);
170 img = Rescale(img,
171 static_cast<int>(width * scale),
172 static_cast<int>(height * scale));
173 img = RoundedImage(img, 12);
174 return wxBitmap(img, -1, scale);
175 };
176
177 snapshots.push_back(CarouselSnapshot(
178 XXO("Try the new Audacity 4 Beta release"),
179 makeBitmap(Audacity4Release_png, Audacity4Release_png_len),
180 BetaURL,
181 XXO("Test the Beta release"),
182 XXO("")
183 ));
184
185 if (ModuleManager::Get().CheckModuleLoaded("mod-cloud-audiocom")) {
186
187 auto displayLoginDialog = []() {
188 CloudLoginHelper::Get().ShowLoginDialog();
189 };
190
191 const bool dark = theTheme.IsUsingDarkAppearance();
192 const unsigned char* audioDotComData = dark
193 ? AudioDotComPromoDark_png
194 : AudioDotComPromoLight_png;

Callers

nothing calls this directly

Calls 15

RoundedImageFunction · 0.85
CarouselSnapshotClass · 0.85
GetFunction · 0.85
NotFocusableWindowClass · 0.85
CheckModuleLoadedMethod · 0.80
GetEffectsMethod · 0.80
AddWindowMethod · 0.80
PositionMethod · 0.80
SetBackgroundColourMethod · 0.80
StartPanelMethod · 0.80
AddCheckBoxMethod · 0.80
EndPanelMethod · 0.80

Tested by

no test coverage detected