-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathTweak.x
73 lines (54 loc) · 1.32 KB
/
Tweak.x
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
//
// Sana.
//
// Created by Tomi Casagrande on 04/07/2020.
// Copyright © 2020 Tomi Casagrande. All rights reserved.
#import "sana.h"
%group Tweak
%hook SBElasticVolumeViewController
- (int)axis {
return 1;
}
%end
%end
%group HUDLabel
%hook SBElasticVolumeViewController
- (void)_updateLabelsForAxis:(int)arg1 containerViewSize:(CGSize)arg2 state:(long long)arg3 animated:(BOOL)arg4 {
return;
}
%end
%end
%group HUDGlyph
%hook SBElasticVolumeViewController
- (double)glyphScaleForState:(long long)arg1 {
return (glyphSize);
}
%end
%end
%group HUDAxis
%hook SBVolumeHUDSettings
- (void)setOnscreenTopMargin:(double)arg1 {
double axis = (Y);
return %orig(axis);
}
%end
%end
%group HUDWidth
%hook SBVolumeHUDSettings
- (void)setLandscapeState2Width:(double)arg1 {
double w = (width);
return %orig(w);
}
%end
%end
%ctor {
loadPreferences();
CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(), NULL, (CFNotificationCallback)loadPreferences, CFSTR("com.samoht.sana.changed"), NULL, CFNotificationSuspensionBehaviorCoalesce);
if (isEnabled) {
%init (Tweak);
if (wantsLabelHidden) %init (HUDLabel);
if (wantsGlyph) %init (HUDGlyph);
if (wantsToChangeAxis) %init (HUDAxis);
if (wantsToChangeWidth) %init (HUDWidth);
}
}