mirror of
https://github.com/ichmagmaus111/ghostgram.git
synced 2026-07-25 00:40:50 +02:00
chore: migrate to new version + fixed several critical bugs
- Migrated project to latest Telegram iOS base (v12.3.2+) - Fixed circular dependency between GhostModeManager and MiscSettingsManager - Fixed multiple Bazel build configuration errors (select() default conditions) - Fixed duplicate type definitions in PeerInfoScreen - Fixed swiftmodule directory resolution in build scripts - Added Ghostgram Settings tab in main Settings menu with all 5 features - Cleared sensitive credentials from config.json (template-only now) - Excluded bazel-cache from version control
This commit is contained in:
@@ -148,13 +148,13 @@ public final class GlassControlGroupComponent: Component {
|
||||
))
|
||||
case let .text(string):
|
||||
content = AnyComponent(MultilineTextComponent(
|
||||
text: .plain(NSAttributedString(string: string, font: Font.semibold(15.0), textColor: component.background == .activeTint ? component.theme.list.itemCheckColors.foregroundColor : component.theme.chat.inputPanel.panelControlColor))
|
||||
text: .plain(NSAttributedString(string: string, font: Font.medium(17.0), textColor: component.background == .activeTint ? component.theme.list.itemCheckColors.foregroundColor : component.theme.chat.inputPanel.panelControlColor))
|
||||
))
|
||||
itemInsets.left = 10.0
|
||||
itemInsets.right = itemInsets.left
|
||||
}
|
||||
|
||||
var minItemWidth: CGFloat = 40.0
|
||||
var minItemWidth: CGFloat = availableSize.height
|
||||
if component.items.count == 1 {
|
||||
minItemWidth = max(minItemWidth, component.minWidth)
|
||||
}
|
||||
@@ -163,7 +163,7 @@ public final class GlassControlGroupComponent: Component {
|
||||
transition: itemTransition,
|
||||
component: AnyComponent(PlainButtonComponent(
|
||||
content: content,
|
||||
minSize: CGSize(width: minItemWidth, height: 40.0),
|
||||
minSize: CGSize(width: minItemWidth, height: availableSize.height),
|
||||
contentInsets: itemInsets,
|
||||
action: {
|
||||
item.action?()
|
||||
@@ -186,8 +186,9 @@ public final class GlassControlGroupComponent: Component {
|
||||
itemComponentView.alpha = 0.0
|
||||
}
|
||||
itemTransition.setFrame(view: itemComponentView, frame: itemFrame)
|
||||
alphaTransition.setAlpha(view: itemComponentView, alpha: item.action != nil ? 1.0 : 0.5)
|
||||
|
||||
if animateIn {
|
||||
alphaTransition.setAlpha(view: itemComponentView, alpha: 1.0)
|
||||
alphaTransition.animateBlur(layer: itemComponentView.layer, fromRadius: 8.0, toRadius: 0.0)
|
||||
}
|
||||
}
|
||||
@@ -220,6 +221,7 @@ public final class GlassControlGroupComponent: Component {
|
||||
tintColor = .init(kind: .panel, color: component.theme.chat.inputPanel.inputBackgroundColor.withMultipliedAlpha(0.7), innerColor: component.theme.list.itemCheckColors.fillColor)
|
||||
}
|
||||
transition.setFrame(view: self.backgroundView, frame: CGRect(origin: CGPoint(), size: size))
|
||||
isInteractive = true
|
||||
self.backgroundView.update(size: size, cornerRadius: size.height * 0.5, isDark: component.theme.overallDarkAppearance, tintColor: tintColor, isInteractive: isInteractive, transition: transition)
|
||||
|
||||
return size
|
||||
|
||||
@@ -9,10 +9,12 @@ public final class GlassControlPanelComponent: Component {
|
||||
public final class Item: Equatable {
|
||||
public let items: [GlassControlGroupComponent.Item]
|
||||
public let background: GlassControlGroupComponent.Background
|
||||
public let keepWide: Bool
|
||||
|
||||
public init(items: [GlassControlGroupComponent.Item], background: GlassControlGroupComponent.Background) {
|
||||
public init(items: [GlassControlGroupComponent.Item], background: GlassControlGroupComponent.Background, keepWide: Bool = false) {
|
||||
self.items = items
|
||||
self.background = background
|
||||
self.keepWide = keepWide
|
||||
}
|
||||
|
||||
public static func ==(lhs: Item, rhs: Item) -> Bool {
|
||||
@@ -22,6 +24,9 @@ public final class GlassControlPanelComponent: Component {
|
||||
if lhs.background != rhs.background {
|
||||
return false
|
||||
}
|
||||
if lhs.keepWide != rhs.keepWide {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
}
|
||||
@@ -30,17 +35,20 @@ public final class GlassControlPanelComponent: Component {
|
||||
public let leftItem: Item?
|
||||
public let rightItem: Item?
|
||||
public let centralItem: Item?
|
||||
public let centerAlignmentIfPossible: Bool
|
||||
|
||||
public init(
|
||||
theme: PresentationTheme,
|
||||
leftItem: Item?,
|
||||
centralItem: Item?,
|
||||
rightItem: Item?
|
||||
rightItem: Item?,
|
||||
centerAlignmentIfPossible: Bool = false
|
||||
) {
|
||||
self.theme = theme
|
||||
self.leftItem = leftItem
|
||||
self.centralItem = centralItem
|
||||
self.rightItem = rightItem
|
||||
self.centerAlignmentIfPossible = centerAlignmentIfPossible
|
||||
}
|
||||
|
||||
public static func ==(lhs: GlassControlPanelComponent, rhs: GlassControlPanelComponent) -> Bool {
|
||||
@@ -56,6 +64,9 @@ public final class GlassControlPanelComponent: Component {
|
||||
if lhs.rightItem != rhs.rightItem {
|
||||
return false
|
||||
}
|
||||
if lhs.centerAlignmentIfPossible != rhs.centerAlignmentIfPossible {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -118,7 +129,7 @@ public final class GlassControlPanelComponent: Component {
|
||||
theme: component.theme,
|
||||
background: leftItem.background,
|
||||
items: leftItem.items,
|
||||
minWidth: 40.0
|
||||
minWidth: availableSize.height
|
||||
)),
|
||||
environment: {},
|
||||
containerSize: CGSize(width: availableSize.width, height: availableSize.height)
|
||||
@@ -167,7 +178,7 @@ public final class GlassControlPanelComponent: Component {
|
||||
theme: component.theme,
|
||||
background: rightItem.background,
|
||||
items: rightItem.items,
|
||||
minWidth: 40.0
|
||||
minWidth: availableSize.height
|
||||
)),
|
||||
environment: {},
|
||||
containerSize: CGSize(width: availableSize.width, height: availableSize.height)
|
||||
@@ -233,12 +244,19 @@ public final class GlassControlPanelComponent: Component {
|
||||
theme: component.theme,
|
||||
background: centralItem.background,
|
||||
items: centralItem.items,
|
||||
minWidth: 165.0
|
||||
minWidth: centralItem.keepWide ? 165.0 : availableSize.height
|
||||
)),
|
||||
environment: {},
|
||||
containerSize: maxCentralItemSize
|
||||
)
|
||||
let centralItemFrameValue = CGRect(origin: CGPoint(x: centralLeftInset + floor((availableSize.width - centralLeftInset - centralRightInset - centralItemSize.width) * 0.5), y: 0.0), size: centralItemSize)
|
||||
var centralItemFrameValue = CGRect(origin: CGPoint(x: centralLeftInset + floor((availableSize.width - centralLeftInset - centralRightInset - centralItemSize.width) * 0.5), y: 0.0), size: centralItemSize)
|
||||
if component.centerAlignmentIfPossible {
|
||||
let maxInset = max(centralLeftInset, centralRightInset)
|
||||
if availableSize.width - maxInset * 2.0 > centralItemSize.width {
|
||||
centralItemFrameValue.origin.x = maxInset + floor((availableSize.width - maxInset * 2.0 - centralItemSize.width) * 0.5)
|
||||
}
|
||||
}
|
||||
|
||||
if let centralItemComponentView = centralItemComponent.view {
|
||||
var animateIn = false
|
||||
if centralItemComponentView.superview == nil {
|
||||
|
||||
Reference in New Issue
Block a user