Skip to content

Commit f78d57c

Browse files
committed
fix: update msg disappear after fetching new version
1 parent 4403c30 commit f78d57c

File tree

4 files changed

+63
-55
lines changed

4 files changed

+63
-55
lines changed

3rd/shad-ui

src/Everywhere/I18N/Strings.resx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,7 @@
620620
<value>Check for updates</value>
621621
</data>
622622
<data name="Settings_Common_SoftwareUpdate_TextBlock_Run1_Text" xml:space="preserve">
623-
<value>Current version: v{0}</value>
623+
<value>Current version: {0}</value>
624624
</data>
625625
<data name="Settings_Common_SoftwareUpdate_TextBlock_Run2_Text" xml:space="preserve">
626626
<value>Last check time: </value>
@@ -629,7 +629,7 @@
629629
<value>Release notes</value>
630630
</data>
631631
<data name="Settings_Common_SoftwareUpdate_PerformUpdateButton_Content" xml:space="preserve">
632-
<value>Update to v</value>
632+
<value>Update to </value>
633633
</data>
634634
<data name="Common_Unknown" xml:space="preserve">
635635
<value>Unknown</value>
@@ -638,7 +638,7 @@
638638
<value>Everywhere is already the latest version.</value>
639639
</data>
640640
<data name="Settings_Common_SoftwareUpdate_Toast_NewVersionFound" xml:space="preserve">
641-
<value>New version v{0} found.</value>
641+
<value>New version {0} found.</value>
642642
</data>
643643
<data name="Settings_Common_SoftwareUpdate_Header" xml:space="preserve">
644644
<value>Software Update</value>

src/Everywhere/I18N/Strings.zh-hans.resx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,7 @@
603603
<value>错误</value>
604604
</data>
605605
<data name="Settings_Common_SoftwareUpdate_TextBlock_Run1_Text" xml:space="preserve">
606-
<value>当前版本: v{0}</value>
606+
<value>当前版本: {0}</value>
607607
</data>
608608
<data name="Settings_Common_SoftwareUpdate_TextBlock_Run2_Text" xml:space="preserve">
609609
<value>上次检查时间: </value>
@@ -615,7 +615,7 @@
615615
<value>检查更新</value>
616616
</data>
617617
<data name="Settings_Common_SoftwareUpdate_PerformUpdateButton_Content" xml:space="preserve">
618-
<value>更新到 v</value>
618+
<value>更新到 </value>
619619
</data>
620620
<data name="Common_Unknown" xml:space="preserve">
621621
<value>未知</value>
@@ -624,7 +624,7 @@
624624
<value>Everywhere 已是最新版本。</value>
625625
</data>
626626
<data name="Settings_Common_SoftwareUpdate_Toast_NewVersionFound" xml:space="preserve">
627-
<value>发现新版本: v{0}</value>
627+
<value>发现新版本: {0}</value>
628628
</data>
629629
<data name="Settings_Common_SoftwareUpdate_Header" xml:space="preserve">
630630
<value>软件更新</value>

src/Everywhere/Views/Configuration/SoftwareUpdateControl.cs

