diff --git a/metadata/panel.xml b/metadata/panel.xml
index 10756ceb..83b8ff9c 100644
--- a/metadata/panel.xml
+++ b/metadata/panel.xml
@@ -43,6 +43,12 @@ If full_span is off, both sides of the panel will take the same amount of space,
<_long>Minimum width the panel takes.
32
+
+ <_short>Default Icon Size
+ <_long>The default size of all icons, excluding those directly on the panel
+ 32
+ 1
+
<_short>Autohide
false
@@ -145,7 +151,7 @@ If full_span is off, both sides of the panel will take the same amount of space,
<_short>Launchers Icon Size
- 42
+ 0
0
@@ -275,7 +281,7 @@ If full_span is off, both sides of the panel will take the same amount of space,
<_short>Menu Icon Size
- 42
+ 0
0
diff --git a/src/locker/plugin/network.cpp b/src/locker/plugin/network.cpp
index 1e68f0c2..779c2861 100644
--- a/src/locker/plugin/network.cpp
+++ b/src/locker/plugin/network.cpp
@@ -28,7 +28,7 @@ void WayfireLockerNetworkPluginWidget::set_connection(std::shared_ptr n
{
for (auto clas : box.get_css_classes())
{
- if ((clas == "flat") || (clas == "network") || (clas == "widget-icon"))
+ if ((clas == "network"))
{
continue;
}
diff --git a/src/panel/panel.cpp b/src/panel/panel.cpp
index 8aac03fa..91ffd1ba 100644
--- a/src/panel/panel.cpp
+++ b/src/panel/panel.cpp
@@ -601,18 +601,19 @@ void WayfirePanelApp::on_activate()
const static std::vector> icon_sizes_args =
{
- {"panel/minimal_height", ""},
- {"panel/menu_icon_size", ".menu-icon"},
- {"panel/menu_item_icon_size", ".app-button"},
- {"panel/launchers_size", ".launcher"},
- {"panel/battery_icon_size", ".battery image"},
- {"panel/network_icon_size", ".network"},
- {"panel/volume_icon_size", ".volume"},
- {"panel/mixer_icon_size", ".mixer"},
- {"panel/mixer_popup_icon_size", ".mute-toggle, .default-button"},
- {"panel/notifications_icon_size", ".notification-center "},
- {"panel/tray_icon_size", ".tray-button"},
- {"panel/brightness_icon_size", ".brightness"}
+ {"panel/minimal_height", ".widget-icon"},
+ {"panel/default_icon_size", ".default-icon"},
+ {"panel/menu_icon_size", ".menu-icon.widget-icon"},
+ {"panel/menu_item_icon_size", ".app-button.widget-icon"},
+ {"panel/launchers_size", ".launcher.widget-icon"},
+ {"panel/battery_icon_size", ".battery image.widget-icon"},
+ {"panel/network_icon_size", ".network.widget-icon"},
+ {"panel/volume_icon_size", ".volume.widget-icon"},
+ {"panel/mixer_icon_size", ".mixer.widget-icon"},
+ {"panel/mixer_popup_icon_size", ".mute-toggle.widget-icon, .default-button.widget-icon"},
+ {"panel/notifications_icon_size", ".notification-center .widget-icon"},
+ {"panel/tray_icon_size", ".tray-button.widget-icon"},
+ {"panel/brightness_icon_size", ".brightness.widget-icon"}
};
for (auto pair : icon_sizes_args)
{
diff --git a/src/panel/widgets/brightness/brightness.cpp b/src/panel/widgets/brightness/brightness.cpp
index 656a97ef..bf1f699b 100644
--- a/src/panel/widgets/brightness/brightness.cpp
+++ b/src/panel/widgets/brightness/brightness.cpp
@@ -124,7 +124,7 @@ void WayfireBrightness::init(Gtk::Box *container)
button->set_child(icon);
button->show();
button->open_on(1);
- button->add_css_class("widget-icon");
+ icon.add_css_class("widget-icon");
// layout
box.set_orientation(Gtk::Orientation::VERTICAL);
diff --git a/src/panel/widgets/launchers.cpp b/src/panel/widgets/launchers.cpp
index d356fa0c..9c7b5fa3 100644
--- a/src/panel/widgets/launchers.cpp
+++ b/src/panel/widgets/launchers.cpp
@@ -159,7 +159,6 @@ launcher_container WayfireLaunchers::get_launchers_from_config()
void WayfireLaunchers::init(Gtk::Box *container)
{
- box.add_css_class("widget-icon");
box.add_css_class("launchers");
container->append(box);
diff --git a/src/panel/widgets/menu.cpp b/src/panel/widgets/menu.cpp
index 63e297be..56821cfc 100644
--- a/src/panel/widgets/menu.cpp
+++ b/src/panel/widgets/menu.cpp
@@ -164,6 +164,8 @@ WfMenuCategoryButton::WfMenuCategoryButton(WayfireMenu *_menu, std::string _cate
m_image.set_pixel_size(32);
m_label.set_text(label);
m_label.set_xalign(0.0);
+ m_label.add_css_class("default-icon");
+
m_box.append(m_image);
m_box.append(m_label);
@@ -191,7 +193,7 @@ WfMenuItem::WfMenuItem(WayfireMenu *_menu, Glib::RefPtr app
Gtk::FlowBoxChild(), menu(_menu), app_info(app)
{
image.set((const Glib::RefPtr&)app->get_icon());
-
+ image.add_css_class("default-icon");
label.set_text(app->get_name());
label.set_ellipsize(Pango::EllipsizeMode::END);
@@ -201,8 +203,6 @@ WfMenuItem::WfMenuItem(WayfireMenu *_menu, Glib::RefPtr app
extra_actions_button.set_has_frame(false);
box.set_expand(false);
- box.add_css_class("flat");
- box.add_css_class("widget-icon");
box.add_css_class("app-button");
auto left_click_g = Gtk::GestureClick::create();
diff --git a/src/panel/widgets/mixer/mixer-control.cpp b/src/panel/widgets/mixer/mixer-control.cpp
index d599c68b..bda9301d 100644
--- a/src/panel/widgets/mixer/mixer-control.cpp
+++ b/src/panel/widgets/mixer/mixer-control.cpp
@@ -32,8 +32,7 @@ void MixerControl::init()
add_css_class("mixer-control");
button.set_child(volume_icon);
button.add_css_class("mute-toggle");
- button.add_css_class("widget-icon");
- button.add_css_class("flat");
+ volume_icon.add_css_class("default-icon");
scale.set_range(0.0, 1.0);
scale.set_size_request(slider_length, 0);
@@ -226,11 +225,10 @@ void MixerControlDevice::init()
{
add_css_class("mixer-control");
default_btn.add_css_class("default-button");
- default_btn.add_css_class("widget-icon");
- default_btn.add_css_class("flat");
is_def_icon.set_from_icon_name("emblem-default");
default_btn.set_child(is_def_icon);
+ is_def_icon.add_css_class("default-icon");
// we are not using ToggleButton groups because on_default_nodes_changed
// will be called anyway to set the status of all devices
diff --git a/src/panel/widgets/mixer/mixer.cpp b/src/panel/widgets/mixer/mixer.cpp
index a20f318e..b789e339 100644
--- a/src/panel/widgets/mixer/mixer.cpp
+++ b/src/panel/widgets/mixer/mixer.cpp
@@ -159,7 +159,6 @@ void WayfireMixer::init(Gtk::Box *container)
// sets up the "widget part"
button = std::make_unique("panel", "mixer");
- button->add_css_class("widget-icon");
button->append(main_image);
button->show();
button->open_on(-1); // the gestures callback will take care of opening and closing
@@ -168,6 +167,7 @@ void WayfireMixer::init(Gtk::Box *container)
streams_box.add_css_class("streams");
out_in_wall.add_css_class("out-in");
in_streams_wall.add_css_class("in-streams");
+ main_image.add_css_class("widget-icon");
button->set_popup_child(master_box);
diff --git a/src/panel/widgets/network.cpp b/src/panel/widgets/network.cpp
index 122a6782..63929d7b 100644
--- a/src/panel/widgets/network.cpp
+++ b/src/panel/widgets/network.cpp
@@ -16,13 +16,10 @@ void WayfireNetworkInfo::init(Gtk::Box *container)
{
network_manager = NetworkManager::getInstance();
button = std::make_unique("panel", "network");
- button->add_css_class("widget-icon");
- button->add_css_class("flat");
button->add_css_class("network");
container->append(*button);
button->append(button_content);
- button->add_css_class("flat");
button->set_popup_child(control);
@@ -33,6 +30,7 @@ void WayfireNetworkInfo::init(Gtk::Box *container)
button->open_on(1);
icon.set_valign(Gtk::Align::CENTER);
+ icon.add_css_class("widget-icon");
auto show_hide_label = [this] ()
{
@@ -80,7 +78,7 @@ void WayfireNetworkInfo::set_connection(std::shared_ptr network)
{
for (auto clas : button_content.get_css_classes())
{
- if ((clas == "flat") || (clas == "network") || (clas == "widget-icon"))
+ if (clas == "network")
{
continue;
}
diff --git a/src/panel/widgets/tray/item.cpp b/src/panel/widgets/tray/item.cpp
index e515ae91..2eb60df8 100644
--- a/src/panel/widgets/tray/item.cpp
+++ b/src/panel/widgets/tray/item.cpp
@@ -77,7 +77,7 @@ void StatusNotifierItem::init_widget()
update_icon();
setup_tooltip();
init_menu();
- add_css_class("widget-icon");
+ icon.add_css_class("widget-icon");
add_css_class("tray-button");
auto scroll_gesture = Gtk::EventControllerScroll::create();
diff --git a/src/panel/widgets/window-list/toplevel.cpp b/src/panel/widgets/window-list/toplevel.cpp
index 18b8dc14..eba54736 100644
--- a/src/panel/widgets/window-list/toplevel.cpp
+++ b/src/panel/widgets/window-list/toplevel.cpp
@@ -422,7 +422,7 @@ class WayfireToplevel::impl
&toplevel_handle_v1_impl, this);
button.add_css_class("window-button");
- button.remove_css_class("activated");
+ image.add_css_class("widget-icon");
button.append(image);
button.append(label);
button.set_halign(Gtk::Align::FILL);
diff --git a/src/util/css-config.cpp b/src/util/css-config.cpp
index cc080f18..f63f7b81 100644
--- a/src/util/css-config.cpp
+++ b/src/util/css-config.cpp
@@ -79,7 +79,7 @@ CssFromConfigIconSize::CssFromConfigIconSize(std::string option_name,
}
std::stringstream ss;
- ss << ".wf-panel " << css_class << ".widget-icon {-gtk-icon-size:" << option_value.value() << "px;}";
+ ss << ".wf-panel " << css_class << " {-gtk-icon-size:" << option_value.value() << "px;}";
provider->load_from_string(ss.str());
};
diff --git a/src/util/network/network-widget.cpp b/src/util/network/network-widget.cpp
index 16a2e831..9d4816ca 100644
--- a/src/util/network/network-widget.cpp
+++ b/src/util/network/network-widget.cpp
@@ -83,6 +83,7 @@ VPNControlWidget::VPNControlWidget(std::shared_ptr config) :
append(label);
label.set_label(config->name);
image.set_from_icon_name("network-vpn-symbolic");
+ image.add_css_class("default-icon");
signals.push_back(config->signal_state_changed().connect(
[this, config] (bool active)
{
@@ -118,6 +119,7 @@ DeviceControlWidget::DeviceControlWidget(std::shared_ptr network) :
topbox.append(label);
revealer.set_child(revealer_box);
revealer_box.set_orientation(Gtk::Orientation::VERTICAL);
+ image.add_css_class("default-icon");
auto wifi = std::dynamic_pointer_cast(network);
auto mobile = std::dynamic_pointer_cast(network);
auto wired = std::dynamic_pointer_cast(network);