Fix padding and other minor UI improvements
This commit is contained in:
committed by
William Casarin
parent
300cae6800
commit
2c44366ca5
@@ -1000,7 +1000,7 @@
|
|||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
CURRENT_PROJECT_VERSION = 1;
|
CURRENT_PROJECT_VERSION = 1;
|
||||||
DEVELOPMENT_ASSET_PATHS = "\"damus/Preview Content\"";
|
DEVELOPMENT_ASSET_PATHS = "\"damus/Preview Content\"";
|
||||||
DEVELOPMENT_TEAM = XK7H4JAB3D;
|
DEVELOPMENT_TEAM = "";
|
||||||
ENABLE_PREVIEWS = YES;
|
ENABLE_PREVIEWS = YES;
|
||||||
GENERATE_INFOPLIST_FILE = YES;
|
GENERATE_INFOPLIST_FILE = YES;
|
||||||
INFOPLIST_FILE = damus/Info.plist;
|
INFOPLIST_FILE = damus/Info.plist;
|
||||||
@@ -1039,7 +1039,7 @@
|
|||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
CURRENT_PROJECT_VERSION = 1;
|
CURRENT_PROJECT_VERSION = 1;
|
||||||
DEVELOPMENT_ASSET_PATHS = "\"damus/Preview Content\"";
|
DEVELOPMENT_ASSET_PATHS = "\"damus/Preview Content\"";
|
||||||
DEVELOPMENT_TEAM = XK7H4JAB3D;
|
DEVELOPMENT_TEAM = "";
|
||||||
ENABLE_PREVIEWS = YES;
|
ENABLE_PREVIEWS = YES;
|
||||||
GENERATE_INFOPLIST_FILE = YES;
|
GENERATE_INFOPLIST_FILE = YES;
|
||||||
INFOPLIST_FILE = damus/Info.plist;
|
INFOPLIST_FILE = damus/Info.plist;
|
||||||
|
|||||||
@@ -73,11 +73,11 @@ struct ContentView: View {
|
|||||||
let timer = Timer.publish(every: 4, on: .main, in: .common).autoconnect()
|
let timer = Timer.publish(every: 4, on: .main, in: .common).autoconnect()
|
||||||
|
|
||||||
let sub_id = UUID().description
|
let sub_id = UUID().description
|
||||||
|
|
||||||
|
@Environment(\.colorScheme) var colorScheme
|
||||||
|
|
||||||
var PostingTimelineView: some View {
|
var PostingTimelineView: some View {
|
||||||
VStack{
|
VStack{
|
||||||
FiltersView
|
|
||||||
.padding([.bottom], 8)
|
|
||||||
ZStack {
|
ZStack {
|
||||||
if let damus = self.damus_state {
|
if let damus = self.damus_state {
|
||||||
TimelineView(events: $home.events, loading: $home.loading, damus: damus, show_friend_icon: false, filter: filter_event)
|
TimelineView(events: $home.events, loading: $home.loading, damus: damus, show_friend_icon: false, filter: filter_event)
|
||||||
@@ -89,6 +89,16 @@ struct ContentView: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.safeAreaInset(edge: .top) {
|
||||||
|
VStack(spacing: 0) {
|
||||||
|
FiltersView
|
||||||
|
//.frame(maxWidth: 275)
|
||||||
|
.padding()
|
||||||
|
Divider()
|
||||||
|
.frame(height: 1)
|
||||||
|
}
|
||||||
|
.background(colorScheme == .dark ? Color.black : Color.white)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var FiltersView: some View {
|
var FiltersView: some View {
|
||||||
@@ -139,7 +149,7 @@ struct ContentView: View {
|
|||||||
EmptyView()
|
EmptyView()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.navigationBarTitle("Damus", displayMode: .inline)
|
.navigationBarTitle(selected_timeline == .home ? "Home" : "Global", displayMode: .inline)
|
||||||
}
|
}
|
||||||
|
|
||||||
var MaybeSearchView: some View {
|
var MaybeSearchView: some View {
|
||||||
|
|||||||
@@ -37,6 +37,8 @@ struct ChatroomView: View {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
.padding(.horizontal)
|
||||||
|
.padding(.top)
|
||||||
|
|
||||||
EndBlock()
|
EndBlock()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,12 +12,6 @@ struct DMChatView: View {
|
|||||||
let pubkey: String
|
let pubkey: String
|
||||||
@EnvironmentObject var dms: DirectMessageModel
|
@EnvironmentObject var dms: DirectMessageModel
|
||||||
@State var message: String = ""
|
@State var message: String = ""
|
||||||
|
|
||||||
init(damus_state: DamusState, pubkey: String) {
|
|
||||||
self.damus_state = damus_state
|
|
||||||
self.pubkey = pubkey
|
|
||||||
UITextView.appearance().backgroundColor = .clear
|
|
||||||
}
|
|
||||||
|
|
||||||
var Messages: some View {
|
var Messages: some View {
|
||||||
ScrollViewReader { scroller in
|
ScrollViewReader { scroller in
|
||||||
@@ -29,6 +23,7 @@ struct DMChatView: View {
|
|||||||
}
|
}
|
||||||
EndBlock(height: 80)
|
EndBlock(height: 80)
|
||||||
}
|
}
|
||||||
|
.padding(.horizontal)
|
||||||
}
|
}
|
||||||
.onAppear {
|
.onAppear {
|
||||||
scroller.scrollTo("endblock")
|
scroller.scrollTo("endblock")
|
||||||
@@ -53,9 +48,16 @@ struct DMChatView: View {
|
|||||||
|
|
||||||
var InputField: some View {
|
var InputField: some View {
|
||||||
TextEditor(text: $message)
|
TextEditor(text: $message)
|
||||||
.cornerRadius(20)
|
.textEditorBackground {
|
||||||
.padding(8)
|
InputBackground()
|
||||||
.background(InputBackground().cornerRadius(20))
|
}
|
||||||
|
.cornerRadius(8)
|
||||||
|
.background(
|
||||||
|
RoundedRectangle(cornerRadius: 8)
|
||||||
|
.stroke(style: .init(lineWidth: 2))
|
||||||
|
.foregroundColor(.secondary.opacity(0.2))
|
||||||
|
)
|
||||||
|
.padding(16)
|
||||||
.foregroundColor(Color.primary)
|
.foregroundColor(Color.primary)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -63,9 +65,9 @@ struct DMChatView: View {
|
|||||||
|
|
||||||
func InputBackground() -> Color {
|
func InputBackground() -> Color {
|
||||||
if colorScheme == .light {
|
if colorScheme == .light {
|
||||||
return Color.init(.sRGB, red: 0.8, green: 0.8, blue: 0.8, opacity: 1.0)
|
return Color.init(.sRGB, red: 0.9, green: 0.9, blue: 0.9, opacity: 1.0)
|
||||||
} else {
|
} else {
|
||||||
return Color.init(.sRGB, red: 0.2, green: 0.2, blue: 0.2, opacity: 1.0)
|
return Color.init(.sRGB, red: 0.1, green: 0.1, blue: 0.1, opacity: 1.0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -78,21 +80,21 @@ struct DMChatView: View {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var Footer: some View {
|
var Footer: some View {
|
||||||
//ZStack {
|
ZStack {
|
||||||
//BackgroundColor()
|
BackgroundColor()
|
||||||
|
|
||||||
|
HStack(spacing: 0) {
|
||||||
|
InputField
|
||||||
|
|
||||||
HStack(spacing: 0) {
|
if !message.isEmpty {
|
||||||
InputField
|
Button(role: .none, action: send_message) {
|
||||||
|
Label("", systemImage: "arrow.right.circle")
|
||||||
if !message.isEmpty {
|
.font(.title)
|
||||||
Button(role: .none, action: send_message) {
|
}
|
||||||
Label("", systemImage: "arrow.right.circle")
|
|
||||||
.font(.title)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.frame(height: 50 + 20 * CGFloat(text_lines))
|
.frame(height: 50 + 20 * CGFloat(text_lines))
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var text_lines: Int {
|
var text_lines: Int {
|
||||||
@@ -123,12 +125,12 @@ struct DMChatView: View {
|
|||||||
message = ""
|
message = ""
|
||||||
|
|
||||||
damus_state.pool.send(.event(dm))
|
damus_state.pool.send(.event(dm))
|
||||||
|
end_editing()
|
||||||
}
|
}
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
ZStack {
|
ZStack {
|
||||||
Messages
|
Messages
|
||||||
.padding([.top, .leading, .trailing], 10)
|
|
||||||
.dismissKeyboardOnTap()
|
.dismissKeyboardOnTap()
|
||||||
|
|
||||||
VStack {
|
VStack {
|
||||||
|
|||||||
@@ -18,6 +18,8 @@ struct DirectMessagesView: View {
|
|||||||
MaybeEvent(tup)
|
MaybeEvent(tup)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.padding(.horizontal)
|
||||||
|
.padding(.top)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -91,15 +91,19 @@ struct EventDetailView: View {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ScrollView(.vertical) {
|
ScrollView(.vertical) {
|
||||||
let collapsed_events = calculated_collapsed_events(
|
LazyVStack {
|
||||||
privkey: damus.keypair.privkey,
|
let collapsed_events = calculated_collapsed_events(
|
||||||
collapsed: self.collapsed,
|
privkey: damus.keypair.privkey,
|
||||||
active: thread.event,
|
collapsed: self.collapsed,
|
||||||
events: thread.events
|
active: thread.event,
|
||||||
)
|
events: thread.events
|
||||||
ForEach(collapsed_events, id: \.id) { cev in
|
)
|
||||||
CollapsedEventView(cev, scroller: proxy)
|
ForEach(collapsed_events, id: \.id) { cev in
|
||||||
|
CollapsedEventView(cev, scroller: proxy)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
.padding(.horizontal)
|
||||||
|
.padding(.top)
|
||||||
|
|
||||||
EndBlock()
|
EndBlock()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ struct SearchHomeView: View {
|
|||||||
ZStack(alignment: .leading) {
|
ZStack(alignment: .leading) {
|
||||||
HStack{
|
HStack{
|
||||||
TextField("", text: $search)
|
TextField("", text: $search)
|
||||||
.padding(5)
|
.padding(8)
|
||||||
.padding(.leading, 35)
|
.padding(.leading, 35)
|
||||||
.textInputAutocapitalization(.never)
|
.textInputAutocapitalization(.never)
|
||||||
Label("", systemImage: "xmark.square")
|
Label("", systemImage: "xmark.square")
|
||||||
@@ -32,10 +32,10 @@ struct SearchHomeView: View {
|
|||||||
.padding(.leading, 10)
|
.padding(.leading, 10)
|
||||||
}
|
}
|
||||||
.background {
|
.background {
|
||||||
RoundedRectangle(cornerRadius: 20)
|
RoundedRectangle(cornerRadius: 8)
|
||||||
.foregroundColor(.gray.opacity(0.2))
|
.foregroundColor(.secondary.opacity(0.2))
|
||||||
}
|
}
|
||||||
.padding()
|
//.padding()
|
||||||
}
|
}
|
||||||
|
|
||||||
var GlobalContent: some View {
|
var GlobalContent: some View {
|
||||||
@@ -56,12 +56,22 @@ struct SearchHomeView: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Environment(\.colorScheme) var colorScheme
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
VStack {
|
VStack {
|
||||||
SearchInput
|
|
||||||
|
|
||||||
MainContent
|
MainContent
|
||||||
}
|
}
|
||||||
|
.safeAreaInset(edge: .top) {
|
||||||
|
VStack(spacing: 0) {
|
||||||
|
SearchInput
|
||||||
|
//.frame(maxWidth: 275)
|
||||||
|
.padding()
|
||||||
|
Divider()
|
||||||
|
.frame(height: 1)
|
||||||
|
}
|
||||||
|
.background(colorScheme == .dark ? Color.black : Color.white)
|
||||||
|
}
|
||||||
.onChange(of: search) { s in
|
.onChange(of: search) { s in
|
||||||
print("search change 1")
|
print("search change 1")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,7 +35,6 @@ struct ThreadView: View {
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
.padding([.leading, .trailing], 6)
|
|
||||||
.onReceive(handle_notify(.switched_timeline)) { n in
|
.onReceive(handle_notify(.switched_timeline)) { n in
|
||||||
dismiss()
|
dismiss()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ struct InnerTimelineView: View {
|
|||||||
.buttonStyle(PlainButtonStyle())
|
.buttonStyle(PlainButtonStyle())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.padding(.horizontal)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user