Fix width of statuses waterfall view

This commit is contained in:
Marcin Czachurski 2023-09-27 15:43:00 +02:00
parent 221e128303
commit b43e203721
4 changed files with 22 additions and 17 deletions

View File

@ -1321,7 +1321,7 @@
CODE_SIGN_ENTITLEMENTS = VernissageWidget/VernissageWidgetExtension.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 213;
CURRENT_PROJECT_VERSION = 214;
DEVELOPMENT_TEAM = B2U9FEKYP8;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = VernissageWidget/Info.plist;
@ -1352,7 +1352,7 @@
ASSETCATALOG_COMPILER_WIDGET_BACKGROUND_COLOR_NAME = WidgetBackground;
CODE_SIGN_ENTITLEMENTS = VernissageWidget/VernissageWidgetExtension.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 213;
CURRENT_PROJECT_VERSION = 214;
DEVELOPMENT_TEAM = B2U9FEKYP8;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = VernissageWidget/Info.plist;
@ -1382,7 +1382,7 @@
CODE_SIGN_ENTITLEMENTS = VernissageShare/VernissageShareExtension.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 213;
CURRENT_PROJECT_VERSION = 214;
DEVELOPMENT_TEAM = B2U9FEKYP8;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = VernissageShare/Info.plist;
@ -1411,7 +1411,7 @@
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = NO;
CODE_SIGN_ENTITLEMENTS = VernissageShare/VernissageShareExtension.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 213;
CURRENT_PROJECT_VERSION = 214;
DEVELOPMENT_TEAM = B2U9FEKYP8;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = VernissageShare/Info.plist;
@ -1565,7 +1565,7 @@
CODE_SIGN_ENTITLEMENTS = Vernissage/Vernissage.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 213;
CURRENT_PROJECT_VERSION = 214;
DEVELOPMENT_ASSET_PATHS = "\"Vernissage/Preview Content\"";
DEVELOPMENT_TEAM = B2U9FEKYP8;
ENABLE_PREVIEWS = YES;
@ -1608,7 +1608,7 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ENTITLEMENTS = Vernissage/Vernissage.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 213;
CURRENT_PROJECT_VERSION = 214;
DEVELOPMENT_ASSET_PATHS = "\"Vernissage/Preview Content\"";
DEVELOPMENT_TEAM = B2U9FEKYP8;
ENABLE_PREVIEWS = YES;

View File

@ -20,7 +20,7 @@ private struct NavigationMenuButtons: ViewModifier {
@EnvironmentObject var routerPath: RouterPath
private let onViewModeIconTap: (MainView.ViewMode) -> Void
private let imageFontSize = 20.0
private let imageFontSize = UIDevice.isIPad ? 30.0 : 20.0
private let customMenuItems = [
NavigationMenuItemDetails(viewMode: .home),
@ -88,22 +88,22 @@ private struct NavigationMenuButtons: ViewModifier {
self.contextMenuView()
self.customMenuItemsView()
}
.frame(height: 50)
.padding(.horizontal, 8)
.frame(height: UIDevice.isIPad ? 64 : 50)
.padding(.horizontal, UIDevice.isIPad ? 16 : 8)
.background(.ultraThinMaterial)
.clipShape(Capsule())
self.composeImageView()
.frame(height: 50)
.padding(.horizontal, 8)
.frame(height: UIDevice.isIPad ? 64 : 50)
.padding(.horizontal, UIDevice.isIPad ? 16 : 8)
.background(.ultraThinMaterial)
.clipShape(Circle())
}
} else {
HStack(alignment: .center) {
self.composeImageView()
.frame(height: 50)
.padding(.horizontal, 8)
.frame(height: UIDevice.isIPad ? 64 : 50)
.padding(.horizontal, UIDevice.isIPad ? 16 : 8)
.background(.ultraThinMaterial)
.clipShape(Circle())
@ -111,8 +111,8 @@ private struct NavigationMenuButtons: ViewModifier {
self.customMenuItemsView()
self.contextMenuView()
}
.frame(height: 50)
.padding(.horizontal, 8)
.frame(height: UIDevice.isIPad ? 64 : 50)
.padding(.horizontal, UIDevice.isIPad ? 16 : 8)
.background(.ultraThinMaterial)
.clipShape(Capsule())
}
@ -128,6 +128,7 @@ private struct NavigationMenuButtons: ViewModifier {
} label: {
Image(systemName: "ellipsis")
.font(.system(size: self.imageFontSize))
.fontWeight(UIDevice.isIPad ? .light : .regular)
.foregroundColor(.mainTextColor.opacity(0.75))
.padding(.vertical, 10)
.padding(.horizontal, 8)
@ -149,6 +150,7 @@ private struct NavigationMenuButtons: ViewModifier {
} label: {
Image(systemName: "plus")
.font(.system(size: self.imageFontSize))
.fontWeight(UIDevice.isIPad ? .light : .regular)
.foregroundColor(.mainTextColor.opacity(0.75))
.padding(.vertical, 10)
.padding(.horizontal, 8)
@ -162,6 +164,7 @@ private struct NavigationMenuButtons: ViewModifier {
} label: {
Image(systemName: displayedCustomMenuItem.image)
.font(.system(size: self.imageFontSize))
.fontWeight(UIDevice.isIPad ? .light : .regular)
.foregroundColor(.mainTextColor.opacity(0.75))
.padding(.vertical, 10)
.padding(.horizontal, 8)

View File

@ -23,7 +23,7 @@ struct WaterfallGrid<Data, ID, Content>: View where Data: RandomAccessCollection
private let semaphore = AsyncSemaphore(value: 1)
var body: some View {
HStack(alignment: .top, spacing: 20) {
HStack(alignment: .top, spacing: 8) {
ForEach(self.columnsData, id: \.id) { columnData in
LazyVStack(spacing: 8) {
ForEach(columnData.data, id: \.id) { item in

View File

@ -35,6 +35,7 @@ struct DeviceImageGallery: ViewModifier {
@Environment(\.horizontalSizeClass) var horizontalSizeClass: UserInterfaceSizeClass?
let action: (GalleryProperties) -> Void
let imageSpacing = 8
func body(content: Content) -> some View {
GeometryReader { geometry in
@ -69,9 +70,10 @@ struct DeviceImageGallery: ViewModifier {
} else {
// View like on iPad.
let imageColumns = geometry.size.width > geometry.size.height ? 3 : 2
let marginSpacing = self.imageSpacing * (imageColumns - 1)
return GalleryProperties(imageColumns: imageColumns,
containerWidth: geometry.size.width / Double(imageColumns),
containerWidth: (geometry.size.width - Double(marginSpacing)) / Double(imageColumns),
containerHeight: geometry.size.height / Double(imageColumns))
}
}