Skip to content

Commit

Permalink
feat: 管理员身份下不展示提示
Browse files Browse the repository at this point in the history
  • Loading branch information
Blinue committed May 8, 2024
1 parent eebba08 commit 38e44d8
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Magpie.App/HomePage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@
</local:SettingsCard>
<muxc:InfoBar x:Uid="Home_TouchSupport_InfoBar"
IsClosable="False"
IsOpen="{x:Bind ViewModel.IsTouchSupportEnabled, Mode=OneWay}"
IsOpen="{x:Bind ViewModel.IsShowTouchSupportInfoBar, Mode=OneWay}"
Severity="Informational">
<muxc:InfoBar.Resources>
<ResourceDictionary Source="ms-appx:///Magpie.App/BlueInfoBar.xaml" />
Expand Down
7 changes: 6 additions & 1 deletion src/Magpie.App/HomeViewModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ bool HomeViewModel::IsTouchSupportEnabled() const noexcept {
}

fire_and_forget HomeViewModel::IsTouchSupportEnabled(bool value) {
if (TouchHelper::IsTouchSupportEnabled() == value) {
if (IsTouchSupportEnabled() == value) {
co_return;
}

Expand All @@ -209,9 +209,14 @@ fire_and_forget HomeViewModel::IsTouchSupportEnabled(bool value) {

if (weakThis.get()) {
RaisePropertyChanged(L"IsTouchSupportEnabled");
RaisePropertyChanged(L"IsShowTouchSupportInfoBar");
}
}

bool HomeViewModel::IsShowTouchSupportInfoBar() const noexcept {
return !Win32Utils::IsProcessElevated() && IsTouchSupportEnabled();
}

bool HomeViewModel::IsAllowScalingMaximized() const noexcept {
return AppSettings::Get().IsAllowScalingMaximized();
}
Expand Down
2 changes: 2 additions & 0 deletions src/Magpie.App/HomeViewModel.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ struct HomeViewModel : HomeViewModelT<HomeViewModel>, wil::notify_property_chang
bool IsTouchSupportEnabled() const noexcept;
fire_and_forget IsTouchSupportEnabled(bool value);

bool IsShowTouchSupportInfoBar() const noexcept;

bool IsAllowScalingMaximized() const noexcept;
void IsAllowScalingMaximized(bool value);

Expand Down
1 change: 1 addition & 0 deletions src/Magpie.App/HomeViewModel.idl
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ namespace Magpie.App {
void ClearRestore();

Boolean IsTouchSupportEnabled;
Boolean IsShowTouchSupportInfoBar { get; };
Boolean IsAllowScalingMaximized;
Boolean IsInlineParams;
Boolean IsSimulateExclusiveFullscreen;
Expand Down

0 comments on commit 38e44d8

Please sign in to comment.