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

Function GetDefaultWindowRect

src/ProjectWindow.cpp:111–152  ·  view source on GitHub ↗

BG: The default size and position of the first window

Source from the content-addressed store, hash-verified

109
110// BG: The default size and position of the first window
111void GetDefaultWindowRect(wxRect *defRect)
112{
113 *defRect = wxGetClientDisplayRect();
114
115 int width = DEFAULT_WINDOW_WIDTH;
116 int height = DEFAULT_WINDOW_HEIGHT;
117
118 //These conditional values assist in improving placement and size
119 //of NEW windows on different platforms.
120#ifdef __WXGTK__
121 height += 20;
122#endif
123
124#ifdef __WXMSW__
125 height += 40;
126#endif
127
128#ifdef __WXMAC__
129 height += 55;
130#endif
131
132 // Use screen size where it is smaller than the values we would like.
133 // Otherwise use the values we would like, and centred.
134 if (width < defRect->width)
135 {
136 defRect->x = (defRect->width - width)/2;
137 defRect->width = width;
138 }
139
140 if (height < defRect->height)
141 {
142 defRect->y = (defRect->height - height)/2;
143 // Bug 1119 workaround
144 // Small adjustment for very small Mac screens.
145 // If there is only a tiny space at the top
146 // then instead of vertical centre, align to bottom.
147 const int pixelsFormenu = 60;
148 if( defRect->y < pixelsFormenu )
149 defRect->y *=2;
150 defRect->height = height;
151 }
152}
153
154// BG: Calculate where to place the next window (could be the first window)
155// BG: Does not store X and Y in prefs. This is intentional.

Callers 3

GetNextWindowPlacementFunction · 0.85
SetToDefaultSizeMethod · 0.85
SaveWindowSizeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected