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 handleOutputDone(void *, struct zxdg_output_v1 *);
|
||||||
static void handleOutputName(void *, struct zxdg_output_v1 *, const char *);
|
static void handleOutputName(void *, struct zxdg_output_v1 *, const char *);
|
||||||
static void handleOutputDescription(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 handleMonitorAdded(Glib::RefPtr<Gdk::Monitor> monitor);
|
||||||
void handleMonitorRemoved(Glib::RefPtr<Gdk::Monitor> monitor);
|
void handleMonitorRemoved(Glib::RefPtr<Gdk::Monitor> monitor);
|
||||||
void handleDeferredMonitorRemoval(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,
|
const std::string waybar::Client::getStyle(const std::string &style,
|
||||||
std::optional<Appearance> appearance = std::nullopt) {
|
std::optional<Appearance> appearance = std::nullopt) {
|
||||||
std::optional<std::string> css_file;
|
std::optional<std::string> css_file;
|
||||||
if (!style.empty()) {
|
if (style.empty()) {
|
||||||
css_file = style;
|
|
||||||
} else {
|
|
||||||
std::vector<std::string> search_files;
|
std::vector<std::string> search_files;
|
||||||
switch (appearance.value_or(portal->getAppearance())) {
|
switch (appearance.value_or(portal->getAppearance())) {
|
||||||
case waybar::Appearance::LIGHT:
|
case waybar::Appearance::LIGHT:
|
||||||
|
@ -170,6 +168,8 @@ const std::string waybar::Client::getStyle(const std::string &style,
|
||||||
}
|
}
|
||||||
search_files.push_back("style.css");
|
search_files.push_back("style.css");
|
||||||
css_file = Config::findConfigPath(search_files);
|
css_file = Config::findConfigPath(search_files);
|
||||||
|
} else {
|
||||||
|
css_file = style;
|
||||||
}
|
}
|
||||||
if (!css_file) {
|
if (!css_file) {
|
||||||
throw std::runtime_error("Missing required resource files");
|
throw std::runtime_error("Missing required resource files");
|
||||||
|
|
Loading…
Reference in New Issue