Skip to content

Commit

Permalink
#371 minor code and comment formatting + changelog update
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewtavis committed Oct 31, 2023
1 parent 1edfd53 commit 859bf2f
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 15 deletions.
7 changes: 4 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,16 @@ Emojis for the following are chosen based on [gitmoji](https://gitmoji.dev/).

### ✨ New Features

- German indefinite pronouns are now selectable from the case-declension display.
- German imperfect verb conjugations now insert both the auxiliary verb and the past participle with the cursor between them.
- Adds a new menu to the Scribe app allowing users to set their preferences for their respective language keyboards!
- Users now have easy access to the Scribe GitHub, the Matrix community, rating the app, sending bug reports and emailing the team.
- Settings options include:
- Allowing the user to add a command and period to the letter keys.
- Allowing the user to disable emoji autosuggestions and autocompletions.
- Allowing the user to disable accented characters on the letter keys.
- Mneu screens can be swiped between via an implementation using SwipeableTabBarController.
- Menu screens can be swiped between via an implementation using SwipeableTabBarController.
- German indefinite pronouns are now selectable from the case-declension display.
- German imperfect verb conjugations now insert both the auxiliary verb and the past participle with the cursor between them.
- Tab and caps lock keys and their functionalities have been added to expanded iPad layouts ([#371](https://github.com/scribe-org/Scribe-iOS/issues/371)).

### 🎨 Design Changes

Expand Down
5 changes: 3 additions & 2 deletions Keyboards/InterfaceConstants.swift
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
//
// Scribe
//
// Constants for Scribe keyboard interfaces.
//

struct SpecialKeys {

enum SpecialKeys {
static let indent = "indent"
static let capsLock = "capslock"
}
9 changes: 4 additions & 5 deletions Keyboards/KeyboardsBase/KeyboardKeys.swift
Original file line number Diff line number Diff line change
Expand Up @@ -261,9 +261,9 @@ class KeyboardKey: UIButton {
widthAnchor.constraint(equalToConstant: numSymKeyWidth * 1).isActive = true
} else if ["123", ".?123", "return", "hideKeyboard"].contains(key) {
if key == "return"
&& (controllerLanguage == "Portuguese" || controllerLanguage == "Italian" || commandState == .translate)
&& row == 1
&& DeviceType.isPad
&& (controllerLanguage == "Portuguese" || controllerLanguage == "Italian" || commandState == .translate)
&& row == 1
&& DeviceType.isPad
{
layer.setValue(true, forKey: "isSpecial")
widthAnchor.constraint(equalToConstant: numSymKeyWidth * 1.5).isActive = true
Expand Down Expand Up @@ -295,7 +295,6 @@ class KeyboardKey: UIButton {

case SpecialKeys.capsLock:
switch capsLockButtonState {

case .normal:
backgroundColor = specialKeyColor
styleIconBtn(btn: self, color: UIColor.label, iconName: "capslock")
Expand All @@ -311,7 +310,7 @@ class KeyboardKey: UIButton {

styleIconBtn(btn: self, color: UIColor.label, iconName: "shift.fill")
} else if DeviceType.isPhone && capsLockButtonState == .locked {
// We need to style the SHIFT button instead of the CAPSLOCK since the keyboard is smaller
// We need to style the SHIFT button instead of the CAPSLOCK since the keyboard is smaller.
backgroundColor = keyPressedColor

styleIconBtn(btn: self, color: UIColor.label, iconName: "capslock.fill")
Expand Down
8 changes: 4 additions & 4 deletions Keyboards/KeyboardsBase/KeyboardViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1938,7 +1938,7 @@ class KeyboardViewController: UIInputViewController {
// Set the width of the key given device and the given key.
btn.adjustKeyWidth()

// Update the button style
// Update the button style.
btn.adjustButtonStyle()

if key == "return" && proxy.keyboardType == .webSearch && ![.translate, .conjugate, .plural].contains(commandState) {
Expand Down Expand Up @@ -2066,7 +2066,7 @@ class KeyboardViewController: UIInputViewController {
let letterKeysHaveCommaPeriod = userDefaults.bool(forKey: dictionaryKey)

if letterKeysHaveCommaPeriod {
let spaceIndex = letterKeys[3].firstIndex(where: {$0 == "space"})
let spaceIndex = letterKeys[3].firstIndex(where: { $0 == "space" })
letterKeys[3].insert(",", at: spaceIndex!)
letterKeys[3].insert(".", at: spaceIndex! + 2)
}
Expand Down Expand Up @@ -2499,7 +2499,7 @@ class KeyboardViewController: UIInputViewController {

case "shift":
if capsLockButtonState == .locked {
// Return capitalization to default
// Return capitalization to default.
capsLockButtonState = .normal
shiftButtonState = .normal
} else {
Expand Down Expand Up @@ -2685,7 +2685,7 @@ class KeyboardViewController: UIInputViewController {
}

private func switchToFullCaps() {
// Return SHIFT button to normal state as the ALLCAPS button will be enabled
// Return SHIFT button to normal state as the CAPSLOCK button will be enabled.
shiftButtonState = .normal
capsLockButtonState = capsLockButtonState == .normal ? .locked : .normal

Expand Down
2 changes: 1 addition & 1 deletion Keyboards/KeyboardsBase/ScribeFunctionality/Annotate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ func typedWordAnnotation(KVC: KeyboardViewController) {
guard let lastWordTyped = wordsTyped.secondToLast() else {
return
}

if !languagesWithCapitalizedNouns.contains(controllerLanguage) {
wordToCheck = lastWordTyped.lowercased()
} else {
Expand Down

0 comments on commit 859bf2f

Please sign in to comment.