SOLFIND
Web Lens
Portal home

Custom Window Styles | Electron

https://www.electronjs.org/ru/docs/latest/tutorial/custom-window-styles • 73 KB fetched
Open original page


Custom Window Styles | Electron Перейти к основному содержанию Electron Документация API Блог Инструменты * Electron Forge * Electron Fiddle Сообщество * Управление * Примеры * Ресурсы Релизы Русский * English * Deutsch * Español * Français * 日本語 * Português * Русский * 中文 Поиск * Начать * Процессы в Electron * Рекомендации * Примеры * Темный режим * Device Access * In-App Purchases * * Горячие клавиши * Deep Links * Desktop Launcher Actions * * Menus * Многопоточность * Нативное перемещение файла * История навигации * Notification (Оповещения) * Закадровый рендеринг * Обнаружение Online/Offline событий * Progress Bars * Недавние документы * * * Representing Files in a BrowserWindow * * SpellChecker * Web Embeds * Taskbar Customization * * Window Customization * Custom Title Bar * Custom Window Interactions * Custom Window Styles * Разработка * Native Node Modules * Распространение * Тестирование и отладка * Ссылки * Вклад * * Примеры * Window Customization * Custom Window Styles На этой странице Custom Window Styles Frameless windows ​ A frameless window removes all chrome applied by the OS, including window controls. To create a frameless window, set the BaseWindowContructorOptions frame param in the  BrowserWindow  constructor to false . docs/fiddles/features/window-customization/custom-window-styles/frameless-windows ( 43.4.0 ) Open in Fiddle * main.js const { app , BrowserWindow } = require ( 'electron' ) function createWindow ( ) { const win = new BrowserWindow ( { width : 300 , height : 200 , frame : false } ) win . loadURL ( 'https://example.com' ) } app . whenReady ( ) . then ( ( ) => { createWindow ( ) } ) On Wayland (Linux), frameless windows have GTK drop shadows and extended resize boundaries by default. To create a fully frameless window with no decorations, set hasShadow: false in the window constructor options. Transparent windows ​ To create a fully transparent window, set the BaseWindowContructorOptions transparent param in the  BrowserWindow  constructor to true . The following fiddle takes advantage of a transparent window and CSS styling to create the illusion of a circular window. docs/fiddles/features/window-customization/custom-window-styles/transparent-windows ( 43.4.0 ) Open in Fiddle * main.js * index.html * styles.css const { app , BrowserWindow } = require ( 'electron' ) function createWindow ( ) { const win = new BrowserWindow ( { width : 100 , height : 100 , resizable : false , frame : false , transparent : true } ) win . loadFile ( 'index.html' ) } app . whenReady ( ) . then ( ( ) => { createWindow ( ) } ) <! DOCTYPE html > < html > < head > < meta charset = " UTF-8 " > <!-- https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP --> < meta http-equiv = " Content-Security-Policy " content = " default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline' " > < link href = " ./styles.css " rel = " stylesheet " > < title > Transparent Hello World </ title > </ head > < body > < div class = " white-circle " > < div > Hello World! </ div > </ div > </ body > </ html > body { margin : 0 ; padding : 0 ; background-color : rgba ( 0 , 0 , 0 , 0 ) ; /* Transparent background */ } .white-circle { width : 100 px ; height : 100 px ; background-color : white ; border-radius : 50 % ; display : flex ; align-items : center ; justify-content : center ; app-region : drag ; user-select : none ; } Ограничения ​ * You cannot click through the transparent area. See #1335 for details. * Transparent windows are not resizable. Setting resizable to true may make a transparent window stop working on some platforms. * The CSS blur() filter only applies to the window's web contents, so there is no way to apply blur effect to the content below the window (i.e. other applications open on the user's system). * The window will not be transparent when DevTools is opened. * On Windows : * Transparent windows can not be maximized using the Windows system menu or by double clicking the title bar. The reasoning behind this can be seen on PR #28207 . * On macOS : * The native window shadow will not be shown on a transparent window. Редактировать эту страницу Назад Custom Window Interactions Далее Доступность * Frameless windows * Transparent windows * Ограничения Документация * Начало работы * Справка по API Контрольные списки * Характеристика * Безопасность Инструменты * Electron Forge * Electron Fiddle Сообщество * Управление * Ресурсы * Discord * Bluesky * X * Mastodon * Stack Overflow Подробнее * GitHub * Open Collective * Панель управления инфраструктурой Авторское право OpenJS Foundation и участники проекта Electron. Все права защищены. OpenJS Foundation обладает зарегистрированными товарными знаками и использует их. Список товарных знаков OpenJS Foundation приведён в нашей Политике в отношении товарных знаков и в Списке товарных знаков . Товарные знаки™ и логотипы®, не указанные в списке товарных знаков OpenJS Foundation , являются товарными знаками™ или зарегистрированными® товарными знаками их владельцев. Их использование не подразумевает какой-либо принадлежности к ним или поддержки с их стороны. The OpenJS Foundation | Условия использования | Политика конфиденциальности | Устав | Кодекс поведения | Политика в отношении товарных знаков | Список товарных знаков | Политика использования файлов cookie Hosting and infrastructure graciously provided by

