Skip to content

Commit 3a1ce35

Browse files
committed
- bugfixes
2 parents c550b2c + 513d4f2 commit 3a1ce35

23 files changed

+99
-55
lines changed

Telegram-Mac/ChatInputActionsView.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,12 @@ class ChatInputActionsView: View {
8181
}, for: .LongMouseDown)
8282

8383

84-
muteChannelMessages.set(handler: { [weak self] _ in
84+
muteChannelMessages.set(handler: { [weak self] control in
8585
if let chatInteraction = self?.chatInteraction {
8686
FastSettings.toggleChannelMessagesMuted(chatInteraction.peerId)
87-
(self?.superview?.superview as? View)?.updateLocalizationAndTheme(theme: theme)
87+
let isMuted = FastSettings.isChannelMessagesMuted(chatInteraction.peerId)
88+
(self?.superview?.superview as? ChatInputView)?.updatePlaceholder()
89+
tooltip(for: control, text: isMuted ? strings().messagesSilentTooltipSilent : strings().messagesSilentTooltip)
8890
}
8991
}, for: .Click)
9092

Telegram-Mac/ChatInputView.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -849,6 +849,10 @@ class ChatInputView: View, Notifable {
849849
self.textView.placeholder = textPlaceholder
850850
}
851851

852+
func updatePlaceholder() {
853+
self.textView.placeholder = textPlaceholder
854+
}
855+
852856
private func updateAccesory(animated: Bool) {
853857
self.accessory.measureSize(self.frame.width - 40.0)
854858
self.inputDidUpdateLayout(animated: animated)

Telegram-Mac/ChatListRowView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ private final class TopicNameAndTextView : View {
524524

525525

526526
var rect: NSRect
527-
rect = item.rect.insetBy(dx: -2, dy: -2)
527+
rect = item.rect.insetBy(dx: 1, dy: 1)
528528

529529
if textLayout.hasBlock {
530530
rect = rect.offsetBy(dx: 6, dy: 1)

Telegram-Mac/ChatServiceItem.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2423,7 +2423,7 @@ class ChatServiceRowView: TableRowView {
24232423
if textLayout.isBigEmoji {
24242424
rect = item.rect
24252425
} else {
2426-
rect = item.rect.insetBy(dx: -2, dy: -2)
2426+
rect = item.rect
24272427
}
24282428
if let item = self.item as? ChatServiceItem, item.isBubbled {
24292429
rect = rect.offsetBy(dx: 9, dy: 2)

Telegram-Mac/CoreExtension.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4083,7 +4083,7 @@ func concatMessageAttributes(_ attributes: [MessageTextEntity]) -> [MessageTextE
40834083

40844084
extension TelegramMediaImage {
40854085
convenience init(dimension: PixelDimensions, immediateThumbnailData: Data?) {
4086-
self.init(imageId: .init(namespace: 0, id: 0), representations: [.init(dimensions: dimension, resource: CloudFileMediaResource(datacenterId: 0, volumeId: 0, localId: 0, secret: 0, size: nil, fileReference: nil), progressiveSizes: [], immediateThumbnailData: immediateThumbnailData)], immediateThumbnailData: immediateThumbnailData, reference: nil, partialReference: nil, flags: [])
4086+
self.init(imageId: .init(namespace: 0, id: 0), representations: [.init(dimensions: dimension, resource: LocalBundleResource(name: "", ext: ""), progressiveSizes: [], immediateThumbnailData: immediateThumbnailData)], immediateThumbnailData: immediateThumbnailData, reference: nil, partialReference: nil, flags: [])
40874087

40884088
}
40894089
}

Telegram-Mac/DataAndStorageViewController.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -459,12 +459,12 @@ private func entries(state: State, data: DataAndStorageData, proxy: ProxySetting
459459
entries.append(.autoplayVideos(sectionId, autoplayMedia.videos, viewType: .lastItem))
460460

461461

462-
#if DEBUG
463-
entries.append(.sectionId(sectionId))
464-
sectionId += 1
465-
entries.append(.sensitiveContent(sectionId, false, viewType: .singleItem))
466-
entries.append(.sensitiveContentInfo(sectionId, viewType: .textBottomItem))
467-
#endif
462+
// #if DEBUG
463+
// entries.append(.sectionId(sectionId))
464+
// sectionId += 1
465+
// entries.append(.sensitiveContent(sectionId, false, viewType: .singleItem))
466+
// entries.append(.sensitiveContentInfo(sectionId, viewType: .textBottomItem))
467+
// #endif
468468

469469
entries.append(.sectionId(sectionId))
470470
sectionId += 1

Telegram-Mac/Extensions.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1849,7 +1849,11 @@ func copyToClipboard(_ input: ChatTextInputState) -> Void {
18491849

18501850
extension LAPolicy {
18511851
static var applicationPolicy: LAPolicy {
1852-
return .deviceOwnerAuthentication
1852+
if #available(macOS 10.15, *) {
1853+
return .deviceOwnerAuthenticationWithBiometricsOrWatch
1854+
} else {
1855+
return .deviceOwnerAuthentication
1856+
}
18531857
}
18541858
}
18551859

Telegram-Mac/GalleryThumbsControlView.swift

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,8 @@ class GalleryThumbContainer : Control {
123123
addSubview(overlay)
124124
overlay.backgroundColor = .black
125125
layer?.cornerRadius = .cornerRadius
126+
127+
handleScrollEventOnInteractionEnabled = false
126128
}
127129

128130
deinit {
@@ -164,9 +166,11 @@ class GalleryThumbsControlView: View {
164166

165167
documentView.backgroundColor = .clear
166168

169+
self.layer?.cornerRadius = 4
170+
167171

168-
NotificationCenter.default.addObserver(self, selector: #selector(scrollDidUpdated), name: NSView.boundsDidChangeNotification, object: scrollView.contentView)
169-
NotificationCenter.default.addObserver(self, selector: #selector(scrollDidUpdated), name: NSView.frameDidChangeNotification, object: scrollView)
172+
// NotificationCenter.default.addObserver(self, selector: #selector(scrollDidUpdated), name: NSView.boundsDidChangeNotification, object: scrollView.contentView)
173+
//NotificationCenter.default.addObserver(self, selector: #selector(scrollDidUpdated), name: NSView.frameDidChangeNotification, object: scrollView)
170174

171175
}
172176

@@ -200,7 +204,6 @@ class GalleryThumbsControlView: View {
200204

201205
previousRange = range
202206

203-
documentView.subviews = range.location == NSNotFound ? [] : items.subarray(with: range).map { $0.view }
204207
}
205208

206209
override func layout() {
@@ -312,7 +315,8 @@ class GalleryThumbsControlView: View {
312315
scrollView.clipView.scroll(to: NSMakePoint(min(max(items[selectedIndex].frame.midX - frame.width / 2, 0), max(documentView.frame.width - frame.width, 0)), 0), animated: animated && documentView.subviews.count > 0)
313316
}
314317
previousRange = nil
315-
scrollDidUpdated()
318+
documentView.subviews = items.map { $0.view }
319+
316320
}
317321

318322
}

Telegram-Mac/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
</dict>
3636
</array>
3737
<key>CFBundleVersion</key>
38-
<string>265501</string>
38+
<string>265458</string>
3939
<key>ITSAppUsesNonExemptEncryption</key>
4040
<false/>
4141
<key>LSApplicationCategoryType</key>

Telegram-Mac/PasscodeLockController.swift

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ private class TouchIdContainerView : View {
2626
button.autohighlight = false
2727
button.style = ControlStyle(font: .medium(.title), foregroundColor: theme.colors.underSelectedColor, backgroundColor: theme.colors.accent, highlightColor: theme.colors.accent)
2828
button.set(font: .medium(.title), for: .Normal)
29-
button.set(color: .white, for: .Normal)
29+
button.set(color: theme.colors.underSelectedColor, for: .Normal)
3030

3131
button.set(text: strings().passcodeUseTouchId, for: .Normal)
3232
button.set(image: theme.icons.passcodeTouchId, for: .Normal)
@@ -407,18 +407,20 @@ class PasscodeLockController: ModalViewController {
407407
}
408408
}
409409

410+
private var touchIdCalled = false
411+
410412
override func windowDidBecomeKey() {
411413
super.windowDidBecomeKey()
412414

413-
if NSApp.isActive, useTouchId {
415+
if NSApp.isActive, useTouchId, !touchIdCalled {
414416
callTouchId()
417+
touchIdCalled = true
415418
}
416419
}
417420

418421
override func windowDidResignKey() {
419422
super.windowDidResignKey()
420423
if !NSApp.isActive, useTouchId {
421-
invalidateTouchId()
422424
}
423425
}
424426

0 commit comments

Comments
 (0)