Skip to content

Commit 704558b

Browse files
committed
fix story media
1 parent b5d1906 commit 704558b

File tree

3 files changed

+25
-23
lines changed

3 files changed

+25
-23
lines changed

Telegram-Mac/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
</dict>
3434
</array>
3535
<key>CFBundleVersion</key>
36-
<string>274202</string>
36+
<string>274207</string>
3737
<key>ITSAppUsesNonExemptEncryption</key>
3838
<false/>
3939
<key>LSApplicationCategoryType</key>

Telegram-Mac/StoryMediaController.swift

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ private final class CollectionRowItem : TableStickItem {
180180
}
181181

182182
override var height: CGFloat {
183-
return 40
183+
return 50
184184
}
185185

186186
override func viewClass() -> AnyClass {
@@ -274,7 +274,7 @@ private final class CollectionFilterRowView : TableStickView, TableViewDelegate
274274
if tableView.listHeight < bounds.width {
275275
tableView.frame = focus(NSMakeSize(tableView.listHeight, 40))
276276
} else {
277-
tableView.frame = focus(NSMakeSize(frame.width, 40))
277+
tableView.frame = focus(NSMakeSize(bounds.width, 40))
278278
}
279279
}
280280
}
@@ -496,11 +496,11 @@ private func entries(_ state: State, arguments: Arguments) -> [Entry] {
496496

497497
if !arguments.standalone, !state.collections.isEmpty {
498498

499-
entries.append(.section(index: index, height: 10))
499+
entries.append(.section(index: index, height: 0))
500500
index = index.peerLocalSuccessor()
501501
entries.append(.collections(index: index, state.collections, state.selectedCollection))
502-
index = index.peerLocalSuccessor()
503-
entries.append(.section(index: index, height: 10))
502+
// index = index.peerLocalSuccessor()
503+
// entries.append(.section(index: index, height: 0))
504504

505505
hasFolders = true
506506
}
@@ -528,8 +528,8 @@ private func entries(_ state: State, arguments: Arguments) -> [Entry] {
528528
index = index.peerLocalPredecessor()
529529
} else {
530530
// if !hasFolders {
531-
entries.append(.section(index: index, height: 20))
532-
index = index.peerLocalSuccessor()
531+
// entries.append(.section(index: index, height: 20))
532+
// index = index.peerLocalSuccessor()
533533
// }
534534
}
535535

@@ -596,7 +596,13 @@ fileprivate func prepareTransition(left:[AppearanceWrapperEntry<Entry>], right:
596596

597597
final class StoryMediaView : View {
598598

599-
599+
fileprivate var willMove: ((NSWindow?)->Void)? = nil
600+
601+
override func viewWillMove(toWindow newWindow: NSWindow?) {
602+
super.viewWillMove(toWindow: newWindow)
603+
604+
self.willMove?(newWindow)
605+
}
600606

601607
private class Panel : View {
602608
private var pin = TextButton()
@@ -1072,6 +1078,14 @@ final class StoryMediaController : TelegramGenericViewController<StoryMediaView>
10721078

10731079
})
10741080

1081+
genericView.willMove = { [weak self] window in
1082+
self?.updateState { current in
1083+
var current = current
1084+
current.onStage = window != nil
1085+
return current
1086+
}
1087+
}
1088+
10751089
let context = self.context
10761090
let peerId = self.peerId
10771091
let initialSize = self.atomicSize
@@ -1494,23 +1508,11 @@ final class StoryMediaController : TelegramGenericViewController<StoryMediaView>
14941508
}
14951509

14961510
override func viewWillDisappear(_ animated: Bool) {
1497-
super.viewWillDisappear(animated)
1498-
1499-
self.updateState { current in
1500-
var current = current
1501-
current.onStage = false
1502-
return current
1503-
}
1511+
super.viewWillDisappear(animated)
15041512
}
15051513

15061514
override func viewWillAppear(_ animated: Bool) {
15071515
super.viewWillAppear(animated)
1508-
1509-
self.updateState { current in
1510-
var current = current
1511-
current.onStage = true
1512-
return current
1513-
}
15141516
}
15151517

15161518
deinit {

TelegramShare/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<key>CFBundleShortVersionString</key>
2222
<string>$(MARKETING_VERSION)</string>
2323
<key>CFBundleVersion</key>
24-
<string>274202</string>
24+
<string>274207</string>
2525
<key>ITSAppUsesNonExemptEncryption</key>
2626
<false/>
2727
<key>LSMinimumSystemVersion</key>

0 commit comments

Comments
 (0)