Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
cranci1 committed May 25, 2024
1 parent 0f8e77f commit c93c7ef
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 19 deletions.
Binary file not shown.
25 changes: 16 additions & 9 deletions AnimeGen/Main.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -498,13 +498,13 @@ Enable Gestures: Enable to utilize app gestures: (App Restart is required)
<rect key="frame" x="0.0" y="0.0" width="343" height="43.666667938232422"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="image Width" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="UDs-Oc-hEv">
<rect key="frame" x="15" y="13" width="86.333333333333329" height="18"/>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="image Width:" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="UDs-Oc-hEv">
<rect key="frame" x="15" y="13" width="90.333333333333329" height="18"/>
<fontDescription key="fontDescription" type="system" pointSize="15"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<stepper opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" value="1" minimumValue="0.10000000000000001" maximumValue="1" stepValue="0.10000000000000001" translatesAutoresizingMaskIntoConstraints="NO" id="TOe-1L-GWw">
<stepper opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" value="1" minimumValue="0.10000000000000001" maximumValue="1" stepValue="0.050000000000000003" translatesAutoresizingMaskIntoConstraints="NO" id="TOe-1L-GWw">
<rect key="frame" x="233" y="5" width="94" height="32"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<connections>
Expand All @@ -525,13 +525,13 @@ Enable Gestures: Enable to utilize app gestures: (App Restart is required)
<rect key="frame" x="0.0" y="0.0" width="343" height="43.666667938232422"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="image Height" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="YJd-M3-kCv">
<rect key="frame" x="15" y="13" width="91" height="18"/>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Image Height:" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="YJd-M3-kCv">
<rect key="frame" x="15" y="13" width="95.666666666666671" height="18"/>
<fontDescription key="fontDescription" type="system" pointSize="15"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<stepper opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" value="0.59999999999999998" minimumValue="0.10000000000000001" maximumValue="1" stepValue="0.10000000000000001" translatesAutoresizingMaskIntoConstraints="NO" id="45h-a0-mF3">
<stepper opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" value="0.59999999999999998" minimumValue="0.10000000000000001" maximumValue="1" stepValue="0.050000000000000003" translatesAutoresizingMaskIntoConstraints="NO" id="45h-a0-mF3">
<rect key="frame" x="233" y="6" width="94" height="32"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<connections>
Expand Down Expand Up @@ -588,9 +588,11 @@ Enable Gestures: Enable to utilize app gestures: (App Restart is required)
<outlet property="Buttons" destination="w9I-ox-pfk" id="1dW-ds-tpE"/>
<outlet property="Gestures" destination="Axu-nh-KBG" id="dnh-9P-om5"/>
<outlet property="Gradient" destination="VlR-Jj-EGT" id="OjE-gp-IbB"/>
<outlet property="heightLabel" destination="YJd-M3-kCv" id="HyO-gK-IZZ"/>
<outlet property="segmentedControl" destination="VWg-Nc-mKy" id="Anm-HT-s2A"/>
<outlet property="stepperHeight" destination="45h-a0-mF3" id="AZB-pb-F6g"/>
<outlet property="stepperWidth" destination="TOe-1L-GWw" id="6wn-B2-bOC"/>
<outlet property="widthLabel" destination="UDs-Oc-hEv" id="z7L-BY-PUv"/>
</connections>
</tableViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="AZb-pI-yQY" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
Expand Down Expand Up @@ -1301,9 +1303,6 @@ along with AnimeGen. If not, see &lt;https://www.gnu.org/licenses/&gt;.</string>
<buttonConfiguration key="configuration" style="plain" image="trash" catalog="system" title=" Clear History">
<fontDescription key="titleFontDescription" type="system" pointSize="15"/>
</buttonConfiguration>
<connections>
<action selector="clearButtonTapped:" destination="j4T-B9-g7w" eventType="touchUpInside" id="n0R-Em-vsb"/>
</connections>
</button>
</subviews>
<constraints>
Expand All @@ -1312,6 +1311,9 @@ along with AnimeGen. If not, see &lt;https://www.gnu.org/licenses/&gt;.</string>
</constraints>
</tableViewCellContentView>
<gestureRecognizers/>
<connections>
<outletCollection property="gestureRecognizers" destination="Ygb-sk-Iyb" appends="YES" id="cW1-Wx-GPK"/>
</connections>
</tableViewCell>
</cells>
</tableViewSection>
Expand All @@ -1327,6 +1329,11 @@ along with AnimeGen. If not, see &lt;https://www.gnu.org/licenses/&gt;.</string>
</connections>
</tableViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="U4k-W9-TJs" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
<tapGestureRecognizer id="Ygb-sk-Iyb" userLabel="clearHist">
<connections>
<action selector="clearButtonTapped:" destination="j4T-B9-g7w" id="om9-1M-ywA"/>
</connections>
</tapGestureRecognizer>
</objects>
<point key="canvasLocation" x="3516" y="-857.14285714285722"/>
</scene>
Expand Down
6 changes: 0 additions & 6 deletions AnimeGen/NotificationCenter/AppPreff.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,4 @@ extension ViewController {
self.lightmode = isEnabled
}
}

