-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApplet_background.cc
More file actions
37 lines (28 loc) · 975 Bytes
/
Applet_background.cc
File metadata and controls
37 lines (28 loc) · 975 Bytes
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
#define PANEL_APPLET
#include "./Applet.h"
#include <limits>
const std::map<std::string, void(*)(std::string)> Applet::commands () {
return {};
}
const std::map<std::string,std::string> Applet::settings_default () {
return {{"display","0"},{"file",""}};
}
void Applet::load() {
if (settings["PLACEMENT"].starts_with("WINDOW")) {
window->load_file(HUI::filepath(settings["file"]).cpp_str());
HUI::WindowControls windowctl(window->backend_object(), window->window_handle());
windowctl.set_type(WT_DESKTOP_COMPONENT);
windowctl.set_layer(WL_BACKGROUND);
windowctl.set_geometry({.state = 0, .monitor = std::stoi(settings["display"]), .width = -1, .height = -1, .left = 0, .top = 0, .right = 0, .bottom = 0});
windowctl.set_exclusive_zone(-2); // make the background go under the panel
}
}
void Applet::reload () {
load();
}
void Applet::unload () {
}
std::time_t Applet::update () {
// never update
return std::numeric_limits<std::time_t>::max();
}