| 106 | } |
| 107 | |
| 108 | void MainAppWindow::TaskbarSettingsChanged(const txmp::TaskbarState &state, const txmp::TaskbarAppearance &appearance) |
| 109 | { |
| 110 | auto &config = GetConfigForState(state); |
| 111 | |
| 112 | // restore color because the context menu doesn't transmit that info |
| 113 | appearance.Color(config.Color); |
| 114 | |
| 115 | if (const auto optAppearance = appearance.try_as<txmp::OptionalTaskbarAppearance>()) |
| 116 | { |
| 117 | if (state == txmp::TaskbarState::Desktop) [[unlikely]] |
| 118 | { |
| 119 | throw std::invalid_argument("Desktop appearance is not optional"); |
| 120 | } |
| 121 | |
| 122 | static_cast<OptionalTaskbarAppearance &>(config) = optAppearance; |
| 123 | } |
| 124 | else |
| 125 | { |
| 126 | config = appearance; |
| 127 | } |
| 128 | |
| 129 | m_App.GetWorker().ConfigurationChanged(); |
| 130 | } |
| 131 | |
| 132 | void MainAppWindow::ColorRequested(const txmp::TaskbarState &state) |
| 133 | { |
no test coverage detected