Merge 5e47a80abb0449f94174cba9f3bac197592c10c7 into 9e0194d2030306666ad814c4b653284ee2be0b9b

This commit is contained in:
Lev Poznyakov 2025-05-05 00:10:25 +03:00 committed by GitHub
commit fdb195ebc2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 15 additions and 1 deletions

View File

@ -97,6 +97,7 @@ private enum SGBoolSetting: String {
case hideChannelBottomButton
case confirmCalls
case swipeForVideoPIP
case mediaRecordingTooltip
}
private enum SGOneFromManySetting: String {
@ -255,6 +256,7 @@ private func SGControllerEntries(presentationData: PresentationData, callListSet
id.increment(10000)
entries.append(.header(id: id.count, section: .other, text: presentationData.strings.Appearance_Other.uppercased(), badge: nil))
entries.append(.toggle(id: id.count, section: .other, settingName: .mediaRecordingTooltip, value: SGSimpleSettings.shared.mediaRecordingTooltip, text: i18n("Settings.mediaRecordingTooltip", lang), enabled: true))
entries.append(.toggle(id: id.count, section: .other, settingName: .swipeForVideoPIP, value: SGSimpleSettings.shared.videoPIPSwipeDirection == SGSimpleSettings.VideoPIPSwipeDirection.up.rawValue, text: i18n("Settings.swipeForVideoPIP", lang), enabled: true))
entries.append(.notice(id: id.count, section: .other, text: i18n("Settings.swipeForVideoPIP.Notice", lang)))
entries.append(.toggle(id: id.count, section: .other, settingName: .hideChannelBottomButton, value: !SGSimpleSettings.shared.hideChannelBottomButton, text: i18n("Settings.showChannelBottomButton", lang), enabled: true))
@ -473,6 +475,8 @@ public func sgSettingsController(context: AccountContext/*, focusOnItemTag: Int?
SGSimpleSettings.shared.confirmCalls = value
case .swipeForVideoPIP:
SGSimpleSettings.shared.videoPIPSwipeDirection = value ? SGSimpleSettings.VideoPIPSwipeDirection.up.rawValue : SGSimpleSettings.VideoPIPSwipeDirection.none.rawValue
case .mediaRecordingTooltip:
SGSimpleSettings.shared.mediaRecordingTooltip = value
}
}, updateSliderValue: { setting, value in
switch (setting) {

View File

@ -132,6 +132,7 @@ public class SGSimpleSettings {
case status
case dismissedSGSuggestions
case duckyAppIconAvailable
case mediaRecordingTooltip
}
public enum DownloadSpeedBoostValues: String, CaseIterable {
@ -246,7 +247,8 @@ public class SGSimpleSettings {
Keys.inputToolbar.rawValue: false,
Keys.primaryUserId.rawValue: "",
Keys.dismissedSGSuggestions.rawValue: [],
Keys.duckyAppIconAvailable.rawValue: true
Keys.duckyAppIconAvailable.rawValue: true,
Keys.mediaRecordingTooltip.rawValue: true,
]
public static let groupDefaultValues: [String: Any] = [
@ -463,6 +465,9 @@ public class SGSimpleSettings {
@UserDefault(key: Keys.duckyAppIconAvailable.rawValue)
public var duckyAppIconAvailable: Bool
@UserDefault(key: Keys.mediaRecordingTooltip.rawValue)
public var mediaRecordingTooltip: Bool
}
extension SGSimpleSettings {

View File

@ -155,6 +155,8 @@
"Settings.swipeForVideoPIP" = "Video PIP with Swipe";
"Settings.swipeForVideoPIP.Notice" = "If enabled, swiping video will open it in Picture-in-Picture mode.";
"Settings.mediaRecordingTooltip" = "Media Recording Tooltip";
"SessionBackup.Title" = "Accounts Backup";
"SessionBackup.Sessions.Title" = "Sessions";
"SessionBackup.Actions.Backup" = "Backup to Keychain";

View File

@ -10401,6 +10401,9 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
}
func displayMediaRecordingTooltip() {
// MARK: Swiftgram
guard SGSimpleSettings.shared.mediaRecordingTooltip else { return }
guard let peer = self.presentationInterfaceState.renderedPeer?.peer else {
return
}