|
@@ -9,31 +9,36 @@ import Cocoa
|
|
|
|
|
|
@objcMembers class KMDisplayPreferences: NSViewController {
|
|
|
|
|
|
+ @IBOutlet weak var thumbSizeLabel: NSTextField!
|
|
|
+ @IBOutlet weak var pagesLabel: NSTextField!
|
|
|
+ @IBOutlet weak var pagesSlider: NSSlider!
|
|
|
+ @IBOutlet weak var snapshotLabel: NSTextField!
|
|
|
+ @IBOutlet weak var snapshotSlider: NSSlider!
|
|
|
+ @IBOutlet weak var discreteSizeCheckbox: NSButton!
|
|
|
+
|
|
|
@IBOutlet var tableFontLabelField: NSTextField!
|
|
|
@IBOutlet var tableFontComboBox: NSComboBox!
|
|
|
+
|
|
|
+ @IBOutlet weak var displayLabel: NSTextField!
|
|
|
@IBOutlet var greekingLabelField: NSTextField!
|
|
|
@IBOutlet var greekingTextField: NSTextField!
|
|
|
@IBOutlet var antiAliasCheckButton: NSButton!
|
|
|
|
|
|
- @IBOutlet weak var pagesLabel: NSTextField!
|
|
|
- @IBOutlet weak var snapshotLabel: NSTextField!
|
|
|
- var thumbnailSizeLabels: [NSTextField] = []
|
|
|
+ @IBOutlet weak var backgroundColorLabel: NSTextField!
|
|
|
+ @IBOutlet weak var normalColorLabel: NSTextField!
|
|
|
+ @IBOutlet weak var normalColorWell: NSColorWell!
|
|
|
+ @IBOutlet weak var fullScreenLabel: NSTextField!
|
|
|
+ @IBOutlet weak var fullScreenColorWell: NSColorWell!
|
|
|
|
|
|
- @IBOutlet weak var pagesSlider: NSSlider!
|
|
|
- @IBOutlet weak var snapshotSlider: NSSlider!
|
|
|
- @IBOutlet weak var discreteSizeCheckbox: NSButton!
|
|
|
+ @IBOutlet weak var readBarLabel: NSTextField!
|
|
|
+ @IBOutlet weak var readingbarColorLabel: NSTextField!
|
|
|
+ @IBOutlet weak var readBarColorWell: NSColorWell!
|
|
|
+ @IBOutlet weak var invertBarButton: NSButton!
|
|
|
+
|
|
|
+ var thumbnailSizeLabels: [NSTextField] = []
|
|
|
var thumbnailSizeControls: [NSControl] = []
|
|
|
|
|
|
- @IBOutlet weak var normalColorLabel: NSTextField!
|
|
|
- @IBOutlet weak var readingbarColorLabel: NSTextField!
|
|
|
var colorLabels: [NSTextField] = []
|
|
|
-
|
|
|
-
|
|
|
- @IBOutlet weak var colorControl1: NSColorWell!
|
|
|
- @IBOutlet weak var colorControl2: NSTextField!
|
|
|
- @IBOutlet weak var colorControl3: NSColorWell!
|
|
|
- @IBOutlet weak var colorControl4: NSColorWell!
|
|
|
- @IBOutlet weak var colorControl5: NSButton!
|
|
|
var colorControls: [NSControl] = []
|
|
|
/*
|
|
|
- (NSUInteger)countOfSizes;
|
|
@@ -57,10 +62,10 @@ import Cocoa
|
|
|
_ = KMAutoSizeLabelFields([self.greekingLabelField], [self.greekingTextField], false)
|
|
|
self.antiAliasCheckButton.sizeToFit()
|
|
|
self.colorLabels = [self.normalColorLabel, self.readingbarColorLabel]
|
|
|
- self.colorControls = [self.colorControl1, self.colorControl2, self.colorControl3, self.colorControl4, self.colorControl5]
|
|
|
+ self.colorControls = [self.normalColorWell, self.fullScreenLabel, self.fullScreenColorWell, self.readBarColorWell, self.invertBarButton]
|
|
|
_ = KMAutoSizeLabelFields(self.colorLabels, self.colorControls, false)
|
|
|
- _ = KMAutoSizeLabelFields([self.colorControl2], [self.colorControl3], false);
|
|
|
- self.colorControl5.sizeToFit()
|
|
|
+ _ = KMAutoSizeLabelFields([self.fullScreenLabel], [self.fullScreenColorWell], false);
|
|
|
+ self.invertBarButton.sizeToFit()
|
|
|
|
|
|
var w = 0.0
|
|
|
for view in self.view.subviews {
|
|
@@ -83,8 +88,29 @@ import Cocoa
|
|
|
super.viewDidLoad()
|
|
|
// Do view setup here.
|
|
|
|
|
|
+ self.pagesSlider.target = self
|
|
|
+ self.pagesSlider.action = #selector(pageSliderAction)
|
|
|
+ self.snapshotSlider.target = self
|
|
|
+ self.snapshotSlider.action = #selector(snapshotSliderAction)
|
|
|
+
|
|
|
self.tableFontComboBox.addItems(withObjectValues: SKDefaultFontSizes)
|
|
|
self.tableFontComboBox.selectItem(at: 4)
|
|
|
+ self.tableFontComboBox.delegate = self
|
|
|
+
|
|
|
+ self.greekingTextField.delegate = self
|
|
|
+ self.antiAliasCheckButton.target = self
|
|
|
+ self.antiAliasCheckButton.action = #selector(antiAliasCheckAction)
|
|
|
+
|
|
|
+ self.normalColorWell.target = self
|
|
|
+ self.normalColorWell.action = #selector(normalColorAction)
|
|
|
+ self.fullScreenColorWell.target = self
|
|
|
+ self.fullScreenColorWell.action = #selector(fullScreenColorAction)
|
|
|
+
|
|
|
+ self.readBarColorWell.target = self
|
|
|
+ self.readBarColorWell.action = #selector(readBarColorAction)
|
|
|
+
|
|
|
+ self.invertBarButton.target = self
|
|
|
+ self.invertBarButton.action = #selector(invertBarAction)
|
|
|
}
|
|
|
|
|
|
override var title: String? {
|
|
@@ -96,6 +122,14 @@ import Cocoa
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ @objc func pageSliderAction(_ sender: NSSlider) {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @objc func snapshotSliderAction(_ sender: NSSlider) {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
@IBAction func changeDiscreteThumbnailSizes(_ sender: AnyObject?) {
|
|
|
let slider1 = self.pagesSlider
|
|
|
let slider2 = self.snapshotSlider
|
|
@@ -118,6 +152,26 @@ import Cocoa
|
|
|
slider2?.sizeToFit()
|
|
|
}
|
|
|
|
|
|
+ @objc func antiAliasCheckAction(_ sender: NSButton) {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @objc func normalColorAction(_ sender: NSColorWell) {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @objc func fullScreenColorAction(_ sender: NSColorWell) {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @objc func readBarColorAction(_ sender: NSColorWell) {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @objc func invertBarAction(_ sender: NSButton) {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
/*
|
|
|
- (NSUInteger)countOfSizes {
|
|
|
return sizeof(SKDefaultFontSizes) / sizeof(CGFloat);
|
|
@@ -132,6 +186,22 @@ import Cocoa
|
|
|
|
|
|
extension KMDisplayPreferences: KMPreferencePane {
|
|
|
func defaultsDidRevert() {
|
|
|
-
|
|
|
+ // no things.
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+extension KMDisplayPreferences: NSComboBoxDelegate {
|
|
|
+ func comboBoxSelectionDidChange(_ notification: Notification) {
|
|
|
+ if self.tableFontComboBox.isEqual(to: notification.object) {
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+extension KMDisplayPreferences: NSTextFieldDelegate {
|
|
|
+ func controlTextDidChange(_ obj: Notification) {
|
|
|
+ if self.greekingTextField.isEqual(to: obj.object) {
|
|
|
+
|
|
|
+ }
|
|
|
}
|
|
|
}
|