Lines changed: 56 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -30,63 +30,71 @@ public SoftwareUpdateControl(
3030
Orientation = Orientation.Horizontal;
3131
Children.AddRange(
3232
[
33-
new TextBlock
33+
new StackPanel
3434
{
35-
Inlines =
36-
[
37-
new Run
38-
{
39-
[!Run.TextProperty] = new FormattedDynamicResourceKey(
40-
LocaleKey.Settings_Common_SoftwareUpdate_TextBlock_Run1_Text,
41-
new DirectResourceKey(softwareUpdater.CurrentVersion.ToString(3))).ToBinding()
42-
},
43-
new LineBreak(),
44-
new Run
35+
Children =
36+
{
37+
new TextBlock
4538
{
46-
[!Run.TextProperty] = new DynamicResourceKey(LocaleKey.Settings_Common_SoftwareUpdate_TextBlock_Run2_Text).ToBinding()
39+
[!TextBlock.TextProperty] = new FormattedDynamicResourceKey(
40+
LocaleKey.Settings_Common_SoftwareUpdate_TextBlock_Run1_Text,
41+
new DirectResourceKey(softwareUpdater.CurrentVersion.ToString(3)))
42+
.ToBinding()
4743
},
48-
new Run
44+
new StackPanel
4945
{
50-
[!Run.TextProperty] = new Binding
46+
Orientation = Orientation.Horizontal,
47+
Children =
5148
{
52-
Path = $"{nameof(Settings.Common)}.{nameof(Settings.Common.LastUpdateCheckTime)}",
53-
Source = settings,
54-
Converter = CommonConverters.DateTimeOffsetToString,
55-
ConverterParameter = "G",
56-
Mode = BindingMode.OneWay
49+
new TextBlock
50+
{
51+
[!TextBlock.TextProperty] =
52+
new DynamicResourceKey(LocaleKey.Settings_Common_SoftwareUpdate_TextBlock_Run2_Text).ToBinding()
53+
},
54+
new TextBlock
55+
{
56+
[!TextBlock.TextProperty] = new Binding
57+
{
58+
Path = $"{nameof(Settings.Common)}.{nameof(Settings.Common.LastUpdateCheckTime)}",
59+
Source = settings,
60+
Converter = CommonConverters.DateTimeOffsetToString,
61+
ConverterParameter = "G",
62+
Mode = BindingMode.OneWay
63+
}
64+
},
5765
}
5866
},
59-
new LineBreak(),
60-
new InlineUIContainer
67+
new Button
6168
{
62-
Child = new Button
69+
Classes = { "Ghost" },
70+
HorizontalAlignment = HorizontalAlignment.Left,
71+
Content = new TextBlock
6372
{
64-
Classes = { "Ghost" },
65-
Content = new TextBlock
66-
{
67-
Inlines =
68-
[
69-
new Run
70-
{
71-
TextDecorations = TextDecorations.Underline,
72-
[!TextElement.ForegroundProperty] = new DynamicResourceExtension("InfoColor"),
73-
[!Run.TextProperty] = new DynamicResourceKey(
74-
LocaleKey.Settings_Common_SoftwareUpdate_TextBlock_ReleaseNotes_Text).ToBinding()
75-
}
76-
]
77-
},
78-
Command = new AsyncRelayCommand(() =>
79-
ServiceLocator.Resolve<ILauncher>()
80-
.LaunchUriAsync(new Uri("https://github.com/DearVa/Everywhere/releases", UriKind.Absolute))
81-
),
82-
CornerRadius = new CornerRadius(1),
83-
Height = double.NaN,
84-
MinHeight = 0,
85-
Padding = new Thickness(),
86-
}
87-
}
88-
],
89-
VerticalAlignment = VerticalAlignment.Center,
73+
Inlines =
74+
[
75+
new Run
76+
{
77+
TextDecorations = TextDecorations.Underline,
78+
[!TextElement.ForegroundProperty] = new DynamicResourceExtension("InfoColor"),
79+
[!Run.TextProperty] = new DynamicResourceKey(
80+
LocaleKey.Settings_Common_SoftwareUpdate_TextBlock_ReleaseNotes_Text)
81+
.ToBinding()
82+
}
83+
]
84+
},
85+
Command = new AsyncRelayCommand(() =>
86+
ServiceLocator.Resolve<ILauncher>()
87+
.LaunchUriAsync(
88+
new Uri(
89+
"https://github.com/DearVa/Everywhere/releases",
90+
UriKind.Absolute))
91+
),
92+
CornerRadius = new CornerRadius(1),
93+
Height = double.NaN,
94+
MinHeight = 0,
95+
Padding = new Thickness(),
96+
},
97+
}
9098
},
9199
new Button
92100
{

0 commit comments

Comments
 (0)