Commit cb150c3a authored by kimidaisuki22's avatar kimidaisuki22

Merge remote-tracking branch 'origin'

parents 8ef4fb92 aa2515c5
...@@ -5,12 +5,23 @@ ...@@ -5,12 +5,23 @@
int main() { int main() {
trays::Menu m; trays::Menu m;
m.text_ = "Open work dir"; m.text_ = "Open work dir";
m.on_click_ = [](auto) { system("open ."); };
// absolute path for linux.
// linux: png, svg // linux: png, svg
std::string icon_name = "icon.png"; std::string icon_name =
#ifdef _WIN32
"icon.icon";
#else
"icon.png";
#endif
// absolute path for linux.
auto icon_path =std::filesystem::current_path() / icon_name; auto icon_path =std::filesystem::current_path() / icon_name;
#ifdef _WIN32
m.on_click_ = [](auto) { system("start ."); };
#else
m.on_click_ = [](auto) { system("open ."); };
#endif
trays::Tray t{icon_path.string(), {m}}; trays::Tray t{icon_path.string(), {m}};
// t.add(m); // t.add(m);
t.run(); t.run();
......
...@@ -61,4 +61,4 @@ static GtkMenuShell *_tray_menu(struct tray_menu *m) { ...@@ -61,4 +61,4 @@ static GtkMenuShell *_tray_menu(struct tray_menu *m) {
app_indicator_set_menu(indicator, GTK_MENU(_tray_menu(tray->menu))); app_indicator_set_menu(indicator, GTK_MENU(_tray_menu(tray->menu)));
} }
void tray_exit() { loop_result = -1; } void tray_exit() { loop_result = -1; }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment