MCPcopy Create free account
hub / github.com/TranslucentTB/TranslucentTB / SetTaskbarSettings

Method SetTaskbarSettings

Xaml/Pages/TrayFlyoutPage.cpp:29–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27 }
28
29 void TrayFlyoutPage::SetTaskbarSettings(const txmp::TaskbarState &state, const txmp::TaskbarAppearance &appearance)
30 {
31 if (const auto submenu = GetSubMenuForState(state))
32 {
33 bool enabled = true;
34 if (const auto optAppearance = appearance.try_as<txmp::OptionalTaskbarAppearance>())
35 {
36 enabled = optAppearance.Enabled();
37 }
38
39 for (const auto item : submenu.Items())
40 {
41 const auto tag = item.Tag();
42 if (const auto radioItem = item.try_as<muxc::RadioMenuFlyoutItem>())
43 {
44 if (tag.try_as<txmp::AccentState>() == appearance.Accent())
45 {
46 radioItem.IsChecked(true);
47 }
48
49 radioItem.IsEnabled(enabled);
50 }
51 else if (const auto toggleItem = item.try_as<wuxc::ToggleMenuFlyoutItem>())
52 {
53 const auto stringTag = tag.try_as<hstring>();
54 if (stringTag == L"Enabled")
55 {
56 toggleItem.IsChecked(enabled);
57 }
58 else if (stringTag == L"ShowPeek")
59 {
60 toggleItem.IsChecked(appearance.ShowPeek());
61 toggleItem.IsEnabled(enabled);
62 }
63 else if (stringTag == L"ShowLine")
64 {
65 toggleItem.IsChecked(appearance.ShowLine());
66 toggleItem.IsEnabled(enabled);
67 }
68 }
69 else if (tag.try_as<hstring>() == L"Color")
70 {
71 item.IsEnabled(enabled && appearance.Accent() != txmp::AccentState::Normal);
72 }
73 }
74 }
75 }
76
77 void TrayFlyoutPage::SetTaskbarType(const txmp::TaskbarType &type)
78 {

Callers 1

RefreshMenuMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected