Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2304c0d

Browse files
committed
scaling
1 parentc29bf39 commit2304c0d

File tree

3 files changed

+16
-12
lines changed

3 files changed

+16
-12
lines changed

‎Coder-Desktop/Coder-Desktop/VPN/VPNProgress.swift

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ struct VPNProgressView: View {
1313
varbody:someView{
1414
VStack{
1515
CircularProgressView(value: value)
16-
// We'll estimate that the last25% takes9 seconds
16+
// We estimate that the lasthalf takes8 seconds
1717
// so it doesn't appear stuck
18-
.autoComplete(threshold:0.75, duration:9)
18+
.autoComplete(threshold:0.5, duration:8)
1919
Text(progressMessage)
2020
.multilineTextAlignment(.center)
2121
}
@@ -42,7 +42,7 @@ struct VPNProgressView: View {
4242
}
4343
switch progress.stage{
4444
case.initial:
45-
return0.10
45+
return0.05
4646
case.downloading:
4747
guardlet downloadProgress= progress.downloadProgresselse{
4848
// We can't make this illegal state unrepresentable because XPC
@@ -52,17 +52,17 @@ struct VPNProgressView: View {
5252
// 40MB if the server doesn't give us the expected size
5353
lettotalBytes= downloadProgress.totalBytesToWrite??40_000_000
5454
letdownloadPercent=min(1.0,Float(downloadProgress.totalBytesWritten)/ Float(totalBytes))
55-
return0.10+0.6* downloadPercent
55+
return0.05+0.4* downloadPercent
5656
case.validating:
57-
return0.71
57+
return0.42
5858
case.removingQuarantine:
59-
return0.72
59+
return0.44
6060
case.opening:
61-
return0.73
61+
return0.46
6262
case.settingUpTunnel:
63-
return0.74
63+
return0.48
6464
case.startingTunnel:
65-
return0.75
65+
return0.50
6666
}
6767
}
6868
}

‎Coder-Desktop/Coder-Desktop/Views/VPN/Agents.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ struct Agents<VPN: VPNService>: View {
3333
if hasToggledExpansion{
3434
return
3535
}
36-
expandedItem= visibleItems.first?.id
36+
withAnimation(.snappy(duration:Theme.Animation.collapsibleDuration)){
37+
expandedItem= visibleItems.first?.id
38+
}
3739
hasToggledExpansion=true
3840
}
3941
if items.count==0{

‎Coder-Desktop/VPNLib/Download.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,7 @@ extension DownloadManager: URLSessionDownloadDelegate {
238238
tryFileManager.default.moveItem(at: location, to: dest)
239239
}catch{
240240
continuation.resume(throwing:DownloadError.fileOpError(error))
241+
return
241242
}
242243

243244
continuation.resume()
@@ -278,7 +279,8 @@ extension DownloadManager: URLSessionDownloadDelegate {
278279
overridepublicvardescription:String{
279280
letfmt=ByteCountFormatter()
280281
letdone= fmt.string(fromByteCount: totalBytesWritten)
281-
lettot= totalBytesToWrite.map{ fmt.string(fromByteCount: $0)}??"Unknown"
282-
return"\(done) /\(tot)"
282+
.padding(toLength:7, withPad:"", startingAt:0)
283+
lettotal= totalBytesToWrite.map{ fmt.string(fromByteCount: $0)}??"Unknown"
284+
return"\(done) /\(total)"
283285
}
284286
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp