Pad item info text when view is horizontal
This commit is contained in:
parent
b7a1bd1d55
commit
a271314f15
@ -19,6 +19,7 @@
|
|||||||
3D16FC3C2B2CDFB500E6D8B3 /* DashboardLibraryView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D16FC3B2B2CDFB500E6D8B3 /* DashboardLibraryView.swift */; };
|
3D16FC3C2B2CDFB500E6D8B3 /* DashboardLibraryView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D16FC3B2B2CDFB500E6D8B3 /* DashboardLibraryView.swift */; };
|
||||||
3D41D1F52B2C962500E58234 /* AppearancePicker.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D41D1F42B2C962500E58234 /* AppearancePicker.swift */; };
|
3D41D1F52B2C962500E58234 /* AppearancePicker.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D41D1F42B2C962500E58234 /* AppearancePicker.swift */; };
|
||||||
3D41D1FA2B2CAE0000E58234 /* LibraryIconView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D41D1F92B2CAE0000E58234 /* LibraryIconView.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 */; };
|
3D7709392B29139700199889 /* Pulse in Frameworks */ = {isa = PBXBuildFile; productRef = 3D7709382B29139700199889 /* Pulse */; };
|
||||||
3D77093B2B29139700199889 /* PulseUI in Frameworks */ = {isa = PBXBuildFile; productRef = 3D77093A2B29139700199889 /* PulseUI */; };
|
3D77093B2B29139700199889 /* PulseUI in Frameworks */ = {isa = PBXBuildFile; productRef = 3D77093A2B29139700199889 /* PulseUI */; };
|
||||||
3D8AB2A52B36440D005BD7D0 /* BlurHashDecode.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8AB2A42B36440D005BD7D0 /* BlurHashDecode.swift */; };
|
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>"; };
|
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>"; };
|
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>"; };
|
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>"; };
|
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>"; };
|
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; };
|
3D9063C72B279A310063DD2A /* Jel.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Jel.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
@ -292,6 +294,7 @@
|
|||||||
children = (
|
children = (
|
||||||
3DDD67922B293BC40026781E /* DashboardView.swift */,
|
3DDD67922B293BC40026781E /* DashboardView.swift */,
|
||||||
3D16FC3B2B2CDFB500E6D8B3 /* DashboardLibraryView.swift */,
|
3D16FC3B2B2CDFB500E6D8B3 /* DashboardLibraryView.swift */,
|
||||||
|
3D4C15712B3CAA670035373E /* DashboardSectionTitleView.swift */,
|
||||||
);
|
);
|
||||||
path = Dashboard;
|
path = Dashboard;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
@ -467,6 +470,7 @@
|
|||||||
3DC6BA2D2B2A422300416B9F /* SettingsController.swift in Sources */,
|
3DC6BA2D2B2A422300416B9F /* SettingsController.swift in Sources */,
|
||||||
3DAFA8E82B38AFED00D71AD1 /* ItemInfoView.swift in Sources */,
|
3DAFA8E82B38AFED00D71AD1 /* ItemInfoView.swift in Sources */,
|
||||||
3D91FDCB2B28CA2500919017 /* SignInToServerView.swift in Sources */,
|
3D91FDCB2B28CA2500919017 /* SignInToServerView.swift in Sources */,
|
||||||
|
3D4C15722B3CAA670035373E /* DashboardSectionTitleView.swift in Sources */,
|
||||||
3D16FC3C2B2CDFB500E6D8B3 /* DashboardLibraryView.swift in Sources */,
|
3D16FC3C2B2CDFB500E6D8B3 /* DashboardLibraryView.swift in Sources */,
|
||||||
3D1015E42B28000E00F5C29A /* AuthStateController.swift in Sources */,
|
3D1015E42B28000E00F5C29A /* AuthStateController.swift in Sources */,
|
||||||
3D13F95F2B375DB800E91913 /* ItemView.swift in Sources */,
|
3D13F95F2B375DB800E91913 /* ItemView.swift in Sources */,
|
||||||
|
@ -30,7 +30,6 @@ struct DashboardLibraryView: View {
|
|||||||
} label: {
|
} label: {
|
||||||
LibraryIconView(library: library, height: 150)
|
LibraryIconView(library: library, height: 150)
|
||||||
.setAspectRatio(library.primaryImageAspectRatio)
|
.setAspectRatio(library.primaryImageAspectRatio)
|
||||||
.padding()
|
|
||||||
}
|
}
|
||||||
.buttonStyle(PlainButtonStyle())
|
.buttonStyle(PlainButtonStyle())
|
||||||
}
|
}
|
||||||
|
30
Jel/Views/Dashboard/DashboardSectionTitleView.swift
Normal file
30
Jel/Views/Dashboard/DashboardSectionTitleView.swift
Normal 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")
|
||||||
|
}
|
@ -12,12 +12,27 @@ struct DashboardView: View {
|
|||||||
@State var showingSettingsSheet: Bool = false
|
@State var showingSettingsSheet: Bool = false
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
VStack {
|
ScrollView {
|
||||||
NavigationStack {
|
LazyVStack {
|
||||||
DashboardLibraryView()
|
Section {
|
||||||
.navigationTitle("Home")
|
NavigationStack {
|
||||||
|
DashboardLibraryView()
|
||||||
|
}
|
||||||
|
} header: {
|
||||||
|
DashboardSectionTitleView("Libraries")
|
||||||
|
}
|
||||||
|
|
||||||
|
Section {
|
||||||
|
NavigationStack {
|
||||||
|
DashboardLibraryView()
|
||||||
|
}
|
||||||
|
} header: {
|
||||||
|
DashboardSectionTitleView("Next up")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
.padding()
|
||||||
}
|
}
|
||||||
|
.navigationTitle("Home")
|
||||||
.toolbar {
|
.toolbar {
|
||||||
ToolbarItem(placement: .topBarTrailing) {
|
ToolbarItem(placement: .topBarTrailing) {
|
||||||
Button {
|
Button {
|
||||||
|
@ -18,7 +18,7 @@ struct ItemMediaView: View {
|
|||||||
@State var navigationTitle: String = ""
|
@State var navigationTitle: String = ""
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
VStack {
|
GeometryReader {geo in
|
||||||
if loading {
|
if loading {
|
||||||
ProgressView()
|
ProgressView()
|
||||||
.progressViewStyle(.circular)
|
.progressViewStyle(.circular)
|
||||||
@ -50,14 +50,21 @@ struct ItemMediaView: View {
|
|||||||
Text(overview)
|
Text(overview)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.padding()
|
.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)
|
.toolbarRole(.editor)
|
||||||
.navigationBarTitleDisplayMode(.inline)
|
.navigationBarTitleDisplayMode(.inline)
|
||||||
.navigationTitle(navigationTitle)
|
.navigationTitle(navigationTitle)
|
||||||
.ignoresSafeArea()
|
|
||||||
.scrollIndicators(.hidden)
|
.scrollIndicators(.hidden)
|
||||||
.onAppear {
|
.onAppear {
|
||||||
Task {
|
Task {
|
||||||
@ -75,5 +82,4 @@ struct ItemMediaView: View {
|
|||||||
|
|
||||||
//#Preview {
|
//#Preview {
|
||||||
// ItemMovieView(item: BaseItemDto())
|
// ItemMovieView(item: BaseItemDto())
|
||||||
|
|
||||||
//}
|
//}
|
||||||
|
Loading…
Reference in New Issue
Block a user