From f7ddfb82fe2c649b4f790c70f0ca25ae6651bfee Mon Sep 17 00:00:00 2001 From: Kylmakalle Date: Sat, 15 Nov 2025 00:56:22 +0200 Subject: [PATCH] FIx Apple folders size --- Swiftgram/AppleStyleFolders/Sources/File.swift | 4 ++-- .../SGSettingsUI/Sources/SGSettingsController.swift | 11 +++++++++-- .../SGSimpleSettings/Sources/SimpleSettings.swift | 10 ++++++++-- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/Swiftgram/AppleStyleFolders/Sources/File.swift b/Swiftgram/AppleStyleFolders/Sources/File.swift index c2ef2cb59e..536250e061 100644 --- a/Swiftgram/AppleStyleFolders/Sources/File.swift +++ b/Swiftgram/AppleStyleFolders/Sources/File.swift @@ -234,8 +234,8 @@ private final class ItemNode: ASDisplayNode { self.shortTitleNode.visibility = title.enableAnimations if themeUpdated || titleUpdated { - self.titleNode.attributedText = title.attributedString(font: Font.bold(17.0), textColor: isSelected ? presentationData.theme.contextMenu.badgeForegroundColor : presentationData.theme.list.itemSecondaryTextColor) - self.shortTitleNode.attributedText = shortTitle.attributedString(font: Font.bold(17.0), textColor: isSelected ? presentationData.theme.contextMenu.badgeForegroundColor : presentationData.theme.list.itemSecondaryTextColor) + self.titleNode.attributedText = title.attributedString(font: Font.medium(14.0), textColor: isSelected ? presentationData.theme.contextMenu.badgeForegroundColor : presentationData.theme.list.itemSecondaryTextColor) + self.shortTitleNode.attributedText = shortTitle.attributedString(font: Font.medium(14.0), textColor: isSelected ? presentationData.theme.contextMenu.badgeForegroundColor : presentationData.theme.list.itemSecondaryTextColor) } // diff --git a/Swiftgram/SGSettingsUI/Sources/SGSettingsController.swift b/Swiftgram/SGSettingsUI/Sources/SGSettingsController.swift index cc2f83397d..0f14321f09 100644 --- a/Swiftgram/SGSettingsUI/Sources/SGSettingsController.swift +++ b/Swiftgram/SGSettingsUI/Sources/SGSettingsController.swift @@ -157,12 +157,19 @@ private func SGControllerEntries(presentationData: PresentationData, callListSet entries.append(.header(id: id.count, section: .folders, text: strings.Settings_ChatFolders.uppercased(), badge: nil)) entries.append(.toggle(id: id.count, section: .folders, settingName: .foldersAtBottom, value: experimentalUISettings.foldersTabAtBottom, text: i18n("Settings.Folders.BottomTab", lang), enabled: true)) - entries.append(.oneFromManySelector(id: id.count, section: .folders, settingName: .bottomTabStyle, text: i18n("Settings.Folders.BottomTabStyle", lang), value: i18n("Settings.Folders.BottomTabStyle.\(SGSimpleSettings.shared.bottomTabStyle)", lang), enabled: experimentalUISettings.foldersTabAtBottom)) + // Disabled while Telegram is migrating to Glass +// entries.append(.oneFromManySelector(id: id.count, section: .folders, settingName: .bottomTabStyle, text: i18n("Settings.Folders.BottomTabStyle", lang), value: i18n("Settings.Folders.BottomTabStyle.\(SGSimpleSettings.shared.bottomTabStyle)", lang), enabled: experimentalUISettings.foldersTabAtBottom)) entries.append(.toggle(id: id.count, section: .folders, settingName: .allChatsHidden, value: SGSimpleSettings.shared.allChatsHidden, text: i18n("Settings.Folders.AllChatsHidden", lang, strings.ChatList_Tabs_AllChats), enabled: true)) #if DEBUG // entries.append(.oneFromManySelector(id: id.count, section: .folders, settingName: .allChatsFolderPositionOverride, text: i18n("Settings.Folders.AllChatsPlacement", lang), value: i18n("Settings.Folders.AllChatsPlacement.\(SGSimpleSettings.shared.allChatsFolderPositionOverride)", lang), enabled: true)) #endif - entries.append(.toggle(id: id.count, section: .folders, settingName: .compactFolderNames, value: SGSimpleSettings.shared.compactFolderNames, text: i18n("Settings.Folders.CompactNames", lang), enabled: SGSimpleSettings.shared.bottomTabStyle != SGSimpleSettings.BottomTabStyleValues.ios.rawValue)) + let compactFolderNamesEditable: Bool + if experimentalUISettings.foldersTabAtBottom { + compactFolderNamesEditable = SGSimpleSettings.shared.bottomTabStyle != SGSimpleSettings.BottomTabStyleValues.ios.rawValue + } else { + compactFolderNamesEditable = true + } + entries.append(.toggle(id: id.count, section: .folders, settingName: .compactFolderNames, value: SGSimpleSettings.shared.compactFolderNames, text: i18n("Settings.Folders.CompactNames", lang), enabled: compactFolderNamesEditable)) entries.append(.oneFromManySelector(id: id.count, section: .folders, settingName: .allChatsTitleLengthOverride, text: i18n("Settings.Folders.AllChatsTitle", lang), value: i18n("Settings.Folders.AllChatsTitle.\(SGSimpleSettings.shared.allChatsTitleLengthOverride)", lang), enabled: true)) entries.append(.toggle(id: id.count, section: .folders, settingName: .rememberLastFolder, value: SGSimpleSettings.shared.rememberLastFolder, text: i18n("Settings.Folders.RememberLast", lang), enabled: true)) entries.append(.notice(id: id.count, section: .folders, text: i18n("Settings.Folders.RememberLast.Notice", lang))) diff --git a/Swiftgram/SGSimpleSettings/Sources/SimpleSettings.swift b/Swiftgram/SGSimpleSettings/Sources/SimpleSettings.swift index 499ad957f6..220d357d72 100644 --- a/Swiftgram/SGSimpleSettings/Sources/SimpleSettings.swift +++ b/Swiftgram/SGSimpleSettings/Sources/SimpleSettings.swift @@ -313,8 +313,14 @@ public class SGSimpleSettings { @UserDefault(key: Keys.rememberLastFolder.rawValue) public var rememberLastFolder: Bool - @UserDefault(key: Keys.bottomTabStyle.rawValue) - public var bottomTabStyle: String + // Disabled while Telegram is migrating to Glass + // @UserDefault(key: Keys.bottomTabStyle.rawValue) + public var bottomTabStyle: String { + set {} + get { + return BottomTabStyleValues.ios.rawValue + } + } public var lastAccountFolders = UserDefaultsBackedDictionary(userDefaultsKey: Keys.lastAccountFolders.rawValue, threadSafe: false)