1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
|
--- a/src/overview.cpp
+++ b/src/overview.cpp
@@ -1285,6 +1285,7 @@
wf::wl_timer<false> clock_timer;
wf::effect_hook_t pre_hook;
bool hooks_active = false;
+ bool show_panel = false;
int panel_height = 16, corner_radius = 12, spacing = 20, anim_duration = 300;
std::string panel_color = "#1a1a1aE6";
bool button_held = false;
@@ -1312,7 +1313,7 @@
void init() override {
panel = std::make_unique<top_panel_t>(output, panel_height, panel_color);
activities = std::make_unique<activities_view_t>(output);
- activities->set_config(corner_radius, spacing, panel_height, anim_duration);
+ activities->set_config(corner_radius, spacing, show_panel ? panel_height : 0, anim_duration);
wf::gles::run_in_context([&] { progs.load(); });
load_wallpaper();
@@ -1330,21 +1331,23 @@
}
};
- clock_timer.set_timeout(60000, [this]() {
+ if (show_panel) clock_timer.set_timeout(60000, [this]() {
panel->render(); panel->upload();
if (panel_node) wf::scene::damage_node(panel_node, panel_node->get_bounding_box());
return true;
});
- panel_node = std::make_shared<panel_node_t>(output, panel.get(), &progs, &activities->is_active);
- wf::scene::add_front(wf::get_core().scene(), panel_node);
- wf::scene::damage_node(panel_node, panel_node->get_bounding_box());
+ if (show_panel) {
+ panel_node = std::make_shared<panel_node_t>(output, panel.get(), &progs, &activities->is_active);
+ wf::scene::add_front(wf::get_core().scene(), panel_node);
+ wf::scene::damage_node(panel_node, panel_node->get_bounding_box());
+ }
}
void activate_hooks() {
if (hooks_active) return;
if (!render_node) {
- render_node = std::make_shared<overview_node_t>(output, activities.get(), &progs, wallpaper_tex, panel.get());
+ render_node = std::make_shared<overview_node_t>(output, activities.get(), &progs, wallpaper_tex, show_panel ? panel.get() : nullptr);
wf::scene::add_front(wf::get_core().scene(), render_node);
}
if (panel_node) {
@@ -1384,7 +1387,7 @@
void handle_motion(wf::pointf_t cursor) {
auto og = output->get_layout_geometry();
- bool in_panel = cursor.y >= og.y && cursor.y < og.y + panel->height;
+ bool in_panel = show_panel && cursor.y >= og.y && cursor.y < og.y + panel->height;
if (in_panel) {
if (panel->set_hover(panel->point_in_activities(cursor)))
wf::scene::damage_node(panel_node, panel_node->get_bounding_box());
@@ -1420,7 +1423,7 @@
bool handle_button(uint32_t btn, uint32_t state, wf::pointf_t cursor) {
if (btn != BTN_LEFT) return false;
if (state == WL_POINTER_BUTTON_STATE_PRESSED) {
- if (panel->point_in_activities(cursor)) { toggle(); return true; }
+ if (show_panel && panel->point_in_activities(cursor)) { toggle(); return true; }
if (activities->is_active && !activities->is_animating) {
button_held = true; press_pos = cursor; drag_started = false; return true;
}
@@ -1451,6 +1454,7 @@
// ============================================================================
class wayfire_overview_t : public wf::plugin_interface_t {
+ wf::option_wrapper_t<bool> opt_show_panel{"overview/show_panel"};
wf::option_wrapper_t<int> opt_panel_height{"overview/panel_height"};
wf::option_wrapper_t<std::string> opt_panel_color{"overview/panel_color"};
wf::option_wrapper_t<int> opt_corner_radius{"overview/corner_radius"};
@@ -1477,6 +1481,7 @@
}
void add_output(wf::output_t *out) {
auto i = std::make_unique<overview_output_t>();
+ i->show_panel = opt_show_panel;
i->panel_height = opt_panel_height; i->panel_color = (std::string)opt_panel_color;
i->corner_radius = opt_corner_radius; i->anim_duration = opt_animation_duration;
i->spacing = opt_spacing; i->output = out;
--- a/metadata/overview.xml
+++ b/metadata/overview.xml
@@ -11,12 +11,18 @@
<option name="toggle" type="activator">
<_short>Toggle Overview</_short>
<_long>Key/button to toggle the Activities overview</_long>
- <default><super></default>
+ <default><super> <ctrl> KEY_O</default>
</option>
</group>
<group>
<_short>Panel</_short>
+
+ <option name="show_panel" type="bool">
+ <_short>Show built-in panel</_short>
+ <_long>Enable the Activities and clock panel. Leave disabled when using wf-shell.</_long>
+ <default>false</default>
+ </option>
<option name="panel_height" type="int">
<_short>Panel Height</_short>
@@ -71,7 +77,7 @@
<option name="wallpaper" type="string">
<_short>Wallpaper Path</_short>
<_long>Path to wallpaper image for overview background (PNG format)</_long>
- <default>/home/light/Pictures/wallpapers/Dynamic-Wallpapers/Light/Beach_light.png</default>
+ <default></default>
</option>
</group>
</plugin>
|