-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathMDBAlert.j
More file actions
35 lines (26 loc) · 864 Bytes
/
MDBAlert.j
File metadata and controls
35 lines (26 loc) · 864 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/*
* MDBAlert.j
_cappDevelop
Created by Bach on 2025-03-10.
*/
/**
Custom CPAlert to be make layout more pleasing when using 3 buttons.
*/
@implementation MDBAlert : CPAlert {
}
- (void) layout { //console.info("MDBAlert>layout");
[super layout];
let aestheticShift = 24;
const buttonsCount = [_buttons count];
if (buttonsCount > 4) aestheticShift += 100;
let w = [_window frame].size.width, h = [_window frame].size.height;
[_window setFrameSize: CGSizeMake(w + aestheticShift, h)]; //window a little wider
for (let i = 0; i < buttonsCount; i++) {
let button = _buttons[i]; //↓ shift all buttons a little to the right
[button setFrame: CPRectOffset([button frame], aestheticShift, 0)];
}
[_window center];
//console.info(_showHelp, _alertHelpButton)
//help button not shown???
}
@end