Pad item info text when view is horizontal

This commit is contained in:
Shav Kinderlehrer 2023-12-27 13:37:21 -05:00
parent b7a1bd1d55
commit a271314f15
5 changed files with 63 additions and 9 deletions

View File

@ -19,6 +19,7 @@
3D16FC3C2B2CDFB500E6D8B3 /* DashboardLibraryView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D16FC3B2B2CDFB500E6D8B3 /* DashboardLibraryView.swift */; };
3D41D1F52B2C962500E58234 /* AppearancePicker.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D41D1F42B2C962500E58234 /* AppearancePicker.swift */; };
3D41D1FA2B2CAE0000E58234 /* LibraryIconView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D41D1F92B2CAE0000E58234 /* LibraryIconView.swift */; };
3D4C15722B3CAA670035373E /* DashboardSectionTitleView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D4C15712B3CAA670035373E /* DashboardSectionTitleView.swift */; };
3D7709392B29139700199889 /* Pulse in Frameworks */ = {isa = PBXBuildFile; productRef = 3D7709382B29139700199889 /* Pulse */; };
3D77093B2B29139700199889 /* PulseUI in Frameworks */ = {isa = PBXBuildFile; productRef = 3D77093A2B29139700199889 /* PulseUI */; };
3D8AB2A52B36440D005BD7D0 /* BlurHashDecode.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8AB2A42B36440D005BD7D0 /* BlurHashDecode.swift */; };
@ -86,6 +87,7 @@
3D16FC3B2B2CDFB500E6D8B3 /* DashboardLibraryView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DashboardLibraryView.swift; sourceTree = "<group>"; };
3D41D1F42B2C962500E58234 /* AppearancePicker.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppearancePicker.swift; sourceTree = "<group>"; };
3D41D1F92B2CAE0000E58234 /* LibraryIconView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LibraryIconView.swift; sourceTree = "<group>"; };
3D4C15712B3CAA670035373E /* DashboardSectionTitleView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DashboardSectionTitleView.swift; sourceTree = "<group>"; };
3D8AB2A42B36440D005BD7D0 /* BlurHashDecode.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BlurHashDecode.swift; sourceTree = "<group>"; };
3D8AB2A72B366353005BD7D0 /* LibraryDetailView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LibraryDetailView.swift; sourceTree = "<group>"; };
3D9063C72B279A310063DD2A /* Jel.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Jel.app; sourceTree = BUILT_PRODUCTS_DIR; };
@ -292,6 +294,7 @@
children = (
3DDD67922B293BC40026781E /* DashboardView.swift */,
3D16FC3B2B2CDFB500E6D8B3 /* DashboardLibraryView.swift */,
3D4C15712B3CAA670035373E /* DashboardSectionTitleView.swift */,
);
path = Dashboard;
sourceTree = "<group>";
@ -467,6 +470,7 @@
3DC6BA2D2B2A422300416B9F /* SettingsController.swift in Sources */,
3DAFA8E82B38AFED00D71AD1 /* ItemInfoView.swift in Sources */,
3D91FDCB2B28CA2500919017 /* SignInToServerView.swift in Sources */,
3D4C15722B3CAA670035373E /* DashboardSectionTitleView.swift in Sources */,
3D16FC3C2B2CDFB500E6D8B3 /* DashboardLibraryView.swift in Sources */,
3D1015E42B28000E00F5C29A /* AuthStateController.swift in Sources */,
3D13F95F2B375DB800E91913 /* ItemView.swift in Sources */,

View File

@ -30,7 +30,6 @@ struct DashboardLibraryView: View {
} label: {
LibraryIconView(library: library, height: 150)
.setAspectRatio(library.primaryImageAspectRatio)
.padding()
}
.buttonStyle(PlainButtonStyle())
}

View File

@ -0,0 +1,30 @@
//
// DashboardSectionTitleView.swift
// Jel
//
// Created by zerocool on 12/27/23.
//
import SwiftUI
struct DashboardSectionTitleView: View {
@State var titleText: String
init(_ title: String) {
self.titleText = title
}
var body: some View {
HStack {
Text(titleText)
.font(.title2)
.bold()
Spacer()
}
.padding(.top)
}
}
#Preview {
DashboardSectionTitleView("Title")
}

View File

@ -12,12 +12,27 @@ struct DashboardView: View {
@State var showingSettingsSheet: Bool = false
var body: some View {
VStack {
ScrollView {
LazyVStack {
Section {
NavigationStack {
DashboardLibraryView()
}
} header: {
DashboardSectionTitleView("Libraries")
}
Section {
NavigationStack {
DashboardLibraryView()
}
} header: {
DashboardSectionTitleView("Next up")
}
}
.padding()
}
.navigationTitle("Home")
}
}
.toolbar {
ToolbarItem(placement: .topBarTrailing) {
Button {

View File

@ -18,7 +18,7 @@ struct ItemMediaView: View {
@State var navigationTitle: String = ""
var body: some View {
VStack {
GeometryReader {geo in
if loading {
ProgressView()
.progressViewStyle(.circular)
@ -50,14 +50,21 @@ struct ItemMediaView: View {
Text(overview)
}
}
.if(max(geo.safeAreaInsets.leading, geo.safeAreaInsets.trailing) > 0) {view in
view
.padding(max(geo.safeAreaInsets.leading, geo.safeAreaInsets.trailing))
}
.if(max(geo.safeAreaInsets.leading, geo.safeAreaInsets.trailing) <= 0) {view in
view
.padding()
}
}
.ignoresSafeArea()
}
}
.toolbarRole(.editor)
.navigationBarTitleDisplayMode(.inline)
.navigationTitle(navigationTitle)
.ignoresSafeArea()
.scrollIndicators(.hidden)
.onAppear {
Task {
@ -75,5 +82,4 @@ struct ItemMediaView: View {
//#Preview {
// ItemMovieView(item: BaseItemDto())
//}