diff --git a/packages/ghaf-audio-control/src/app/App.cpp b/packages/ghaf-audio-control/src/app/App.cpp index a389dfa..6e9c083 100644 --- a/packages/ghaf-audio-control/src/app/App.cpp +++ b/packages/ghaf-audio-control/src/app/App.cpp @@ -9,23 +9,19 @@ #include -#include - using namespace ghaf::AudioControl; namespace { constexpr auto AppId = "Ghaf Audio Control"; -constexpr auto IconName = "audio-volume-high-panel"; -constexpr auto IconSize = 64; struct AppArgs { Glib::ustring pulseServerAddress; - Glib::ustring indicatorIconPath; + Glib::ustring indicatorIconName; Glib::ustring appVms; - bool isDeamonMode = false; + Glib::ustring isDeamonMode; }; std::vector GetAppVmsList(const std::string& appVms) @@ -41,18 +37,6 @@ std::vector GetAppVmsList(const std::string& appVms) return result; } -std::optional GetThemeIcon() -{ - auto icon_theme = Gtk::IconTheme::get_default(); - - if (auto iconInfo = icon_theme->lookup_icon(IconName, IconSize, Gtk::ICON_LOOKUP_USE_BUILTIN)) - return iconInfo.get_filename().c_str(); - - Logger::error("App::getThemeIcon: couldn't found an icon"); - - return std::nullopt; -} - } // namespace App::AppMenu::AppMenu(App& app) @@ -79,9 +63,9 @@ App::App(int argc, char** argv) pulseServerOption.set_long_name("pulseaudio_server"); pulseServerOption.set_description("PulseAudio server address"); - Glib::OptionEntry indicatorIconPathOption; - indicatorIconPathOption.set_long_name("indicator_icon_path"); - indicatorIconPathOption.set_description("Tray's icon indicator path"); + Glib::OptionEntry indicatorIconNameOption; + indicatorIconNameOption.set_long_name("indicator_icon_name"); + indicatorIconNameOption.set_description("Tray's icon indicator name"); Glib::OptionEntry appVmsOption; appVmsOption.set_long_name("app_vms"); @@ -93,7 +77,7 @@ App::App(int argc, char** argv) Glib::OptionGroup options("Main", "Main"); options.add_entry(pulseServerOption, appArgs.pulseServerAddress); - options.add_entry(indicatorIconPathOption, appArgs.indicatorIconPath); + options.add_entry(indicatorIconNameOption, appArgs.indicatorIconName); options.add_entry(appVmsOption, appArgs.appVms); options.add_entry(deamonModeOption, appArgs.isDeamonMode); @@ -106,6 +90,11 @@ App::App(int argc, char** argv) throw std::runtime_error{"Couldn't parse the command line arguments"}; } + Logger::info("Parsed the option: '{}' = '{}'", pulseServerOption.get_long_name().c_str(), appArgs.pulseServerAddress.c_str()); + Logger::info("Parsed the option: '{}' = '{}'", indicatorIconNameOption.get_long_name().c_str(), appArgs.indicatorIconName.c_str()); + Logger::info("Parsed the option: '{}' = '{}'", appVmsOption.get_long_name().c_str(), appArgs.appVms.c_str()); + Logger::info("Parsed the option: '{}' = '{}'", deamonModeOption.get_long_name().c_str(), appArgs.isDeamonMode.c_str()); + m_connections += signal_command_line().connect( [this]([[maybe_unused]] const Glib::RefPtr& args) { @@ -114,11 +103,7 @@ App::App(int argc, char** argv) }, false); - if (const auto iconPath = GetThemeIcon()) - { - Logger::info("Got icon path for the indicator: {}", iconPath->c_str()); - app_indicator_set_icon(m_indicator.get(), iconPath->filename().c_str()); - } + app_indicator_set_icon(m_indicator.get(), appArgs.indicatorIconName.c_str()); m_audioControl = std::make_unique(std::make_unique(appArgs.pulseServerAddress), GetAppVmsList(appArgs.appVms)); diff --git a/packages/ghaf-audio-control/src/app/main.cpp b/packages/ghaf-audio-control/src/app/main.cpp index e304f89..37ad2f9 100644 --- a/packages/ghaf-audio-control/src/app/main.cpp +++ b/packages/ghaf-audio-control/src/app/main.cpp @@ -5,8 +5,6 @@ #include "App.hpp" -#include - using namespace ghaf::AudioControl; int main(int argc, char** argv) diff --git a/packages/ghaf-audio-control/src/lib/src/widgets/AppList.cpp b/packages/ghaf-audio-control/src/lib/src/widgets/AppList.cpp index c3e572d..2d00731 100644 --- a/packages/ghaf-audio-control/src/lib/src/widgets/AppList.cpp +++ b/packages/ghaf-audio-control/src/lib/src/widgets/AppList.cpp @@ -18,8 +18,6 @@ #include #include -#include - namespace ghaf::AudioControl { diff --git a/packages/ghaf-audio-control/src/lib/src/widgets/AudioControl.cpp b/packages/ghaf-audio-control/src/lib/src/widgets/AudioControl.cpp index 997b815..708119e 100644 --- a/packages/ghaf-audio-control/src/lib/src/widgets/AudioControl.cpp +++ b/packages/ghaf-audio-control/src/lib/src/widgets/AudioControl.cpp @@ -16,14 +16,12 @@ #include -#include - namespace ghaf::AudioControl { constexpr auto CssStyle = "button#AppVmNameButton { background-color: transparent; border: none; font-weight: bold; }" - "box#DeviceWidget { background: #e6e6e6; border-radius: 15px; }" - "label#EmptyListName { background: #e6e6e6; border-radius: 15px; min-height: 40px; }" + "box#DeviceWidget { border-radius: 15px; }" + "label#EmptyListName { border-radius: 15px; min-height: 40px; }" "*:selected { background-color: transparent; color: inherit; box-shadow: none; outline: none; }"; template