Browse Source

Fix editor scrolling horizontally

master
Matt Baer 4 years ago
parent
commit
dec7a6bd33
2 changed files with 3 additions and 1 deletions
  1. +1
    -0
      writeas/Base.lproj/Main.storyboard
  2. +2
    -1
      writeas/ViewController.swift

+ 1
- 0
writeas/Base.lproj/Main.storyboard View File

@@ -501,6 +501,7 @@ DQ
</constraints>
</view>
<connections>
<outlet property="writerScrollContainer" destination="jcY-KK-WQg" id="y9X-kJ-JMT"/>
<outlet property="writerText" destination="HxZ-78-tID" id="bub-iR-kN5"/>
</connections>
</viewController>


+ 2
- 1
writeas/ViewController.swift View File

@@ -11,6 +11,7 @@ import Cocoa
class ViewController: NSViewController, NSTextViewDelegate, NSUserNotificationCenterDelegate {

@IBOutlet var writerText: NSTextView!
@IBOutlet weak var writerScrollContainer: NSScrollView!

var isNight = false

@@ -51,7 +52,7 @@ class ViewController: NSViewController, NSTextViewDelegate, NSUserNotificationCe

func configureWindow() {
// Fit textview to window size
writerText.setFrameSize(NSSize(width: self.view.window!.frame.width, height: self.view.window!.frame.height))
writerText.setFrameSize(NSSize(width: self.writerScrollContainer.frame.width - 20, height: self.writerScrollContainer.frame.height))
}

override var representedObject: Any? {


Loading…
Cancel
Save