Skip to content

Commit f26f4ae

Browse files
author
overtake
committed
no message
1 parent d146085 commit f26f4ae

File tree

52 files changed

+2910
-113
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+2910
-113
lines changed

‎Telegram-Mac.xcworkspace/contents.xcworkspacedata

+3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Telegram-Mac/AccountContext.swift

+3-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ final class AccountContextBindings {
5151
let needFullsize:()->Void
5252
let displayUpgradeProgress:(CGFloat)->Void
5353
let callSession: ()->PCallSession?
54-
init(rootNavigation: @escaping() -> MajorNavigationController = { fatalError() }, mainController: @escaping() -> MainViewController = { fatalError() }, showControllerToaster: @escaping(ControllerToaster, Bool) -> Void = { _, _ in fatalError() }, globalSearch: @escaping(String) -> Void = { _ in fatalError() }, entertainment: @escaping()->EntertainmentViewController = { fatalError() }, switchSplitLayout: @escaping(SplitViewState)->Void = { _ in fatalError() }, needFullsize: @escaping() -> Void = { fatalError() }, displayUpgradeProgress: @escaping(CGFloat)->Void = { _ in fatalError() }, callSession: @escaping()->PCallSession? = { fatalError() }) {
54+
let groupCall: ()->GroupCallContext?
55+
init(rootNavigation: @escaping() -> MajorNavigationController = { fatalError() }, mainController: @escaping() -> MainViewController = { fatalError() }, showControllerToaster: @escaping(ControllerToaster, Bool) -> Void = { _, _ in fatalError() }, globalSearch: @escaping(String) -> Void = { _ in fatalError() }, entertainment: @escaping()->EntertainmentViewController = { fatalError() }, switchSplitLayout: @escaping(SplitViewState)->Void = { _ in fatalError() }, needFullsize: @escaping() -> Void = { fatalError() }, displayUpgradeProgress: @escaping(CGFloat)->Void = { _ in fatalError() }, callSession: @escaping()->PCallSession? = { fatalError() }, groupCall: @escaping()->GroupCallContext? = { fatalError() }) {
5556
self.rootNavigation = rootNavigation
5657
self.mainController = mainController
5758
self.showControllerToaster = showControllerToaster
@@ -61,6 +62,7 @@ final class AccountContextBindings {
6162
self.needFullsize = needFullsize
6263
self.displayUpgradeProgress = displayUpgradeProgress
6364
self.callSession = callSession
65+
self.groupCall = groupCall
6466
}
6567
#endif
6668
}

‎Telegram-Mac/AppDelegate.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,7 @@ class AppDelegate: NSResponder, NSApplicationDelegate, NSUserNotificationCenterD
579579
// let tonContext = StoredTonContext(basePath: account.basePath, postbox: account.postbox, network: account.network, keychain: tonKeychain)
580580

581581
let context = AccountContext(sharedContext: sharedApplicationContext.sharedContext, window: window, account: account)
582-
return AuthorizedApplicationContext(window: window, context: context, launchSettings: settings ?? LaunchSettings.defaultSettings, callSession: sharedContext.getCrossAccountCallSession())
582+
return AuthorizedApplicationContext(window: window, context: context, launchSettings: settings ?? LaunchSettings.defaultSettings, callSession: sharedContext.getCrossAccountCallSession(), groupCallContext: sharedContext.getCrossAccountGroupCall())
583583

584584
} else {
585585
return nil

‎Telegram-Mac/ApplicationContext.swift

+8-2
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ final class AuthorizedApplicationContext: NSObject, SplitViewDelegate {
186186

187187
private var launchAction: ApplicationContextLaunchAction?
188188

189-
init(window: Window, context: AccountContext, launchSettings: LaunchSettings, callSession: PCallSession?) {
189+
init(window: Window, context: AccountContext, launchSettings: LaunchSettings, callSession: PCallSession?, groupCallContext: GroupCallContext?) {
190190

191191
self.context = context
192192
emptyController = EmptyChatViewController(context)
@@ -217,7 +217,7 @@ final class AuthorizedApplicationContext: NSObject, SplitViewDelegate {
217217

218218

219219
rightController.set(callHeader: CallNavigationHeader(35, initializer: { header -> NavigationHeaderView in
220-
let view = CallNavigationHeaderView(header)
220+
let view = GroupCallNavigationHeaderView(header)
221221
return view
222222
}))
223223

@@ -276,6 +276,8 @@ final class AuthorizedApplicationContext: NSObject, SplitViewDelegate {
276276

277277
}, callSession: { [weak self] in
278278
return (self?.rightController.callHeader?.view as? CallNavigationHeaderView)?.session
279+
}, groupCall: { [weak self] in
280+
return (self?.rightController.callHeader?.view as? GroupCallNavigationHeaderView)?.context
279281
})
280282

281283

@@ -675,6 +677,10 @@ final class AuthorizedApplicationContext: NSObject, SplitViewDelegate {
675677
context.sharedContext.showCallHeader(with: session)
676678
}
677679

680+
if let groupCallContext = groupCallContext {
681+
context.sharedContext.showGroupCall(with: groupCallContext)
682+
}
683+
678684
self.updateFoldersDisposable.set(combineLatest(queue: .mainQueue(), chatListFilterPreferences(postbox: context.account.postbox), context.sharedContext.layoutHandler.get()).start(next: { [weak self] value, layout in
679685
self?.updateLeftSidebar(with: value, layout: layout, animated: true)
680686
}))
+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"info" : {
3-
"version" : 1,
4-
"author" : "xcode"
3+
"author" : "xcode",
4+
"version" : 1
55
}
6-
}
6+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"images" : [
3+
{
4+
"filename" : "ic_decline.png",
5+
"idiom" : "universal",
6+
"scale" : "1x"
7+
},
8+
{
9+
"filename" : "ic_decline@2x.png",
10+
"idiom" : "universal",
11+
"scale" : "2x"
12+
},
13+
{
14+
"idiom" : "universal",
15+
"scale" : "3x"
16+
}
17+
],
18+
"info" : {
19+
"author" : "xcode",
20+
"version" : 1
21+
}
22+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"images" : [
3+
{
4+
"filename" : "ic_invite.png",
5+
"idiom" : "universal",
6+
"scale" : "1x"
7+
},
8+
{
9+
"filename" : "ic_invite@2x.png",
10+
"idiom" : "universal",
11+
"scale" : "2x"
12+
},
13+
{
14+
"idiom" : "universal",
15+
"scale" : "3x"
16+
}
17+
],
18+
"info" : {
19+
"author" : "xcode",
20+
"version" : 1
21+
}
22+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"images" : [
3+
{
4+
"filename" : "ic_invited.png",
5+
"idiom" : "universal",
6+
"scale" : "1x"
7+
},
8+
{
9+
"filename" : "ic_invited@2x.png",
10+
"idiom" : "universal",
11+
"scale" : "2x"
12+
},
13+
{
14+
"idiom" : "universal",
15+
"scale" : "3x"
16+
}
17+
],
18+
"info" : {
19+
"author" : "xcode",
20+
"version" : 1
21+
}
22+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"images" : [
3+
{
4+
"filename" : "ic_settings.png",
5+
"idiom" : "universal",
6+
"scale" : "1x"
7+
},
8+
{
9+
"filename" : "ic_settings@2x.png",
10+
"idiom" : "universal",
11+
"scale" : "2x"
12+
},
13+
{
14+
"idiom" : "universal",
15+
"scale" : "3x"
16+
}
17+
],
18+
"info" : {
19+
"author" : "xcode",
20+
"version" : 1
21+
}
22+
}

‎Telegram-Mac/CallControl.swift

+6-1
Original file line numberDiff line numberDiff line change
@@ -76,17 +76,22 @@ final class CallControl : Control {
7676
override var mouseDownCanMoveWindow: Bool {
7777
return false
7878
}
79+
private var previousState: ControlState?
7980

8081
override func stateDidUpdated( _ state: ControlState) {
81-
8282
switch controlState {
8383
case .Highlight:
8484
imageBackgroundView?._change(opacity: 0.9)
8585
textView.change(opacity: 0.9)
86+
imageBackgroundView?.layer?.animateScaleCenter(from: 1, to: 0.95, duration: 0.2, removeOnCompletion: false)
8687
default:
8788
imageBackgroundView?._change(opacity: 1.0)
8889
textView.change(opacity: 1.0)
90+
if let previousState = previousState, previousState == .Highlight {
91+
imageBackgroundView?.layer?.animateScaleCenter(from: 0.95, to: 1.0, duration: 0.2)
92+
}
8993
}
94+
previousState = state
9095
}
9196

9297
func updateEnabled(_ enabled: Bool, animated: Bool) {

0 commit comments

Comments
 (0)