Skip to content

Commit

Permalink
Adding Wine Retina mode
Browse files Browse the repository at this point in the history
  • Loading branch information
marzent committed Feb 2, 2022
1 parent 3a19062 commit 8edff4a
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 2 deletions.
Binary file not shown.
5 changes: 3 additions & 2 deletions XIV on Mac/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -1303,12 +1303,12 @@ Gw
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="buc-8R-1Wp">
<rect key="frame" x="174" y="21" width="64" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="check" title="Retina" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="7vx-YJ-IUo">
<buttonCell key="cell" type="check" title="Retina" bezelStyle="regularSquare" imagePosition="left" inset="2" id="7vx-YJ-IUo">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<action selector="saveState:" target="GIg-v3-M8h" id="HeB-xt-rJP"/>
<action selector="updateRetina:" target="GIg-v3-M8h" id="vpB-lR-4wX"/>
</connections>
</button>
</subviews>
Expand Down Expand Up @@ -1356,6 +1356,7 @@ Gw
<outlet property="submissions" destination="SxV-dE-5eD" id="iAS-Sl-rkN"/>
<outlet property="version" destination="PxN-EU-Qcp" id="zNF-t4-Eyo"/>
<outlet property="wineDebugField" destination="qGE-fd-l1u" id="tHW-rs-7ze"/>
<outlet property="wineRetina" destination="buc-8R-1Wp" id="izP-cS-C72"/>
</connections>
</viewController>
<customObject id="tpD-0Q-AJh" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
Expand Down
6 changes: 6 additions & 0 deletions XIV on Mac/SettingsController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class SettingsController: NSViewController {
@IBOutlet private var async: NSButton!
@IBOutlet private var esync: NSButton!
@IBOutlet private var wineDebugField: NSTextField!
@IBOutlet private var wineRetina: NSButton!
@IBOutlet weak var discord: NSButton!

private var mapping: [String : NSButton] = [:]
Expand Down Expand Up @@ -74,6 +75,10 @@ class SettingsController: NSViewController {
saveState()
}

@IBAction func updateRetina(_ sender: NSButton) {
Wine.retina = (sender.state == NSControl.StateValue.on)
}

func updateView() {
for (option, enabled) in Util.dxvkOptions.hud {
mapping[option]?.state = enabled ? NSControl.StateValue.on : NSControl.StateValue.off
Expand All @@ -86,6 +91,7 @@ class SettingsController: NSViewController {
discord.state = SocialIntegration.discord.enabled ? NSControl.StateValue.on : NSControl.StateValue.off
scale.doubleValue = Util.dxvkOptions.hudScale
esync.state = Wine.esync ? NSControl.StateValue.on : NSControl.StateValue.off
wineRetina.state = Wine.retina ? NSControl.StateValue.on : NSControl.StateValue.off
wineDebugField.stringValue = Wine.debug
}

Expand Down
11 changes: 11 additions & 0 deletions XIV on Mac/Wine.swift
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,15 @@ struct Wine {
launch(args: ["winecfg", "-v", version], blocking: true)
}

private static let retinaSettingKey = "RetinaMode"
static var retina: Bool {
get {
return Util.getSetting(settingKey: retinaSettingKey, defaultValue: false)
}
set(_retina) {
addReg(key: "HKEY_CURRENT_USER\\Software\\Wine\\Mac Driver", value: "RetinaMode", data: _retina ? "y" : "n")
UserDefaults.standard.set(_retina, forKey: retinaSettingKey)
}
}

}

0 comments on commit 8edff4a

Please sign in to comment.