diff --git a/src/panel/panel.cpp b/src/panel/panel.cpp index 562799a7..0c184fa1 100644 --- a/src/panel/panel.cpp +++ b/src/panel/panel.cpp @@ -109,6 +109,7 @@ class WayfirePanel::impl { window = std::make_unique(output, "panel"); window->set_size_request(1, minimal_panel_height); + window->get_style_context()->add_class("wf-panel"); panel_layer.set_callback(set_panel_layer); set_panel_layer(); // initial setting @@ -147,6 +148,9 @@ class WayfirePanel::impl void init_layout() { + left_box.get_style_context()->add_class("left"); + center_box.get_style_context()->add_class("center"); + right_box.get_style_context()->add_class("right"); content_box.pack_start(left_box, false, false); content_box.pack_end(right_box, false, false); if (!center_box.get_children().empty()) diff --git a/src/panel/widgets/battery.cpp b/src/panel/widgets/battery.cpp index 409bcd0b..33db42aa 100644 --- a/src/panel/widgets/battery.cpp +++ b/src/panel/widgets/battery.cpp @@ -232,6 +232,7 @@ void WayfireBatteryInfo::init(Gtk::HBox *container) } button_box.add(icon); + button.get_style_context()->add_class("battery"); button.get_style_context()->add_class("flat"); status_opt.set_callback([=] () { update_details(); }); diff --git a/src/panel/widgets/clock.cpp b/src/panel/widgets/clock.cpp index 19dd0d7d..8d1c1b05 100644 --- a/src/panel/widgets/clock.cpp +++ b/src/panel/widgets/clock.cpp @@ -5,6 +5,7 @@ void WayfireClock::init(Gtk::HBox *container) { button = std::make_unique("panel"); + button->get_style_context()->add_class("clock"); button->add(label); button->show(); label.show(); @@ -12,6 +13,7 @@ void WayfireClock::init(Gtk::HBox *container) update_label(); calendar.show(); + button->get_popover()->get_style_context()->add_class("clock-popover"); button->get_popover()->add(calendar); button->get_popover()->signal_show().connect_notify( sigc::mem_fun(this, &WayfireClock::on_calendar_shown)); diff --git a/src/panel/widgets/command-output.cpp b/src/panel/widgets/command-output.cpp index 6997f055..871220c9 100644 --- a/src/panel/widgets/command-output.cpp +++ b/src/panel/widgets/command-output.cpp @@ -53,6 +53,8 @@ WfCommandOutputButtons::CommandOutput::CommandOutput(const std::string & name, set_image_icon(icon, icon_name, icon_size, {}); } + get_style_context()->add_class("command-output"); + main_label.set_ellipsize(Pango::ELLIPSIZE_END); main_label.set_max_width_chars(max_chars_opt); max_chars_opt.set_callback([=] @@ -138,6 +140,7 @@ WfCommandOutputButtons::CommandOutput::CommandOutput(const std::string & name, void WfCommandOutputButtons::init(Gtk::HBox *container) { + box.get_style_context()->add_class("command-output-box"); container->pack_start(box, false, false); update_buttons(); commands_list_opt.set_callback([=] { update_buttons(); }); diff --git a/src/panel/widgets/menu.cpp b/src/panel/widgets/menu.cpp index 0504fa96..0511f2fe 100644 --- a/src/panel/widgets/menu.cpp +++ b/src/panel/widgets/menu.cpp @@ -16,7 +16,7 @@ #include "wf-autohide-window.hpp" #define MAX_LAUNCHER_NAME_LENGTH 11 -const std::string default_icon = ICONDIR "/wayfire.png"; +const std::string default_icon = "wayfire"; WfMenuCategory::WfMenuCategory(std::string _name, std::string _icon_name) : name(_name), icon_name(_icon_name) @@ -832,6 +832,8 @@ void WayfireMenu::init(Gtk::HBox *container) category_list["Hidden"] = std::make_unique("Other Desktops", "user-desktop"); + main_image.get_style_context()->add_class("menu-icon"); + output->toggle_menu_signal().connect(sigc::mem_fun(this, &WayfireMenu::toggle_menu)); menu_icon.set_callback([=] () { update_icon(); }); @@ -842,6 +844,9 @@ void WayfireMenu::init(Gtk::HBox *container) button = std::make_unique("panel"); button->add(main_image); + auto style = button->get_style_context(); + style->add_class("menu-button"); + style->add_class("flat"); button->get_popover()->set_constrain_to(Gtk::POPOVER_CONSTRAINT_NONE); button->get_popover()->signal_show().connect_notify( sigc::mem_fun(this, &WayfireMenu::on_popover_shown)); diff --git a/src/panel/widgets/network.cpp b/src/panel/widgets/network.cpp index 16072bd1..69180cd4 100644 --- a/src/panel/widgets/network.cpp +++ b/src/panel/widgets/network.cpp @@ -399,6 +399,10 @@ void WayfireNetworkInfo::init(Gtk::HBox *container) return; } + auto style = button.get_style_context(); + style->add_class("flat"); + style->add_class("network"); + container->add(button); button.add(button_content); button.get_style_context()->add_class("flat"); diff --git a/src/panel/widgets/notifications/notification-center.cpp b/src/panel/widgets/notifications/notification-center.cpp index 03839709..d73d74b0 100644 --- a/src/panel/widgets/notifications/notification-center.cpp +++ b/src/panel/widgets/notifications/notification-center.cpp @@ -9,6 +9,7 @@ void WayfireNotificationCenter::init(Gtk::HBox *container) { button = std::make_unique("panel"); + button->get_style_context()->add_class("notification-center"); updateIcon(); button->add(icon); diff --git a/src/panel/widgets/spacing.cpp b/src/panel/widgets/spacing.cpp index 4a6b7cf4..c91aaa4a 100644 --- a/src/panel/widgets/spacing.cpp +++ b/src/panel/widgets/spacing.cpp @@ -7,6 +7,7 @@ WayfireSpacing::WayfireSpacing(int pixels) void WayfireSpacing::init(Gtk::HBox *container) { + box.get_style_context()->add_class("spacing"); container->pack_start(box); box.show_all(); } diff --git a/src/panel/widgets/tray/item.cpp b/src/panel/widgets/tray/item.cpp index 42f8bef1..ae9b1e46 100644 --- a/src/panel/widgets/tray/item.cpp +++ b/src/panel/widgets/tray/item.cpp @@ -69,6 +69,9 @@ void StatusNotifierItem::init_widget() icon_size.set_callback([this] { update_icon(); }); setup_tooltip(); init_menu(); + auto style = get_style_context(); + style->add_class("tray-box"); + style->add_class("flat"); signal_button_press_event().connect([this] (GdkEventButton *ev) -> bool { diff --git a/src/panel/widgets/tray/tray.cpp b/src/panel/widgets/tray/tray.cpp index 0ad2a427..9ad618f3 100644 --- a/src/panel/widgets/tray/tray.cpp +++ b/src/panel/widgets/tray/tray.cpp @@ -2,6 +2,7 @@ void WayfireStatusNotifier::init(Gtk::HBox *container) { + icons_hbox.get_style_context()->add_class("tray"); icons_hbox.set_spacing(5); container->add(icons_hbox); } diff --git a/src/panel/widgets/volume.cpp b/src/panel/widgets/volume.cpp index 7582cc6c..0870ae1c 100644 --- a/src/panel/widgets/volume.cpp +++ b/src/panel/widgets/volume.cpp @@ -252,9 +252,8 @@ void WayfireVolume::init(Gtk::HBox *container) /* Setup button */ button = std::make_unique("panel"); auto style = button->get_style_context(); - style->context_save(); - style->set_state(Gtk::STATE_FLAG_NORMAL & ~Gtk::STATE_FLAG_PRELIGHT); - button->reset_style(); + style->add_class("volume"); + style->add_class("flat"); button->set_events(Gdk::SCROLL_MASK | Gdk::SMOOTH_SCROLL_MASK | Gdk::BUTTON_PRESS_MASK); button->signal_scroll_event().connect_notify( sigc::mem_fun(this, &WayfireVolume::on_volume_scroll)); diff --git a/src/panel/widgets/window-list/toplevel.cpp b/src/panel/widgets/window-list/toplevel.cpp index 7e1eb430..25952f80 100644 --- a/src/panel/widgets/window-list/toplevel.cpp +++ b/src/panel/widgets/window-list/toplevel.cpp @@ -57,6 +57,7 @@ class WayfireToplevel::impl zwlr_foreign_toplevel_handle_v1_add_listener(handle, &toplevel_handle_v1_impl, this); + button.get_style_context()->add_class("window-button"); button_contents.add(image); button_contents.add(label); button_contents.set_halign(Gtk::ALIGN_START); diff --git a/src/panel/widgets/window-list/window-list.cpp b/src/panel/widgets/window-list/window-list.cpp index 997ac588..650d7494 100644 --- a/src/panel/widgets/window-list/window-list.cpp +++ b/src/panel/widgets/window-list/window-list.cpp @@ -185,6 +185,8 @@ void WayfireWindowList::init(Gtk::HBox *container) return; } + scrolled_window.get_style_context()->add_class("window-list"); + wl_registry_destroy(registry); zwlr_foreign_toplevel_manager_v1_add_listener(manager, &toplevel_manager_v1_impl, this);