@objc func handleButtons(_ notification: Notification) {
handleNotification(notification, key: "enableButtons") { isEnabled in
self.buttons = isEnabled
}
}
}
20 changes: 17 additions & 3 deletions AnimeGen/Settings/FeaturesApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ class FeaturesApp: UITableViewController {
@IBOutlet weak var ActivityLabel: UISwitch!
@IBOutlet weak var Buttons: UISwitch!

@IBOutlet weak var widthLabel: UILabel!
@IBOutlet weak var heightLabel: UILabel!

override func viewDidLoad() {
super.viewDidLoad()

Expand All @@ -40,6 +43,9 @@ class FeaturesApp: UITableViewController {
Gestures.isOn = UserDefaults.standard.bool(forKey: "enableGestures")
ActivityLabel.isOn = UserDefaults.standard.bool(forKey: "enableTime")
Buttons.isOn = UserDefaults.standard.bool(forKey: "enableButtons")

updateWidthLabel()
updateHeightLabel()
}

@IBAction func switchAnimations(_ sender: UISwitch) {
Expand All @@ -65,18 +71,18 @@ class FeaturesApp: UITableViewController {
}

@IBAction func switctchButtons(_ sender: UISwitch) {
let isEnabled = sender.isOn
UserDefaults.standard.set(isEnabled, forKey: "enableButtons")
NotificationCenter.default.post(name: Notification.Name("EnableButtons"), object: nil, userInfo: ["enableButtons": isEnabled])
UserDefaults.standard.set(sender.isOn, forKey: "enableButtons")
}

@IBAction func widthStepperChangeds(_ sender: UIStepper) {
Settings.shared.imageWidth = sender.value
updateWidthLabel()
print("New imageWidth: \(Settings.shared.imageWidth)")
}

@IBAction func heightStepperChangeds(_ sender: UIStepper) {
Settings.shared.imageHeight = sender.value
updateHeightLabel()
print("New imageHeight: \(Settings.shared.imageHeight)")
}

Expand All @@ -89,4 +95,12 @@ class FeaturesApp: UITableViewController {

NotificationCenter.default.post(name: Notification.Name("EnabledLightMode"), object: nil, userInfo: ["enabledLightMode": isEnabledLightMode])
}

func updateWidthLabel() {
widthLabel.text = String(format: "Images Width: %.2f", Settings.shared.imageWidth)
}

func updateHeightLabel() {
heightLabel.text = String(format: "Images Height: %.2f", Settings.shared.imageHeight)
}
}
1 change: 0 additions & 1 deletion AnimeGen/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,6 @@ class ViewController: UIViewController {
NotificationCenter.default.addObserver(self, selector: #selector(handleTime(_:)), name: Notification.Name("EnableTime"), object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(handleGestures(_:)), name: Notification.Name("EnableGestures"), object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(handleLightMode(_:)), name: Notification.Name("EnabledLightMode"), object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(handleButtons(_:)), name: Notification.Name("EnableButtons"), object: nil)

// Content
NotificationCenter.default.addObserver(self, selector: #selector(handleParentMode(_:)), name: Notification.Name("ParentsModeLoL"), object: nil)
Expand Down

0 comments on commit c93c7ef

Please sign in to comment.