Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Scribe.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -884,6 +884,7 @@
D1F0367227AAE12200CD7921 /* InterfaceVariables.swift in Sources */ = {isa = PBXBuildFile; fileRef = D190B2492741B31F00705659 /* InterfaceVariables.swift */; };
D1F0367327AAE1B400CD7921 /* CommandVariables.swift in Sources */ = {isa = PBXBuildFile; fileRef = D190B2462741B24F00705659 /* CommandVariables.swift */; };
E937C5CF2E9FF94E00F94F99 /* TranslationData.sqlite in Resources */ = {isa = PBXBuildFile; fileRef = D1E3850F2C977FD100DCE538 /* TranslationData.sqlite */; };
E96111482F04EC6B001E4F95 /* InstallationDownload.swift in Sources */ = {isa = PBXBuildFile; fileRef = E96111472F04EC62001E4F95 /* InstallationDownload.swift */; };
E996495A2E98A12100200F53 /* GRDB in Frameworks */ = {isa = PBXBuildFile; productRef = E99649592E98A12100200F53 /* GRDB */; };
E996495B2E98A31B00200F53 /* KeyboardProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 198369CB2C7980BA00C1B583 /* KeyboardProvider.swift */; };
E996495C2E98A32900200F53 /* KeyboardViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D190B2592742565500705659 /* KeyboardViewController.swift */; };
Expand Down Expand Up @@ -1238,6 +1239,7 @@
D1D8B23D2AE408C50070B817 /* French.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = French.entitlements; sourceTree = "<group>"; };
D1E3850F2C977FD100DCE538 /* TranslationData.sqlite */ = {isa = PBXFileReference; lastKnownFileType = file; path = TranslationData.sqlite; sourceTree = "<group>"; };
D1FF8ED12C6C282500EF50AC /* English.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = English.entitlements; sourceTree = "<group>"; };
E96111472F04EC62001E4F95 /* InstallationDownload.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InstallationDownload.swift; sourceTree = "<group>"; };
E9FAC3882E9894F9008E00AC /* IDCommandVariables.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IDCommandVariables.swift; sourceTree = "<group>"; };
E9FAC3892E9894F9008E00AC /* IDInterfaceVariables.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IDInterfaceVariables.swift; sourceTree = "<group>"; };
E9FAC38A2E9894F9008E00AC /* IDKeyboardViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IDKeyboardViewController.swift; sourceTree = "<group>"; };
Expand All @@ -1254,6 +1256,7 @@
/* End PBXFileReference section */

/* Begin PBXFileSystemSynchronizedRootGroup section */
E943457E2F05638700DFDB20 /* Button */ = {isa = PBXFileSystemSynchronizedRootGroup; explicitFileTypes = {}; explicitFolders = (); path = Button; sourceTree = "<group>"; };
E9DADB332EF3CF9B00702783 /* ConfirmDialog */ = {isa = PBXFileSystemSynchronizedRootGroup; explicitFileTypes = {}; explicitFolders = (); path = ConfirmDialog; sourceTree = "<group>"; };
/* End PBXFileSystemSynchronizedRootGroup section */

