-
Notifications
You must be signed in to change notification settings - Fork 860
Add an interface for creating system trays #11234
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
e609d95
Add systemtray to builtins
expenses 4c31394
Cargo fmt
expenses 7c35e6c
[autofix.ci] apply automated fixes
autofix-ci[bot] 4a593aa
Example
expenses 3c31a7f
rename to system_tray, use more sensible icon
expenses 1bdbc3f
[autofix.ci] apply automated fixes
autofix-ci[bot] 4f9328d
Add favicon-white to reuse
expenses 78f4e4b
Add SystemTray slint type
expenses b580236
Rename to inherits_window_or_system_tray
expenses 18d816a
Change example to use SystemTray type
expenses 1e7f58b
Restore some stuff, use with_event_loop_proxy, add init impl
expenses 11b0720
Init via change tracking
expenses e680743
Update example
expenses 98a5b82
Clean up
expenses b88cc1a
[autofix.ci] apply automated fixes
autofix-ci[bot] a9e2d33
Add title property
expenses 4c9441b
Ensure that tray-icon compiles
expenses f25cacc
[autofix.ci] apply automated fixes
autofix-ci[bot] 5874d3c
Reduce crates required
expenses 72bbde8
Add libpango to CI
expenses 8486653
Revert "Add libpango to CI"
expenses 8017a2e
Gate system tray around OS
expenses b8fb662
Fix
expenses 5bea4eb
Clean up return statements
expenses c61a027
Clean up features
expenses 2f6fd28
copy FlickableDataBox
expenses a066df6
Add SystemTray to inherits_window
expenses 36a7258
Change to systemtraydatabox
expenses f98c448
Mark SystemTray as experimental
expenses 3b6102b
Get example working
expenses d038250
Switch to my tray-icon branch
expenses File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -320,6 +320,7 @@ fn gen_corelib( | |
| "Layer", | ||
| "ContextMenu", | ||
| "MenuItem", | ||
| "SystemTray", | ||
| ]; | ||
|
|
||
| config.export.include = [ | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| # Copyright © SixtyFPS GmbH <info@slint.dev> | ||
| # SPDX-License-Identifier: MIT | ||
|
|
||
| [package] | ||
| name = "system_tray" | ||
| version = "1.16.0" | ||
| authors = ["Slint Developers <info@slint.dev>"] | ||
| edition.workspace = true | ||
| publish = false | ||
| license = "MIT" | ||
|
|
||
| [[bin]] | ||
| path = "main.rs" | ||
| name = "system_tray" | ||
|
|
||
| [dependencies] | ||
| slint = { path = "../../api/rs/slint", default-features = false, features = ["renderer-femtovg", "backend-winit-x11", "compat-1-2"] } | ||
| i-slint-core = { workspace = true, features = ["system-tray"] } | ||
|
|
||
| [build-dependencies] | ||
| slint-build = { path = "../../api/rs/build" } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| // Copyright © SixtyFPS GmbH <info@slint.dev> | ||
| // SPDX-License-Identifier: MIT | ||
|
|
||
| fn main() { | ||
| println!("cargo:rustc-env=SLINT_ENABLE_EXPERIMENTAL_FEATURES=1"); | ||
| } |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| // Copyright © SixtyFPS GmbH <info@slint.dev> | ||
| // SPDX-License-Identifier: MIT | ||
|
|
||
| slint::slint! { | ||
| export component ExampleTray inherits SystemTray { | ||
| icon: @image-url("favicon-white.png"); | ||
| } | ||
| } | ||
|
|
||
| fn main() { | ||
| let _tray = ExampleTray::new().unwrap(); | ||
| slint::run_event_loop().unwrap(); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you make it as experimental so it is only available when using
SLINT_ENABLE_EXPERIMENTAL_FEATURES=1?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Where does that leave the example? Should I remove it now?