Commit Graph

277 Commits

Author SHA1 Message Date
ASPCartman
3969a1a45c fix(macos): Fix color mappings in window.rs (#1138)
Co-authored-by: FabianLars <github@fabianlars.de>
2025-08-27 21:17:57 +02:00
Lucas Nogueira
37fbed1361 fix(examples): run_return is available on all platforms but iOS 2025-03-15 16:02:15 -03:00
Fabian-Lars
3664513621 chore: Update msrv to 1.74 and test it in CI (#1050) 2025-02-21 19:54:37 +01:00
Amr Bashir
73741a7540 deps: remove instant (#1008)
closes #1006
2024-11-11 16:10:26 +02:00
AHQ
1f72c2465e feat: add set_badge_count for Linux, iOS; set_badge_label for Macos; set_overlay_icon for Windows (#1002) 2024-11-05 23:29:06 +02:00
Hamir Mahal
c49b83a11d style: simplify string formatting for readability (#987)
* style: simplify string formatting for readability

* fix: formatting in `src/platform` directories
2024-10-11 04:59:19 +03:00
Chooooo
4dcd231209 fix(wayland): add client side decorations & fix error protocol 71 (#979) 2024-09-26 22:01:06 +03:00
Tony
1a085ade59 feat: add a function to set theme dynamically (#937) 2024-09-19 17:50:16 +03:00
Marijn Suijten
f57561964c chore(deps): Upgrade to ndk 0.9 and fix thread-safety interactions (#956)
Most changes were copied over from my `wry` PR at
https://github.com/tauri-apps/wry/pull/1296.  Most notably a
`&ThreadLooper` is now passed to `wry::android_setup()` because we
have one, and it gives important safety guarantees when it comes to
registering callbacks on this looper, without (unnecessarily!) requiring
`Send`.  A thread-local requirement already exists for the `JNIEnv` that
is passed around anyway.

Also note that certain workarounds and illogical inverted passes
around `key_code()` handling are no longer needed, as the `ndk` crate
now passes an `enum` with the raw `i32` around so that the `.into()`
conversion for `i32` (the correct type) now becomes lossless.
2024-07-18 15:06:37 +03:00
Golden Water
f06843be44 feat(macos): add Reopen event, closes #218 (#517)
* feat(macOS): add Reopen event

* fix: unable to compile on macos when arch isn't aarch64

* fix(examples::reopen_event): only create new window when no window exists
2024-05-02 16:05:25 +03:00
Amr Bashir
c23577325b refactor!: migrate to dpi crate (#896)
* refactor!: migrate to `dpi` crate

* fix linux

* remove github URL

ref: https://github.com/rust-windowing/winit/pull/3605
2024-03-28 16:21:24 +02:00
Alex
ad7fa44101 feat: add decorations example (#888) 2024-03-26 04:49:19 +02:00
Amr Bashir
2af91313b2 refactor(linux): remove zbus and use unity launcher APIs directly (#880)
* refactor(linux): remove zbus and use unity launcher APIs directly

* change files

* fmt

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2024-02-21 09:53:31 -03:00
Amr Bashir
e10f6a6828 refactor!: relax WindowBuilderExtUnix::with_transient_for window type (#862) 2024-01-24 22:18:56 +09:00
Amr Bashir
c7fac6b2d3 chore(examples): showcase usage of softbuffer in transparent example (#863)
* chore(examples): showcase usage of softbuffer in transparent example

* only on windows
2024-01-18 18:04:47 +02:00
Amr Bashir
d0b20c94ea refactor!: remove menus, system tray and global shortcut features (#778)
* disable gtk menu creation

* remove all menu logic for `Window` type

* remove accelerator handling from tao on Windows

* use std c_void instead of libc

* fix linux build

* fix `pub` on macos

* fix linux build

* fix build on linux again

* Fix menubar focus using `Alt` on Windows

* remove tray and menu modules

* remove global-shortcut

* refactor: rmeove colorsync link

* remove unsued trait

* feat: implement any_thread for EventLoopBuilder on unix

* add gtk box by default

* publish new versions

* fix android build

* fix ios build

* change file

* change hit_test argument type

* fix windows and linux build

* fix ci

* fix ios

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
Co-authored-by: lucasfernog <lucasfernog@users.noreply.github.com>
2023-08-11 04:37:50 +03:00
Jason Tsai
3b7e0d9af3 feat(macOS): support progress bar on dock (#766)
Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2023-07-13 18:28:30 -03:00
Amr Bashir
ea14c6b104 feat: split min/max size constraints (#759)
* feat: split min/max size constraints, closes #138

* windows impl

* linux impl

* fix linux impl

* cleanup linux impl

* macOS impl

* imports

* ios build

* macos build

* unsafe

* merge `set_min/max_width/height` into a single function

* fix macos build

* macos again

* use macros to generate DPI types

ref: https://github.com/rust-windowing/winit/pull/2148

* fix windows impl

* fmt
2023-07-11 16:55:36 +03:00
DK Liao
67cab01f8c Update license to 2023 (#661) 2023-01-07 14:36:28 +08:00
Amr Bashir
b3aa3982d1 feat: switch android_fn! to a proc_macro (#654)
* feat: switch android_fn! to a proc_macro

* document the macros

* add to CI

* fix ci

* again

* one more
2022-12-27 00:01:05 +02:00
Amr Bashir
77569c893f fix(linux): fix mnemonics for submenus (#650)
* fix(linux): fix mnemonics for submenus

* Update menu.rs
2022-12-20 09:04:32 +08:00
Ngo Iok Ui (Wu Yu Wei)
8c6b2d05ae Add with_cursor_moved unix extension method (#644)
* Add `with_cursor_moved` unix extension method

* Default should be true

* Fix typo

Co-authored-by: Wu Yu Wei <wusyong9104@gmail.com>
2022-12-14 12:14:22 +08:00
Amr Bashir
ca844a2ebb fix(Windows): retain WS_MAXIMIZE when unminimizing a maximized window, closes #622 (#638) 2022-12-04 13:11:57 +02:00
Amr Bashir
abd6ae568f fix(Windows): account for null character in title getter (#606) 2022-10-31 01:09:11 +02:00
Caesar Schinas
a50fd867b3 feat: options to disable individual window controls, closes #116 (#574)
* feat(window): implement `minimizable` and `closable` for macOS

* feat(window): examples for `minimizable` and `closable`

* fix(window): stub `minimizable` and `resizable` for other platforms

* lint: run cargo fmt

* feat(window): implement `closable` for Linux

* refactor: rename parameter

* feat(window): implement `maximizable` for macOS

* feat(window): implement `minimizable` for Windows

* fix: edit bitflag for minimizable and move line

# Conflicts:
#	src/platform_impl/windows/window_state.rs

* fix(window): initial `minimzable` value on Windows

* feat(window): implement `maximizable` for Windows

* docs(window): correct platform-specific notes

* feat(window): implement `closable` for Windows

* fix(window): missing `mut`

* chore: add changefile

* docs(window): correct platform-specific notes

* docs(window): improve docs for window control toggles

* refactor (examples): move window control examples into window_debug.rs

This reverts commit ddb9f2bcdf.

* refactor(window): move `set_closable` impl on Windows to `WindowFlags::apply_diff`

* chore: cargo fmt

* chore: update changefile

Co-authored-by: Amr Bashir <amr.bashir2015@gmail.com>

* chore: remove println

* fix with_closable on Windows

* Update src/platform_impl/linux/window.rs

* Update src/platform_impl/linux/window.rs

* Update src/window.rs

* update flags

Co-authored-by: David A Klein <david@kleincyber.com>
Co-authored-by: Amr Bashir <amr.bashir2015@gmail.com>
2022-10-11 20:40:00 +02:00
Caesar Schinas
937aba7b7f feat(menus): add support for Plus key in accelerators, closes #227 (#573)
* feat(menus): add support for Plus key in accelerators

* feat(menus) add support for Plus key in accelerators on Windows

* feat(menus) add support for Plus key in accelerators on Linux

* chore: add changefile and docs for `KeyCode::Plus`

* lint: run cargo fmt

* docs: clarify wording
2022-09-27 21:19:25 +02:00
Caesar Schinas
65f768e55f fix(menus): add app name to native Quit and Hide items on macOS, closes #536 (#570)
* feat(menus): add app name to native Quit and Hide items

* lint: run cargo fmt

* refactor(menus): cleaner app name implementation

* chore(menus): add changefile

* chore(menus): change changefile

* refactor(menus): keep original app_name function signature

* refactor(menus): add helper function `app_name_string`
2022-09-25 20:52:02 +02:00
Caesar Schinas
d343abf8cc fix(menus): fix macOS Services menu not working, closes #243 (#569)
* fix(menus): macOS Services menu not working

* chore(menus): add changefile
2022-09-25 20:36:01 +02:00
Tomáš Vojtášek
972307ddf0 feat: added text support to system tray for macos, closes #65 (#554)
* feat: added text support to system tray for macos, closes #65

* extract image position into variable

* boring
2022-09-10 20:15:46 +02:00
Jonas Kruckenberg
802146fb86 feat: implement set_content_protection, closes #550 (#551)
* feat: implement set_content_protection

* fmt

* Update content_protection.rs

* add changefile

* Apply suggestions from code review

* remove dedicated example

* Update src/platform_impl/windows/window.rs

* fmt

* Delete content_protection.rs
2022-09-04 15:42:20 +02:00
Amr Bashir
be7ee93231 chore: licenses (#542) 2022-08-27 10:07:28 +08:00
Heng-Yi Wu
a2a7b7262c Always on bottom (#522)
* feat: always below bottom

* refactor: always on bottom

* refactor: remove unnecessary warning
2022-08-21 18:14:22 +02:00
Lucas Fernandes Nogueira
759b7db37b fix(macos): retain tray to prevent segfault when event loop is running (#539) 2022-08-21 01:08:17 +08:00
Heng-Yi Wu
7d2eeeebb4 feat: Window::is_focused (#533) 2022-08-17 17:08:40 +02:00
Heng-Yi Wu
9c3481548b feat: add Window::is_minimized(), closes #257 (#486) 2022-08-06 13:54:38 +02:00
Lucas Fernandes Nogueira
4ea78bcb57 feat(tray): add identifier to allow multiple tray setup (#514)
* feat(tray): add identifier to allow multiple tray setup

* fix macos impl

* feat: make it backwards compatible

* fix windows impl

* change to `with_id`

* fix windows build

* fix fmt

Co-authored-by: Amr Bashir <amr.bashir2015@gmail.com>
2022-08-04 11:32:52 +08:00
Peter Evers
14e265682f feat(macos): add SystemTray::set_tooltip, ref #409 (#410)
* feat: add set_tool_tip to tray

* add changes file

* note: make clear that this is wip

* fix comments

* tooltip example

* prepare for future windows implementation

* fmt

* fix build

* fix build again

Co-authored-by: amrbashir <amr.bashir2015@gmail.com>
2022-08-03 00:37:53 +02:00
keiya sasaki
74425e8e5b feat: add theme feature on Linux (#468) 2022-07-10 21:55:22 +09:00
Victor Aremu
13f9f18275 feat(macos): implement CustomMenuItem::set_icon() (#459)
* feat(macos): implement set icon

* refactor: remove set_icon definition from CustomMenuItemExtMacos

* refactor: remove comment

* feat: add set_icon definition to CustomMenuItem

* refactor: remove unused imports

* * fix: change icon parameter type from Vec<u8> to Icon
* refactor: use crate::icon::Icon instead of crate::system_tray::Icon

* refactor: update set_icon definition for ios and android

* refactor: Icon import

* add change file
2022-07-07 19:20:10 +02:00
Tabulate
286ee65f84 chore: add embedding icon comment in window_icon example(#326)
* add new embedded window icon example

* add a note in window_icon example instead

Co-authored-by: Amr Bashir <amr.bashir2015@gmail.com>
2022-07-07 19:13:30 +02:00
Robin van Boven
ce209d39ab feat(linux) add with_temp_icon_dir builder extension (#452)
* linux: Defer writing files to the `SystemTrayBuilder::build` call

* linux: Add an argument to `temp_icon_path` for a custom directory

* linux: Add `temp_icon_dir` field to the `SystemTrayBuilder`

* linux: Add `with_temp_icon_dir` builder method

* linux: Use `with_temp_icon_dir` in `system_tray` example

* Add changes file

* Format with cargo fmt

Rather than rust analyzer
2022-06-26 20:07:21 +02:00
Lucas Fernandes Nogueira
aae6bec911 fix(macos): do not emit ThemeChanged event if window theme didn't change (#430) 2022-06-20 18:46:11 +08:00
keiya sasaki
f1e8d7556e feat: support child window on linux, closes #273 (#415)
* feat: support child window on linux, closes #273

* fix: ganeral window builder

* Revert "fix: ganeral window builder"

This reverts commit f1366e4aaa.

* Update src/platform/unix.rs

Co-authored-by: Amr Bashir <amr.bashir2015@gmail.com>

* chore: fmt

* fix: use with_transient_for on linux

Co-authored-by: Amr Bashir <amr.bashir2015@gmail.com>
2022-06-13 15:11:51 +08:00
Amr Bashir
0a98eb3993 refactor: system tray icons (#328) 2022-06-06 15:11:42 +02:00
keiya sasaki
8af4d8f021 feat: support theme on macOS (#408)
* feat: support theme on macOS

* Update support-theme-on-macos.md

Co-authored-by: Ngo Iok Ui (Wu Yu Wei) <wusyong9104@gmail.com>
2022-06-01 20:11:24 +08:00
khuongduy354
cba437d60c Adding examples description (#398) 2022-05-20 12:23:36 +08:00
keiya sasaki
520f142f2a Feat/support get menuitem title, closes #216 (#365)
* feat: add title getter to CustomMenuItem (#216)

* fix(example): use title getter of the CustomMenuItem
2022-04-13 17:16:08 +08:00
Lucas Fernandes Nogueira
cdd4ac3281 fix(events): properly fire WindowEvent::Destroyed on Linux (#349)
* fix(events): properly fire `WindowEvent::Destroyed` on Linux

* remove unused variable

* fix docs
2022-03-26 13:10:07 +08:00
Lucas Fernandes Nogueira
84c677fd13 refactor: fix and enhance the about menu on Linux (#347)
* refactor: fix and enhance the about menu on Linux

* simplify

* apply code review suggestions
2022-03-25 20:41:23 +02:00
Ngo Iok Ui (Wu Yu Wei)
f5e19e0ff8 Revert "Implement global shortcut on Linux, close #307 (#308)" (#330)
This reverts commit 9c2841f7f5.
2022-03-01 10:03:41 +08:00