Skip to content

Commit

Permalink
fix: 标点符号设置界面
Browse files Browse the repository at this point in the history
  • Loading branch information
qwertyyb committed Jun 28, 2022
1 parent 7a575fb commit a220063
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 2 deletions.
4 changes: 4 additions & 0 deletions Fire.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
objects = {

/* Begin PBXBuildFile section */
4500AC622869F8CC006F3FCC /* PunctutionPane.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4500AC612869F8CC006F3FCC /* PunctutionPane.swift */; };
450B7D9A26A2847D00808A4D /* ApplicationPane.swift in Sources */ = {isa = PBXBuildFile; fileRef = 450B7D9926A2847D00808A4D /* ApplicationPane.swift */; };
451E6048232E227B007B0463 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 451E6047232E227B007B0463 /* AppDelegate.swift */; };
451E6056232E24A5007B0463 /* FireInputController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 451E6055232E24A5007B0463 /* FireInputController.swift */; };
Expand Down Expand Up @@ -76,6 +77,7 @@
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
4500AC612869F8CC006F3FCC /* PunctutionPane.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PunctutionPane.swift; sourceTree = "<group>"; };
450B7D9926A2847D00808A4D /* ApplicationPane.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ApplicationPane.swift; sourceTree = "<group>"; };
451E6044232E227B007B0463 /* Fire.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Fire.app; sourceTree = BUILT_PRODUCTS_DIR; };
451E6047232E227B007B0463 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -247,6 +249,7 @@
450B7D9926A2847D00808A4D /* ApplicationPane.swift */,
45DB6EC827E609CB00A39925 /* ThemePane.swift */,
45EBB54F283A311C00A56CBA /* StatisticsPane.swift */,
4500AC612869F8CC006F3FCC /* PunctutionPane.swift */,
);
path = Preferences;
sourceTree = "<group>";
Expand Down Expand Up @@ -466,6 +469,7 @@
45577EA1254552110064325B /* ThesaurusPane.swift in Sources */,
451E6056232E24A5007B0463 /* FireInputController.swift in Sources */,
451E605F232E400B007B0463 /* Fire.swift in Sources */,
4500AC622869F8CC006F3FCC /* PunctutionPane.swift in Sources */,
45587F2D24E8FBFB005F291B /* Utils.swift in Sources */,
45577E502543F03F0064325B /* build.swift in Sources */,
45D996AA253C5232001460A8 /* GeneralPane.swift in Sources */,
Expand Down
3 changes: 1 addition & 2 deletions Fire/Fire.swift
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,10 @@ class Fire: NSObject {
}
if queryStatement != nil {
sqlite3_finalize(queryStatement)
queryStatement = nil
}
if sqlite3_prepare_v2(database, getStatementSql(), -1, &queryStatement, nil) == SQLITE_OK {
print("prepare ok")
print(sqlite3_bind_parameter_index(queryStatement, ":code"))
print(sqlite3_bind_parameter_count(queryStatement))
} else if let err = sqlite3_errmsg(database) {
print("prepare fail: \(err)")
}
Expand Down
55 changes: 55 additions & 0 deletions Fire/Preferences/PunctutionPane.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
//
// PunctutionPane.swift
// Fire
//
// Created by 虚幻 on 2022/6/27.
// Copyright © 2022 qwertyyb. All rights reserved.
//

import SwiftUI
import Preferences

struct PunctutionItem: Identifiable {
let id = UUID()
let input: String
let output: String
}

struct PunctutionPane: View {
let data = [
PunctutionItem(input: "+", output: ""),
PunctutionItem(input: "-", output: "")
]
@State private var selected = "b"
var body: some View {
Preferences.Container(contentWidth: 450) {
Preferences.Section(title: "") {
GroupBox(label: Text("标点符号")) {
HStack {
Text("按键")
.frame(width: 200, alignment: .center)
Text("输出")
.frame(width: 200, alignment: .center)
}
List(data) { item in
VStack {
HStack(spacing: 0) {
Text(item.input)
.frame(width: 200, alignment: .center)
Text(item.output)
.frame(width: 200, alignment: .center)
}
Divider()
}
}
}
}
}
}
}

struct PunctutionPane_Previews: PreviewProvider {
static var previews: some View {
PunctutionPane()
}
}

0 comments on commit a220063

Please sign in to comment.