Links found on this page

  1. Перейти к основному содержанию [direct]
  2. Electron [direct]
  3. Документация [direct]
  4. API [direct]
  5. Блог [direct]
  6. Electron Forge [direct]
  7. Electron Fiddle [direct]
  8. Управление [direct]
  9. Примеры [direct]
  10. Ресурсы [direct]
  11. Релизы [direct]
  12. English [direct]
  13. Deutsch [direct]
  14. Español [direct]
  15. Français [direct]
  16. 日本語 [direct]
  17. Português [direct]
  18. 中文 [direct]
  19. Процессы в Electron [direct]
  20. Рекомендации [direct]
  21. Примеры [direct]
  22. Темный режим [direct]
  23. Device Access [direct]
  24. In-App Purchases [direct]
  25. Горячие клавиши [direct]
  26. Deep Links [direct]
  27. Desktop Launcher Actions [direct]
  28. Menus [direct]
  29. Многопоточность [direct]
  30. Нативное перемещение файла [direct]
  31. История навигации [direct]
  32. Notification (Оповещения) [direct]
  33. Закадровый рендеринг [direct]
  34. Обнаружение Online/Offline событий [direct]
  35. Progress Bars [direct]
  36. Недавние документы [direct]
  37. Representing Files in a BrowserWindow [direct]
  38. SpellChecker [direct]
  39. Web Embeds [direct]
  40. Taskbar Customization [direct]
  41. Window Customization [direct]
  42. Custom Title Bar [direct]
  43. Custom Window Interactions [direct]
  44. Разработка [direct]
  45. Native Node Modules [direct]
  46. Распространение [direct]
  47. Тестирование и отладка [direct]
  48. Ссылки [direct]
  49. Вклад [direct]
  50. chrome [direct]
  51. BaseWindowContructorOptions [direct]
  52. docs/fiddles/features/window-customization/custom-window-styles/frameless-windows ( 43.4.0 ) [direct]
  53. Open in Fiddle [direct]
  54. docs/fiddles/features/window-customization/custom-window-styles/transparent-windows ( 43.4.0 ) [direct]
  55. Open in Fiddle [direct]
  56. #1335 [direct]
  57. blur() [direct]
  58. #28207 [direct]
  59. Редактировать эту страницу [direct]
  60. Безопасность [direct]
  61. Discord [direct]
  62. Bluesky [direct]
  63. X [direct]
  64. Mastodon [direct]
  65. Stack Overflow [direct]
  66. GitHub [direct]
  67. Open Collective [direct]
  68. Панель управления инфраструктурой [direct]
  69. OpenJS Foundation [direct]
  70. Политике в отношении товарных знаков [direct]
  71. Списке товарных знаков [direct]
  72. Условия использования [direct]
  73. Политика конфиденциальности [direct]
  74. Устав [direct]
  75. Кодекс поведения [direct]
  76. Политика использования файлов cookie [direct]