Explorar el Código

Fix mirrored alignment in the create meeting popover.

Force left-to-right label layout and anchor field rows to full width so headings remain on the left side of the popup.

Made-with: Cursor
huzaifahayat12 hace 1 semana
padre
commit
959e77f27d
Se han modificado 1 ficheros con 22 adiciones y 1 borrados
  1. 22 1
      meetings_app/ViewController.swift

+ 22 - 1
meetings_app/ViewController.swift

@@ -4895,20 +4895,28 @@ private final class CreateMeetingPopoverViewController: NSViewController {
4895 4895
     override func loadView() {
4896 4896
         let root = NSView()
4897 4897
         root.translatesAutoresizingMaskIntoConstraints = false
4898
+        root.userInterfaceLayoutDirection = .leftToRight
4898 4899
 
4899 4900
         let stack = NSStackView()
4900 4901
         stack.translatesAutoresizingMaskIntoConstraints = false
4901 4902
         stack.orientation = .vertical
4902
-        stack.alignment = .width
4903
+        stack.alignment = .leading
4903 4904
         stack.spacing = 12
4905
+        stack.userInterfaceLayoutDirection = .leftToRight
4904 4906
 
4905 4907
         let header = NSTextField(labelWithString: "Schedule meeting")
4906 4908
         header.font = NSFont.systemFont(ofSize: 14, weight: .semibold)
4907 4909
         header.textColor = palette.textPrimary
4910
+        header.alignment = .left
4911
+        header.userInterfaceLayoutDirection = .leftToRight
4912
+        header.baseWritingDirection = .leftToRight
4908 4913
 
4909 4914
         let titleLabel = NSTextField(labelWithString: "Title")
4910 4915
         titleLabel.font = typography.fieldLabel
4911 4916
         titleLabel.textColor = palette.textSecondary
4917
+        titleLabel.alignment = .left
4918
+        titleLabel.userInterfaceLayoutDirection = .leftToRight
4919
+        titleLabel.baseWritingDirection = .leftToRight
4912 4920
 
4913 4921
         let titleShell = NSView()
4914 4922
         titleShell.translatesAutoresizingMaskIntoConstraints = false
@@ -4945,6 +4953,9 @@ private final class CreateMeetingPopoverViewController: NSViewController {
4945 4953
         let startLabel = NSTextField(labelWithString: "Start")
4946 4954
         startLabel.font = typography.fieldLabel
4947 4955
         startLabel.textColor = palette.textSecondary
4956
+        startLabel.alignment = .left
4957
+        startLabel.userInterfaceLayoutDirection = .leftToRight
4958
+        startLabel.baseWritingDirection = .leftToRight
4948 4959
 
4949 4960
         let pickerShell = NSView()
4950 4961
         pickerShell.translatesAutoresizingMaskIntoConstraints = false
@@ -4976,6 +4987,9 @@ private final class CreateMeetingPopoverViewController: NSViewController {
4976 4987
         let durationLabel = NSTextField(labelWithString: "Duration (min)")
4977 4988
         durationLabel.font = typography.fieldLabel
4978 4989
         durationLabel.textColor = palette.textSecondary
4990
+        durationLabel.alignment = .left
4991
+        durationLabel.userInterfaceLayoutDirection = .leftToRight
4992
+        durationLabel.baseWritingDirection = .leftToRight
4979 4993
 
4980 4994
         let durationShell = NSView()
4981 4995
         durationShell.translatesAutoresizingMaskIntoConstraints = false
@@ -5021,6 +5035,9 @@ private final class CreateMeetingPopoverViewController: NSViewController {
5021 5035
         let notesLabel = NSTextField(labelWithString: "Notes")
5022 5036
         notesLabel.font = typography.fieldLabel
5023 5037
         notesLabel.textColor = palette.textSecondary
5038
+        notesLabel.alignment = .left
5039
+        notesLabel.userInterfaceLayoutDirection = .leftToRight
5040
+        notesLabel.baseWritingDirection = .leftToRight
5024 5041
 
5025 5042
         let notesScroll = NSScrollView()
5026 5043
         notesScroll.translatesAutoresizingMaskIntoConstraints = false
@@ -5086,6 +5103,10 @@ private final class CreateMeetingPopoverViewController: NSViewController {
5086 5103
             stack.trailingAnchor.constraint(equalTo: root.trailingAnchor, constant: -14),
5087 5104
             stack.topAnchor.constraint(equalTo: root.topAnchor, constant: 12),
5088 5105
             stack.bottomAnchor.constraint(equalTo: root.bottomAnchor, constant: -12),
5106
+            titleShell.widthAnchor.constraint(equalTo: stack.widthAnchor),
5107
+            timeRow.widthAnchor.constraint(equalTo: stack.widthAnchor),
5108
+            notesScroll.widthAnchor.constraint(equalTo: stack.widthAnchor),
5109
+            error.widthAnchor.constraint(equalTo: stack.widthAnchor),
5089 5110
             actions.widthAnchor.constraint(equalTo: stack.widthAnchor)
5090 5111
         ])
5091 5112