Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tray
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vladislav
tray
Commits
cb150c3a
Commit
cb150c3a
authored
Jul 07, 2023
by
kimidaisuki22
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin'
parents
8ef4fb92
aa2515c5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
5 deletions
+15
-5
example_pp.cpp
example/example_pp.cpp
+14
-3
linux.h
include/tray/platform/linux.h
+1
-2
No files found.
example/example_pp.cpp
View file @
cb150c3a
...
...
@@ -5,12 +5,23 @@
int
main
()
{
trays
::
Menu
m
;
m
.
text_
=
"Open work dir"
;
m
.
on_click_
=
[](
auto
)
{
system
(
"open ."
);
};
// absolute path for linux.
// 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
;
#ifdef _WIN32
m
.
on_click_
=
[](
auto
)
{
system
(
"start ."
);
};
#else
m
.
on_click_
=
[](
auto
)
{
system
(
"open ."
);
};
#endif
trays
::
Tray
t
{
icon_path
.
string
(),
{
m
}};
// t.add(m);
t
.
run
();
...
...
include/tray/platform/linux.h
View file @
cb150c3a
...
...
@@ -61,4 +61,4 @@ static GtkMenuShell *_tray_menu(struct tray_menu *m) {
app_indicator_set_menu
(
indicator
,
GTK_MENU
(
_tray_menu
(
tray
->
menu
)));
}
void
tray_exit
()
{
loop_result
=
-
1
;
}
\ No newline at end of file
void
tray_exit
()
{
loop_result
=
-
1
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment