clean up client.cpp
This commit is contained in:
		
							parent
							
								
									09873f0ed9
								
							
						
					
					
						commit
						9bb2c01a44
					
				|  | @ -47,7 +47,6 @@ class Client { | |||
|   static void handleOutputDone(void *, struct zxdg_output_v1 *); | ||||
|   static void handleOutputName(void *, struct zxdg_output_v1 *, const char *); | ||||
|   static void handleOutputDescription(void *, struct zxdg_output_v1 *, const char *); | ||||
|   void handleAppearanceChanged(waybar::Appearance appearance); | ||||
|   void handleMonitorAdded(Glib::RefPtr<Gdk::Monitor> monitor); | ||||
|   void handleMonitorRemoved(Glib::RefPtr<Gdk::Monitor> monitor); | ||||
|   void handleDeferredMonitorRemoval(Glib::RefPtr<Gdk::Monitor> monitor); | ||||
|  |  | |||
|  | @ -154,9 +154,7 @@ void waybar::Client::handleDeferredMonitorRemoval(Glib::RefPtr<Gdk::Monitor> mon | |||
| const std::string waybar::Client::getStyle(const std::string &style, | ||||
|                                            std::optional<Appearance> appearance = std::nullopt) { | ||||
|   std::optional<std::string> css_file; | ||||
|   if (!style.empty()) { | ||||
|     css_file = style; | ||||
|   } else { | ||||
|   if (style.empty()) { | ||||
|     std::vector<std::string> search_files; | ||||
|     switch (appearance.value_or(portal->getAppearance())) { | ||||
|       case waybar::Appearance::LIGHT: | ||||
|  | @ -170,6 +168,8 @@ const std::string waybar::Client::getStyle(const std::string &style, | |||
|     } | ||||
|     search_files.push_back("style.css"); | ||||
|     css_file = Config::findConfigPath(search_files); | ||||
|   } else { | ||||
|     css_file = style; | ||||
|   } | ||||
|   if (!css_file) { | ||||
|     throw std::runtime_error("Missing required resource files"); | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue