diff --git a/metadata/panel.xml b/metadata/panel.xml
index 82aedb45..ef54cc9e 100644
--- a/metadata/panel.xml
+++ b/metadata/panel.xml
@@ -154,6 +154,11 @@ If full_span is off, both sides of the panel will take the same amount of space,
0
0
+
+ <_short>Number of rows (in horizontal panels) or columns (in vertical panels) in Launchers widget
+ 1
+ 1
+
<_short>Launchers
<_long>Launchers
@@ -560,6 +565,11 @@ If full_span is off, both sides of the panel will take the same amount of space,
5
0
+
+ <_short>Number of rows (in horizontal panels) or columns (in vertical panels) in tray widget
+ 1
+ 1
+
<_short>Middle Button Activates Menu
<_long>Mouse right button activates a tray item's secondary action instead of the item's menu.
diff --git a/src/panel/widgets/launchers.cpp b/src/panel/widgets/launchers.cpp
index 9c7b5fa3..7ec8f294 100644
--- a/src/panel/widgets/launchers.cpp
+++ b/src/panel/widgets/launchers.cpp
@@ -171,16 +171,20 @@ void WayfireLaunchers::init(Gtk::Box *container)
void WayfireLaunchers::update_layout()
{
- box.set_spacing(spacing);
+ box.set_column_spacing(spacing);
+ box.set_row_spacing(spacing);
+ box.set_max_children_per_line(rows_cols);
+ box.set_min_children_per_line(rows_cols);
+ box.set_selection_mode(Gtk::SelectionMode::NONE);
WfOption panel_position{"panel/position"};
if (panel_position.value() == PANEL_POSITION_LEFT or panel_position.value() == PANEL_POSITION_RIGHT)
{
- box.set_orientation(Gtk::Orientation::VERTICAL);
+ box.set_orientation(Gtk::Orientation::HORIZONTAL);
} else
{
- box.set_orientation(Gtk::Orientation::HORIZONTAL);
+ box.set_orientation(Gtk::Orientation::VERTICAL);
}
}
diff --git a/src/panel/widgets/launchers.hpp b/src/panel/widgets/launchers.hpp
index 6e0b703d..073115c2 100644
--- a/src/panel/widgets/launchers.hpp
+++ b/src/panel/widgets/launchers.hpp
@@ -4,7 +4,7 @@
#include
#include
#include
-#include
+#include
#include
#include
@@ -27,11 +27,12 @@ struct WfLauncherButton
using launcher_container = std::vector>;
class WayfireLaunchers : public WayfireWidget
{
- Gtk::Box box;
+ Gtk::FlowBox box;
launcher_container launchers;
launcher_container get_launchers_from_config();
WfOption spacing{"panel/launchers_spacing"};
+ WfOption rows_cols{"panel/launchers_rows_cols"};
public:
virtual void init(Gtk::Box *container);
diff --git a/src/panel/widgets/tray/item.cpp b/src/panel/widgets/tray/item.cpp
index 2eb60df8..19a0b9e2 100644
--- a/src/panel/widgets/tray/item.cpp
+++ b/src/panel/widgets/tray/item.cpp
@@ -78,6 +78,7 @@ void StatusNotifierItem::init_widget()
setup_tooltip();
init_menu();
icon.add_css_class("widget-icon");
+ icon.add_css_class("tray-button");
add_css_class("tray-button");
auto scroll_gesture = Gtk::EventControllerScroll::create();
diff --git a/src/panel/widgets/tray/tray.cpp b/src/panel/widgets/tray/tray.cpp
index c9b70911..202c9a16 100644
--- a/src/panel/widgets/tray/tray.cpp
+++ b/src/panel/widgets/tray/tray.cpp
@@ -35,16 +35,20 @@ void WayfireStatusNotifier::remove_item(const Glib::ustring & service)
void WayfireStatusNotifier::update_layout()
{
- icons_box.set_spacing(spacing);
+ icons_box.set_column_spacing(spacing);
+ icons_box.set_row_spacing(spacing);
+ icons_box.set_max_children_per_line(rows_cols);
+ icons_box.set_min_children_per_line(rows_cols);
+ icons_box.set_selection_mode(Gtk::SelectionMode::NONE);
WfOption panel_position{"panel/position"};
if ((panel_position.value() == PANEL_POSITION_LEFT) || (panel_position.value() == PANEL_POSITION_RIGHT))
{
- icons_box.set_orientation(Gtk::Orientation::VERTICAL);
+ icons_box.set_orientation(Gtk::Orientation::HORIZONTAL);
} else
{
- icons_box.set_orientation(Gtk::Orientation::HORIZONTAL);
+ icons_box.set_orientation(Gtk::Orientation::VERTICAL);
}
}
diff --git a/src/panel/widgets/tray/tray.hpp b/src/panel/widgets/tray/tray.hpp
index f8fd90e2..df3b23b7 100644
--- a/src/panel/widgets/tray/tray.hpp
+++ b/src/panel/widgets/tray/tray.hpp
@@ -11,10 +11,11 @@ class WayfireStatusNotifier : public WayfireWidget
private:
StatusNotifierHost host = StatusNotifierHost(this);
- Gtk::Box icons_box;
+ Gtk::FlowBox icons_box;
std::map items;
WfOption spacing{"panel/tray_spacing"};
+ WfOption rows_cols{"panel/tray_rows_cols"};
void update_layout();
void handle_config_reload();