MCPcopy Create free account
hub / github.com/LemonOSProject/LemonOS / UpdateWindowSize

Function UpdateWindowSize

Applications/Minesweeper/main.cpp:260–267  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

258Lemon::GUI::WindowMenu gameMenu = {{"Game"}, {{MenuEasy, "Play Easy"}, {MenuMedium, "Play Medium"}, {MenuHard, "Play Hard"}}};
259
260void UpdateWindowSize(){ // Update window size according to the map size
261 vector2i_t mapSize = difficultySizes[game.GetDifficulty()];
262
263 mapSize.x *= 16;
264 mapSize.y = (mapSize.y * 16) + window->rootContainer.GetFixedBounds().y; // Account for menu bar
265
266 window->Resize(mapSize);
267}
268
269int main(int argc, char** argv){
270 window = new Lemon::GUI::Window("Minesweeper", {160, 160}, 0, Lemon::GUI::GUI);

Callers 1

mainFunction · 0.85

Calls 3

GetDifficultyMethod · 0.80
GetFixedBoundsMethod · 0.80
ResizeMethod · 0.45

Tested by

no test coverage detected