SettingsCocoa // Share metrics across panes.
This commit is contained in:
parent
ad98484094
commit
3af51f22e1
|
@ -20,6 +20,12 @@ public class SettingsPanesCocoa {
|
||||||
public let ctlPageCassette = SettingsPanesCocoa.Cassette()
|
public let ctlPageCassette = SettingsPanesCocoa.Cassette()
|
||||||
public let ctlPageKeyboard = SettingsPanesCocoa.Keyboard()
|
public let ctlPageKeyboard = SettingsPanesCocoa.Keyboard()
|
||||||
public let ctlPageDevZone = SettingsPanesCocoa.DevZone()
|
public let ctlPageDevZone = SettingsPanesCocoa.DevZone()
|
||||||
|
|
||||||
|
public static let windowWidth: CGFloat = 614
|
||||||
|
public static var contentWidth: CGFloat { windowWidth - 65 }
|
||||||
|
public static var innerContentWidth: CGFloat { contentWidth - 37 }
|
||||||
|
public static var tabContainerWidth: CGFloat { contentWidth + 20 }
|
||||||
|
public static var contentHalfWidth: CGFloat { contentWidth / 2 - 4 }
|
||||||
}
|
}
|
||||||
|
|
||||||
public extension SettingsPanesCocoa {
|
public extension SettingsPanesCocoa {
|
||||||
|
|
|
@ -12,9 +12,11 @@ import Shared
|
||||||
|
|
||||||
public extension SettingsPanesCocoa {
|
public extension SettingsPanesCocoa {
|
||||||
class Behavior: NSViewController {
|
class Behavior: NSViewController {
|
||||||
let windowWidth: CGFloat = 577
|
var windowWidth: CGFloat { SettingsPanesCocoa.windowWidth }
|
||||||
let contentWidth: CGFloat = 512 - 37
|
var contentWidth: CGFloat { SettingsPanesCocoa.contentWidth }
|
||||||
let tabContainerWidth: CGFloat = 512 + 20
|
var innerContentWidth: CGFloat { SettingsPanesCocoa.innerContentWidth }
|
||||||
|
var tabContainerWidth: CGFloat { SettingsPanesCocoa.tabContainerWidth }
|
||||||
|
var contentHalfWidth: CGFloat { SettingsPanesCocoa.contentHalfWidth }
|
||||||
|
|
||||||
override public func loadView() {
|
override public func loadView() {
|
||||||
view = body ?? .init()
|
view = body ?? .init()
|
||||||
|
@ -27,35 +29,35 @@ public extension SettingsPanesCocoa {
|
||||||
NSView().makeSimpleConstraint(.height, relation: .equal, value: 4)
|
NSView().makeSimpleConstraint(.height, relation: .equal, value: 4)
|
||||||
NSTabView.build {
|
NSTabView.build {
|
||||||
NSTabView.TabPage(title: "A") {
|
NSTabView.TabPage(title: "A") {
|
||||||
NSStackView.buildSection(width: contentWidth) {
|
NSStackView.buildSection(width: innerContentWidth) {
|
||||||
UserDef.kSpecifyShiftBackSpaceKeyBehavior.render(fixWidth: contentWidth)
|
UserDef.kSpecifyShiftBackSpaceKeyBehavior.render(fixWidth: innerContentWidth)
|
||||||
UserDef.kSpecifyShiftTabKeyBehavior.render(fixWidth: contentWidth)
|
UserDef.kSpecifyShiftTabKeyBehavior.render(fixWidth: innerContentWidth)
|
||||||
UserDef.kSpecifyShiftSpaceKeyBehavior.render(fixWidth: contentWidth)
|
UserDef.kSpecifyShiftSpaceKeyBehavior.render(fixWidth: innerContentWidth)
|
||||||
}?.boxed()
|
}?.boxed()
|
||||||
NSStackView.buildSection(width: contentWidth) {
|
NSStackView.buildSection(width: innerContentWidth) {
|
||||||
UserDef.kUpperCaseLetterKeyBehavior.render(fixWidth: contentWidth)
|
UserDef.kUpperCaseLetterKeyBehavior.render(fixWidth: innerContentWidth)
|
||||||
UserDef.kNumPadCharInputBehavior.render(fixWidth: contentWidth)
|
UserDef.kNumPadCharInputBehavior.render(fixWidth: innerContentWidth)
|
||||||
}?.boxed()
|
}?.boxed()
|
||||||
NSStackView.buildSection(width: contentWidth) {
|
NSStackView.buildSection(width: innerContentWidth) {
|
||||||
UserDef.kSpecifyIntonationKeyBehavior.render(fixWidth: contentWidth)
|
UserDef.kSpecifyIntonationKeyBehavior.render(fixWidth: innerContentWidth)
|
||||||
UserDef.kAcceptLeadingIntonations.render(fixWidth: contentWidth)
|
UserDef.kAcceptLeadingIntonations.render(fixWidth: innerContentWidth)
|
||||||
}?.boxed()
|
}?.boxed()
|
||||||
NSView()
|
NSView()
|
||||||
}
|
}
|
||||||
NSTabView.TabPage(title: "B") {
|
NSTabView.TabPage(title: "B") {
|
||||||
NSStackView.buildSection(width: contentWidth) {
|
NSStackView.buildSection(width: innerContentWidth) {
|
||||||
UserDef.kChooseCandidateUsingSpace.render(fixWidth: contentWidth)
|
UserDef.kChooseCandidateUsingSpace.render(fixWidth: innerContentWidth)
|
||||||
UserDef.kEscToCleanInputBuffer.render(fixWidth: contentWidth)
|
UserDef.kEscToCleanInputBuffer.render(fixWidth: innerContentWidth)
|
||||||
UserDef.kAlsoConfirmAssociatedCandidatesByEnter.render(fixWidth: contentWidth)
|
UserDef.kAlsoConfirmAssociatedCandidatesByEnter.render(fixWidth: innerContentWidth)
|
||||||
UserDef.kUseSpaceToCommitHighlightedSCPCCandidate.render(fixWidth: contentWidth)
|
UserDef.kUseSpaceToCommitHighlightedSCPCCandidate.render(fixWidth: innerContentWidth)
|
||||||
}?.boxed()
|
}?.boxed()
|
||||||
NSStackView.buildSection(width: contentWidth) {
|
NSStackView.buildSection(width: innerContentWidth) {
|
||||||
if #available(macOS 12, *) {
|
if #available(macOS 12, *) {
|
||||||
UserDef.kShowNotificationsWhenTogglingCapsLock.render(fixWidth: contentWidth)
|
UserDef.kShowNotificationsWhenTogglingCapsLock.render(fixWidth: innerContentWidth)
|
||||||
}
|
}
|
||||||
UserDef.kAlwaysShowTooltipTextsHorizontally.render(fixWidth: contentWidth)
|
UserDef.kAlwaysShowTooltipTextsHorizontally.render(fixWidth: innerContentWidth)
|
||||||
if Date.isTodayTheDate(from: 0401) {
|
if Date.isTodayTheDate(from: 0401) {
|
||||||
UserDef.kShouldNotFartInLieuOfBeep.render(fixWidth: contentWidth) { renderable in
|
UserDef.kShouldNotFartInLieuOfBeep.render(fixWidth: innerContentWidth) { renderable in
|
||||||
renderable.currentControl?.target = self
|
renderable.currentControl?.target = self
|
||||||
renderable.currentControl?.action = #selector(self.onFartControlChange(_:))
|
renderable.currentControl?.action = #selector(self.onFartControlChange(_:))
|
||||||
}
|
}
|
||||||
|
@ -64,18 +66,18 @@ public extension SettingsPanesCocoa {
|
||||||
NSView()
|
NSView()
|
||||||
}
|
}
|
||||||
NSTabView.TabPage(title: "C") {
|
NSTabView.TabPage(title: "C") {
|
||||||
NSStackView.buildSection(width: contentWidth) {
|
NSStackView.buildSection(width: innerContentWidth) {
|
||||||
UserDef.kBypassNonAppleCapsLockHandling.render(fixWidth: contentWidth)
|
UserDef.kBypassNonAppleCapsLockHandling.render(fixWidth: innerContentWidth)
|
||||||
UserDef.kShareAlphanumericalModeStatusAcrossClients.render(fixWidth: contentWidth)
|
UserDef.kShareAlphanumericalModeStatusAcrossClients.render(fixWidth: innerContentWidth)
|
||||||
if #available(macOS 10.15, *) {
|
if #available(macOS 10.15, *) {
|
||||||
NSStackView.build(.vertical) {
|
NSStackView.build(.vertical) {
|
||||||
UserDef.kTogglingAlphanumericalModeWithLShift
|
UserDef.kTogglingAlphanumericalModeWithLShift
|
||||||
.render(fixWidth: contentWidth) { renderable in
|
.render(fixWidth: innerContentWidth) { renderable in
|
||||||
renderable.currentControl?.target = self
|
renderable.currentControl?.target = self
|
||||||
renderable.currentControl?.action = #selector(self.syncShiftKeyUpChecker(_:))
|
renderable.currentControl?.action = #selector(self.syncShiftKeyUpChecker(_:))
|
||||||
}
|
}
|
||||||
UserDef.kTogglingAlphanumericalModeWithRShift
|
UserDef.kTogglingAlphanumericalModeWithRShift
|
||||||
.render(fixWidth: contentWidth) { renderable in
|
.render(fixWidth: innerContentWidth) { renderable in
|
||||||
renderable.currentControl?.target = self
|
renderable.currentControl?.target = self
|
||||||
renderable.currentControl?.action = #selector(self.syncShiftKeyUpChecker(_:))
|
renderable.currentControl?.action = #selector(self.syncShiftKeyUpChecker(_:))
|
||||||
}
|
}
|
||||||
|
@ -85,10 +87,10 @@ public extension SettingsPanesCocoa {
|
||||||
)
|
)
|
||||||
strOSReq += "\n"
|
strOSReq += "\n"
|
||||||
strOSReq += "i18n:settings.shiftKeyASCIITogle.description".localized
|
strOSReq += "i18n:settings.shiftKeyASCIITogle.description".localized
|
||||||
strOSReq.makeNSLabel(descriptive: true, fixWidth: contentWidth)
|
strOSReq.makeNSLabel(descriptive: true, fixWidth: innerContentWidth)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
UserDef.kShiftEisuToggleOffTogetherWithCapsLock.render(fixWidth: contentWidth)
|
UserDef.kShiftEisuToggleOffTogetherWithCapsLock.render(fixWidth: innerContentWidth)
|
||||||
}?.boxed()
|
}?.boxed()
|
||||||
NSView()
|
NSView()
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,9 +12,11 @@ import Shared
|
||||||
|
|
||||||
public extension SettingsPanesCocoa {
|
public extension SettingsPanesCocoa {
|
||||||
class Candidates: NSViewController {
|
class Candidates: NSViewController {
|
||||||
let windowWidth: CGFloat = 577
|
var windowWidth: CGFloat { SettingsPanesCocoa.windowWidth }
|
||||||
let contentWidth: CGFloat = 512 - 37
|
var contentWidth: CGFloat { SettingsPanesCocoa.contentWidth }
|
||||||
let tabContainerWidth: CGFloat = 512 + 20
|
var innerContentWidth: CGFloat { SettingsPanesCocoa.innerContentWidth }
|
||||||
|
var tabContainerWidth: CGFloat { SettingsPanesCocoa.tabContainerWidth }
|
||||||
|
var contentHalfWidth: CGFloat { SettingsPanesCocoa.contentHalfWidth }
|
||||||
|
|
||||||
override public func loadView() {
|
override public func loadView() {
|
||||||
view = body ?? .init()
|
view = body ?? .init()
|
||||||
|
@ -27,33 +29,33 @@ public extension SettingsPanesCocoa {
|
||||||
NSView().makeSimpleConstraint(.height, relation: .equal, value: 4)
|
NSView().makeSimpleConstraint(.height, relation: .equal, value: 4)
|
||||||
NSTabView.build {
|
NSTabView.build {
|
||||||
NSTabView.TabPage(title: "A") {
|
NSTabView.TabPage(title: "A") {
|
||||||
NSStackView.buildSection(width: contentWidth) {
|
NSStackView.buildSection(width: innerContentWidth) {
|
||||||
UserDef.kUseHorizontalCandidateList.render(fixWidth: contentWidth)
|
UserDef.kUseHorizontalCandidateList.render(fixWidth: innerContentWidth)
|
||||||
UserDef.kCandidateListTextSize.render(fixWidth: contentWidth) { renderable in
|
UserDef.kCandidateListTextSize.render(fixWidth: innerContentWidth) { renderable in
|
||||||
renderable.currentControl?.target = self
|
renderable.currentControl?.target = self
|
||||||
renderable.currentControl?.action = #selector(self.candidateFontSizeDidSet(_:))
|
renderable.currentControl?.action = #selector(self.candidateFontSizeDidSet(_:))
|
||||||
}
|
}
|
||||||
UserDef.kCandidateWindowShowOnlyOneLine.render(fixWidth: contentWidth)
|
UserDef.kCandidateWindowShowOnlyOneLine.render(fixWidth: innerContentWidth)
|
||||||
UserDef.kAlwaysExpandCandidateWindow.render(fixWidth: contentWidth)
|
UserDef.kAlwaysExpandCandidateWindow.render(fixWidth: innerContentWidth)
|
||||||
UserDef.kRespectClientAccentColor.render(fixWidth: contentWidth)
|
UserDef.kRespectClientAccentColor.render(fixWidth: innerContentWidth)
|
||||||
}?.boxed()
|
}?.boxed()
|
||||||
NSView()
|
NSView()
|
||||||
}
|
}
|
||||||
NSTabView.TabPage(title: "B") {
|
NSTabView.TabPage(title: "B") {
|
||||||
NSStackView.buildSection(width: contentWidth) {
|
NSStackView.buildSection(width: innerContentWidth) {
|
||||||
UserDef.kCandidateKeys.render(fixWidth: contentWidth) { renderable in
|
UserDef.kCandidateKeys.render(fixWidth: innerContentWidth) { renderable in
|
||||||
renderable.currentControl?.target = self
|
renderable.currentControl?.target = self
|
||||||
renderable.currentControl?.action = #selector(self.candidateKeysDidSet(_:))
|
renderable.currentControl?.action = #selector(self.candidateKeysDidSet(_:))
|
||||||
renderable.currentControl?.alignment = .right
|
renderable.currentControl?.alignment = .right
|
||||||
}
|
}
|
||||||
}?.boxed()
|
}?.boxed()
|
||||||
NSStackView.buildSection(width: contentWidth) {
|
NSStackView.buildSection(width: innerContentWidth) {
|
||||||
UserDef.kUseRearCursorMode.render(fixWidth: contentWidth)
|
UserDef.kUseRearCursorMode.render(fixWidth: innerContentWidth)
|
||||||
UserDef.kMoveCursorAfterSelectingCandidate.render(fixWidth: contentWidth)
|
UserDef.kMoveCursorAfterSelectingCandidate.render(fixWidth: innerContentWidth)
|
||||||
UserDef.kUseDynamicCandidateWindowOrigin.render(fixWidth: contentWidth)
|
UserDef.kUseDynamicCandidateWindowOrigin.render(fixWidth: innerContentWidth)
|
||||||
UserDef.kDodgeInvalidEdgeCandidateCursorPosition.render(fixWidth: contentWidth)
|
UserDef.kDodgeInvalidEdgeCandidateCursorPosition.render(fixWidth: innerContentWidth)
|
||||||
UserDef.kUseJKtoMoveCompositorCursorInCandidateState
|
UserDef.kUseJKtoMoveCompositorCursorInCandidateState
|
||||||
.render(fixWidth: contentWidth) { renderable in
|
.render(fixWidth: innerContentWidth) { renderable in
|
||||||
renderable.currentControl?.target = self
|
renderable.currentControl?.target = self
|
||||||
renderable.currentControl?.action = #selector(self.useJKToMoveBufferCursorDidSet(_:))
|
renderable.currentControl?.action = #selector(self.useJKToMoveBufferCursorDidSet(_:))
|
||||||
}
|
}
|
||||||
|
@ -61,15 +63,15 @@ public extension SettingsPanesCocoa {
|
||||||
NSView()
|
NSView()
|
||||||
}
|
}
|
||||||
NSTabView.TabPage(title: "C") {
|
NSTabView.TabPage(title: "C") {
|
||||||
NSStackView.buildSection(width: contentWidth) {
|
NSStackView.buildSection(width: innerContentWidth) {
|
||||||
UserDef.kShowReverseLookupInCandidateUI.render(fixWidth: contentWidth)
|
UserDef.kShowReverseLookupInCandidateUI.render(fixWidth: innerContentWidth)
|
||||||
UserDef.kUseFixedCandidateOrderOnSelection.render(fixWidth: contentWidth)
|
UserDef.kUseFixedCandidateOrderOnSelection.render(fixWidth: innerContentWidth)
|
||||||
UserDef.kConsolidateContextOnCandidateSelection.render(fixWidth: contentWidth)
|
UserDef.kConsolidateContextOnCandidateSelection.render(fixWidth: innerContentWidth)
|
||||||
}?.boxed()
|
}?.boxed()
|
||||||
NSStackView.buildSection(width: contentWidth) {
|
NSStackView.buildSection(width: innerContentWidth) {
|
||||||
UserDef.kEnableMouseScrollingForTDKCandidatesCocoa.render(fixWidth: contentWidth)
|
UserDef.kEnableMouseScrollingForTDKCandidatesCocoa.render(fixWidth: innerContentWidth)
|
||||||
NSStackView.build(.horizontal) {
|
NSStackView.build(.horizontal) {
|
||||||
"Where's IMK Candidate Window?".makeNSLabel(fixWidth: contentWidth)
|
"Where's IMK Candidate Window?".makeNSLabel(fixWidth: innerContentWidth)
|
||||||
NSView()
|
NSView()
|
||||||
NSButton(verbatim: "...", target: self, action: #selector(whereIsIMKCandidatesWindow(_:)))
|
NSButton(verbatim: "...", target: self, action: #selector(whereIsIMKCandidatesWindow(_:)))
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,8 +13,11 @@ import Shared
|
||||||
|
|
||||||
public extension SettingsPanesCocoa {
|
public extension SettingsPanesCocoa {
|
||||||
class Cassette: NSViewController {
|
class Cassette: NSViewController {
|
||||||
let windowWidth: CGFloat = 577
|
var windowWidth: CGFloat { SettingsPanesCocoa.windowWidth }
|
||||||
let contentWidth: CGFloat = 512
|
var contentWidth: CGFloat { SettingsPanesCocoa.contentWidth }
|
||||||
|
var innerContentWidth: CGFloat { SettingsPanesCocoa.innerContentWidth }
|
||||||
|
var tabContainerWidth: CGFloat { SettingsPanesCocoa.tabContainerWidth }
|
||||||
|
var contentHalfWidth: CGFloat { SettingsPanesCocoa.contentHalfWidth }
|
||||||
let pctCassetteFilePath: NSPathControl = .init()
|
let pctCassetteFilePath: NSPathControl = .init()
|
||||||
|
|
||||||
override public func loadView() {
|
override public func loadView() {
|
||||||
|
@ -69,7 +72,7 @@ public extension SettingsPanesCocoa {
|
||||||
pathCtl.setContentHuggingPriority(.defaultHigh, for: .vertical)
|
pathCtl.setContentHuggingPriority(.defaultHigh, for: .vertical)
|
||||||
pathCtl.setContentCompressionResistancePriority(.defaultHigh, for: .horizontal)
|
pathCtl.setContentCompressionResistancePriority(.defaultHigh, for: .horizontal)
|
||||||
pathCtl.makeSimpleConstraint(.height, relation: .equal, value: NSFont.smallSystemFontSize * 2)
|
pathCtl.makeSimpleConstraint(.height, relation: .equal, value: NSFont.smallSystemFontSize * 2)
|
||||||
pathCtl.makeSimpleConstraint(.width, relation: .greaterThanOrEqual, value: 432)
|
pathCtl.makeSimpleConstraint(.width, relation: .greaterThanOrEqual, value: windowWidth - 145)
|
||||||
let currentPath = LMMgr.cassettePath()
|
let currentPath = LMMgr.cassettePath()
|
||||||
pathCtl.url = currentPath.isEmpty ? nil : URL(fileURLWithPath: LMMgr.cassettePath())
|
pathCtl.url = currentPath.isEmpty ? nil : URL(fileURLWithPath: LMMgr.cassettePath())
|
||||||
pathCtl.toolTip = "Please drag the desired target from Finder to this place.".localized
|
pathCtl.toolTip = "Please drag the desired target from Finder to this place.".localized
|
||||||
|
|
|
@ -12,8 +12,11 @@ import Shared
|
||||||
|
|
||||||
public extension SettingsPanesCocoa {
|
public extension SettingsPanesCocoa {
|
||||||
class DevZone: NSViewController {
|
class DevZone: NSViewController {
|
||||||
let windowWidth: CGFloat = 577
|
var windowWidth: CGFloat { SettingsPanesCocoa.windowWidth }
|
||||||
let contentWidth: CGFloat = 512
|
var contentWidth: CGFloat { SettingsPanesCocoa.contentWidth }
|
||||||
|
var innerContentWidth: CGFloat { SettingsPanesCocoa.innerContentWidth }
|
||||||
|
var tabContainerWidth: CGFloat { SettingsPanesCocoa.tabContainerWidth }
|
||||||
|
var contentHalfWidth: CGFloat { SettingsPanesCocoa.contentHalfWidth }
|
||||||
|
|
||||||
override public func loadView() {
|
override public func loadView() {
|
||||||
view = body ?? .init()
|
view = body ?? .init()
|
||||||
|
|
|
@ -14,8 +14,11 @@ import Shared
|
||||||
|
|
||||||
public extension SettingsPanesCocoa {
|
public extension SettingsPanesCocoa {
|
||||||
class Dictionary: NSViewController {
|
class Dictionary: NSViewController {
|
||||||
let windowWidth: CGFloat = 577
|
var windowWidth: CGFloat { SettingsPanesCocoa.windowWidth }
|
||||||
let contentWidth: CGFloat = 512
|
var contentWidth: CGFloat { SettingsPanesCocoa.contentWidth }
|
||||||
|
var innerContentWidth: CGFloat { SettingsPanesCocoa.innerContentWidth }
|
||||||
|
var tabContainerWidth: CGFloat { SettingsPanesCocoa.tabContainerWidth }
|
||||||
|
var contentHalfWidth: CGFloat { SettingsPanesCocoa.contentHalfWidth }
|
||||||
let pctUserDictionaryFolder: NSPathControl = .init()
|
let pctUserDictionaryFolder: NSPathControl = .init()
|
||||||
let dragRetrieverKimo: NSFileDragRetrieverButton = .init()
|
let dragRetrieverKimo: NSFileDragRetrieverButton = .init()
|
||||||
|
|
||||||
|
@ -108,7 +111,7 @@ public extension SettingsPanesCocoa {
|
||||||
pathCtl.setContentHuggingPriority(.defaultHigh, for: .vertical)
|
pathCtl.setContentHuggingPriority(.defaultHigh, for: .vertical)
|
||||||
pathCtl.setContentCompressionResistancePriority(.defaultHigh, for: .horizontal)
|
pathCtl.setContentCompressionResistancePriority(.defaultHigh, for: .horizontal)
|
||||||
pathCtl.makeSimpleConstraint(.height, relation: .equal, value: NSFont.smallSystemFontSize * 2)
|
pathCtl.makeSimpleConstraint(.height, relation: .equal, value: NSFont.smallSystemFontSize * 2)
|
||||||
pathCtl.makeSimpleConstraint(.width, relation: .greaterThanOrEqual, value: 432)
|
pathCtl.makeSimpleConstraint(.width, relation: .greaterThanOrEqual, value: windowWidth - 145)
|
||||||
pathCtl.url = URL(fileURLWithPath: LMMgr.dataFolderPath(isDefaultFolder: false))
|
pathCtl.url = URL(fileURLWithPath: LMMgr.dataFolderPath(isDefaultFolder: false))
|
||||||
pathCtl.toolTip = "Please drag the desired target from Finder to this place.".localized
|
pathCtl.toolTip = "Please drag the desired target from Finder to this place.".localized
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,9 +12,11 @@ import Shared
|
||||||
|
|
||||||
public extension SettingsPanesCocoa {
|
public extension SettingsPanesCocoa {
|
||||||
class General: NSViewController {
|
class General: NSViewController {
|
||||||
let windowWidth: CGFloat = 577
|
var windowWidth: CGFloat { SettingsPanesCocoa.windowWidth }
|
||||||
let contentWidth: CGFloat = 512
|
var contentWidth: CGFloat { SettingsPanesCocoa.contentWidth }
|
||||||
var contentHalfWidth: CGFloat { contentWidth / 2 - 4 }
|
var innerContentWidth: CGFloat { SettingsPanesCocoa.innerContentWidth }
|
||||||
|
var tabContainerWidth: CGFloat { SettingsPanesCocoa.tabContainerWidth }
|
||||||
|
var contentHalfWidth: CGFloat { SettingsPanesCocoa.contentHalfWidth }
|
||||||
var currentLanguageSelectItem: NSMenuItem?
|
var currentLanguageSelectItem: NSMenuItem?
|
||||||
let btnLangSelector = NSPopUpButton()
|
let btnLangSelector = NSPopUpButton()
|
||||||
let languages = ["auto", "en", "zh-Hans", "zh-Hant", "ja"]
|
let languages = ["auto", "en", "zh-Hans", "zh-Hant", "ja"]
|
||||||
|
|
|
@ -13,9 +13,11 @@ import Shared
|
||||||
|
|
||||||
public extension SettingsPanesCocoa {
|
public extension SettingsPanesCocoa {
|
||||||
class Keyboard: NSViewController {
|
class Keyboard: NSViewController {
|
||||||
let windowWidth: CGFloat = 577
|
var windowWidth: CGFloat { SettingsPanesCocoa.windowWidth }
|
||||||
let contentWidth: CGFloat = 512
|
var contentWidth: CGFloat { SettingsPanesCocoa.contentWidth }
|
||||||
var contentHalfWidth: CGFloat { contentWidth / 2 - 4 }
|
var innerContentWidth: CGFloat { SettingsPanesCocoa.innerContentWidth }
|
||||||
|
var tabContainerWidth: CGFloat { SettingsPanesCocoa.tabContainerWidth }
|
||||||
|
var contentHalfWidth: CGFloat { SettingsPanesCocoa.contentHalfWidth }
|
||||||
|
|
||||||
override public func loadView() {
|
override public func loadView() {
|
||||||
view = body ?? .init()
|
view = body ?? .init()
|
||||||
|
|
|
@ -12,8 +12,11 @@ import Shared
|
||||||
|
|
||||||
public extension SettingsPanesCocoa {
|
public extension SettingsPanesCocoa {
|
||||||
class Output: NSViewController {
|
class Output: NSViewController {
|
||||||
let windowWidth: CGFloat = 577
|
var windowWidth: CGFloat { SettingsPanesCocoa.windowWidth }
|
||||||
let contentWidth: CGFloat = 512
|
var contentWidth: CGFloat { SettingsPanesCocoa.contentWidth }
|
||||||
|
var innerContentWidth: CGFloat { SettingsPanesCocoa.innerContentWidth }
|
||||||
|
var tabContainerWidth: CGFloat { SettingsPanesCocoa.tabContainerWidth }
|
||||||
|
var contentHalfWidth: CGFloat { SettingsPanesCocoa.contentHalfWidth }
|
||||||
|
|
||||||
override public func loadView() {
|
override public func loadView() {
|
||||||
view = body ?? .init()
|
view = body ?? .init()
|
||||||
|
|
|
@ -13,8 +13,11 @@ import Shared
|
||||||
|
|
||||||
public extension SettingsPanesCocoa {
|
public extension SettingsPanesCocoa {
|
||||||
class Phrases: NSViewController {
|
class Phrases: NSViewController {
|
||||||
let windowWidth: CGFloat = 577
|
var windowWidth: CGFloat { SettingsPanesCocoa.windowWidth }
|
||||||
let contentWidth: CGFloat = 512
|
var contentWidth: CGFloat { SettingsPanesCocoa.contentWidth }
|
||||||
|
var innerContentWidth: CGFloat { SettingsPanesCocoa.innerContentWidth }
|
||||||
|
var tabContainerWidth: CGFloat { SettingsPanesCocoa.tabContainerWidth }
|
||||||
|
var contentHalfWidth: CGFloat { SettingsPanesCocoa.contentHalfWidth }
|
||||||
let cmbPEInputModeMenu = NSPopUpButton()
|
let cmbPEInputModeMenu = NSPopUpButton()
|
||||||
let cmbPEDataTypeMenu = NSPopUpButton()
|
let cmbPEDataTypeMenu = NSPopUpButton()
|
||||||
let btnPEReload = NSButton()
|
let btnPEReload = NSButton()
|
||||||
|
|
Loading…
Reference in New Issue