Expand Down Expand Up @@ -1398,6 +1401,7 @@
1406B7882A2DFE4C001DF45B /* InstallationTab */ = {
isa = PBXGroup;
children = (
E96111472F04EC62001E4F95 /* InstallationDownload.swift */,
1455C87A2BD0EE4200F12BD4 /* DownloadDataTable.swift */,
1455C87B2BD0EE4200F12BD4 /* DownloadDataVC.swift */,
38BD213522D5907F00C6795D /* InstallationVC.swift */,
Expand Down Expand Up @@ -1496,6 +1500,7 @@
38BD213222D5907F00C6795D /* Scribe */ = {
isa = PBXGroup;
children = (
E943457E2F05638700DFDB20 /* Button */,
E9DADB332EF3CF9B00702783 /* ConfirmDialog */,
147797A92A2CD2B50044A53E /* AboutTab */,
D1A2DCAF27AD378F0057A10D /* AppTexts */,
Expand Down Expand Up @@ -1920,6 +1925,7 @@
E9FAC3992E989712008E00AC /* PBXTargetDependency */,
);
fileSystemSynchronizedGroups = (
E943457E2F05638700DFDB20 /* Button */,
E9DADB332EF3CF9B00702783 /* ConfirmDialog */,
);
name = Scribe;
Expand Down Expand Up @@ -2617,6 +2623,7 @@
147797B02A2CD3370044A53E /* InfoChildTableViewCell.swift in Sources */,
D1A2DCB427AD3EB50057A10D /* AppUISymbols.swift in Sources */,
D171945427AF04E50038660B /* KeyboardViewController.swift in Sources */,
E96111482F04EC6B001E4F95 /* InstallationDownload.swift in Sources */,
EDEE62252B2DE65A00A0B9C1 /* UIEdgeInsetsExtensions.swift in Sources */,
D1CDED772A859E4800098546 /* DACommandVariables.swift in Sources */,
D171943827AEF0560038660B /* KeyboardStyling.swift in Sources */,
Expand Down
45 changes: 45 additions & 0 deletions Scribe/Button/CTAButton.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// SPDX-License-Identifier: GPL-3.0-or-later

/**
* Call to Action Button.
*/

import SwiftUI

struct CTAButton: View {
let title: String
let action: () -> Void
@Environment(\.colorScheme) var colorScheme

var body: some View {
Button(action: action) {
Text(title)
.font(.system(size: 20, weight: .bold))
.foregroundColor(Color("lightTextDarkCTA"))
.frame(maxWidth: .infinity)
.padding(.vertical, 16)
.background(Color("appBtn"))
.cornerRadius(12)
.overlay(
RoundedRectangle(cornerRadius: 12)
.stroke(colorScheme == .dark ? Color("scribeCTA") : Color.clear, lineWidth: 1)
)
.shadow(
color: Color(red: 0.247, green: 0.247, blue: 0.275, opacity: 0.25),
radius: 3,
x: 0,
y: 3
)
}
.buttonStyle(CTAButtonStyle())
}
}

struct CTAButtonStyle: ButtonStyle {
func makeBody(configuration: Configuration) -> some View {
configuration.label
.scaleEffect(configuration.isPressed ? 0.98 : 1.0)
.opacity(configuration.isPressed ? 0.8 : 1.0)
.animation(.easeOut(duration: 0.15), value: configuration.isPressed)
}
}
56 changes: 56 additions & 0 deletions Scribe/InstallationTab/InstallationDownload.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
// SPDX-License-Identifier: GPL-3.0-or-later

/**
* Download button for the Installation tab.
*/

import SwiftUI

struct CardView: View {
let title: String
let mainText: String
let subtitle: String
let action: () -> Void

var body: some View {
VStack(alignment: .leading, spacing: 6) {
Text(title)
.font(.system(size: 19, weight: .semibold))
.foregroundColor(.primary)

VStack(alignment: .leading, spacing: 6) {
HStack {
Text(mainText)
.font(.body)
.foregroundColor(.primary)

Spacer()

Image(systemName: "chevron.right")
.foregroundColor(.gray)
}

Text(subtitle)
.font(.subheadline)
.foregroundColor(.secondary)
}
.padding()
.background(Color(.systemBackground))
.cornerRadius(12)
.onTapGesture(perform: action)
}
.padding(.horizontal)
}
}

struct InstallationDownload: View {
var body: some View {
CardView(
title: NSLocalizedString("app.installation.download.title", value: "Language data", comment: ""),
mainText: NSLocalizedString("app.installation.download.main_text", value: "Download keyboard data", comment: ""),
subtitle: NSLocalizedString("app.installation.download.subtitle", value: "Add new data to Scribe keyboards.", comment: "")
) {
print("Card tapped")
}
}
}
Loading
Loading