当前位置: 首页 > news >正文

网站漂浮图片公司做英文网站

网站漂浮图片,公司做英文网站,广东南方购物频道app,广州做礼物的网站效果预览 技术要点 透明背景 src/main/index.ts 的 new BrowserWindow 中添加 transparent: true, // 设置窗口背景透明frame: false, // 隐藏窗口边框仅图标和标题部分可拖拽 仅图标和标题部分添加样式 drag .drag {-webkit-app-region: drag; }图标与标题栏的融合 标题栏的… 效果预览 技术要点 透明背景 src/main/index.ts 的 new BrowserWindow 中添加 transparent: true, // 设置窗口背景透明frame: false, // 隐藏窗口边框仅图标和标题部分可拖拽 仅图标和标题部分添加样式 drag .drag {-webkit-app-region: drag; }图标与标题栏的融合 标题栏的背景色采用图标的背景色 bg-[#0baaf5]标题栏添加顶部的外边距值为图标的半径 mt-30px图标的样式如下 img :srcicon altlogo classfixed h-60px top-[0px] drag /窗口置顶 Iconv-ififTopiconstash:pin-thumbtack-solid:classiconClassStringclickcancle_top/Icon v-else iconstash:pin-thumbtack :classiconClassString clicktop /const ifTop ref(false)// 窗口置顶 function top() {window.electron.ipcRenderer.send(top)ifTop.value true }function cancle_top() {window.electron.ipcRenderer.send(cancle_top)ifTop.value false }src/main/index.ts 中 ipcMain.on(top, () {mainWindow.setAlwaysOnTop(true)})ipcMain.on(cancle_top, () {mainWindow.setAlwaysOnTop(false)})窗口最小化 Icon iconqlementine-icons:windows-minimize-16 :classiconClassString clickmin /function min() {window.electron.ipcRenderer.send(min) }src/main/index.ts 中 ipcMain.on(min, () {mainWindow.minimize()})窗口最大化 / 取消最大化 Iconv-ififMaxiconqlementine-icons:windows-unmaximize-16:classiconClassStringclickcancel_max/Iconv-elseiconqlementine-icons:windows-maximize-16:classiconClassStringclickmax/const ifMax ref(false)function max() {window.electron.ipcRenderer.send(max) }function cancel_max() {window.electron.ipcRenderer.send(cancel_max) }window.electron.ipcRenderer.on(unmaximize, () {ifMax.value false })window.electron.ipcRenderer.on(maximize, () {ifMax.value true })src/main/index.ts 中 ipcMain.on(max, () {mainWindow.maximize()})ipcMain.on(cancel_max, () {mainWindow.unmaximize()})因将窗口拖拽到屏幕边缘时会自动触发最大化调整窗口大小会退出最大化则需监听窗口最大化和退出最大化事件由主进程通知渲染进程状态以便切换图标。[ 不适应于本范例因本范例隐藏了 frame ] // 窗口变为最大化状态mainWindow.on(maximize, () {mainWindow.webContents.send(maximize)})// 窗口从最大化状态退出mainWindow.on(unmaximize, () {mainWindow.webContents.send(unmaximize)})隐藏窗口到托盘 Icon iconsi:close-fill :classiconClassString clickhide /function hide() {window.electron.ipcRenderer.send(hide) }src/main/index.ts 中 ipcMain.on(hide, () {// 使窗口不显示在任务栏中mainWindow.setSkipTaskbar(true)mainWindow.hide()})代码实现 src/renderer/src/components/TitleBar.vue script setup langts import icon from ../../../../resources/icon.png const props defineProps({title: {type: String} })function hide() {window.electron.ipcRenderer.send(hide) }const ifTop ref(false)// 窗口置顶 function top() {window.electron.ipcRenderer.send(top)ifTop.value true }function cancle_top() {window.electron.ipcRenderer.send(cancle_top)ifTop.value false }function min() {window.electron.ipcRenderer.send(min) }const ifMax ref(false)function max() {window.electron.ipcRenderer.send(max) }function cancel_max() {window.electron.ipcRenderer.send(cancel_max) }window.electron.ipcRenderer.on(unmaximize, () {ifMax.value false })window.electron.ipcRenderer.on(maximize, () {ifMax.value true })const iconClassString cursor-pointer hover:bg-blue-500 block h-full px-2 /scripttemplateimg :srcicon altlogo classfixed h-60px top-[0px] drag /div classflex items-center bg-[#0baaf5] text-white h-30px mt-30pxdiv classdrag flex-1 pl-70px font-bold text-white{{ props.title }}/divdiv classflex h-fullIconv-ififTopiconstash:pin-thumbtack-solid:classiconClassStringclickcancle_top/Icon v-else iconstash:pin-thumbtack :classiconClassString clicktop /Icon iconqlementine-icons:windows-minimize-16 :classiconClassString clickmin /Iconv-ififMaxiconqlementine-icons:windows-unmaximize-16:classiconClassStringclickcancel_max/Iconv-elseiconqlementine-icons:windows-maximize-16:classiconClassStringclickmax/Icon iconsi:close-fill :classiconClassString clickhide //div/div /template页面使用 TitleBar title邀请函 /src/main/index.ts import { app, shell, BrowserWindow, ipcMain, Tray, Menu } from electron import { join } from path import { electronApp, optimizer, is } from electron-toolkit/utils import icon from ../../resources/icon.png?assetfunction createWindow(): void {const mainWindow new BrowserWindow({// 自定义图标icon: icon,// 自定义窗口宽度width: 360,// 自定义窗口高度height: 430,//默认隐藏窗口show: false,// 隐藏窗口标题栏titleBarStyle: hidden,// 隐藏默认菜单autoHideMenuBar: true,// 不可改变窗口大小resizable: false,// 不可改变窗口大小maximizable: false,transparent: true, // 设置窗口背景透明frame: false, // 隐藏窗口边框webPreferences: {preload: join(__dirname, ../preload/index.js),sandbox: false}})// 托盘const tray new Tray(icon)const contextMenu [{label: 退出,click: function () {app.exit()}}]const menu Menu.buildFromTemplate(contextMenu)tray.setToolTip(EC编程俱乐部)tray.setContextMenu(menu)tray.on(click, () {// 使窗口显示在任务栏中mainWindow.setSkipTaskbar(false)mainWindow.show()})// IPC通信ipcMain.on(showPage_home, () {// 窗口可调整大小mainWindow.setResizable(true)mainWindow.setSize(800, 720)// 窗口居中mainWindow.center()// 窗口可最大化mainWindow.setMaximizable(true)})ipcMain.on(top, () {mainWindow.setAlwaysOnTop(true)})ipcMain.on(cancle_top, () {mainWindow.setAlwaysOnTop(false)})ipcMain.on(hide, () {// 使窗口不显示在任务栏中mainWindow.setSkipTaskbar(true)mainWindow.hide()})ipcMain.on(min, () {mainWindow.minimize()})ipcMain.on(max, () {mainWindow.maximize()})ipcMain.on(cancel_max, () {mainWindow.unmaximize()})mainWindow.on(ready-to-show, () {// 自定义标题mainWindow.setTitle(EC编程俱乐部)mainWindow.show()})// 窗口变为最大化状态mainWindow.on(maximize, () {mainWindow.webContents.send(maximize)})// 窗口从最大化状态退出mainWindow.on(unmaximize, () {mainWindow.webContents.send(unmaximize)})mainWindow.webContents.setWindowOpenHandler((details) {shell.openExternal(details.url)return { action: deny }})if (is.dev process.env[ELECTRON_RENDERER_URL]) {mainWindow.loadURL(process.env[ELECTRON_RENDERER_URL])} else {mainWindow.loadFile(join(__dirname, ../renderer/index.html))} }app.whenReady().then(() {// Set app user model id for windowselectronApp.setAppUserModelId(com.electron)app.on(browser-window-created, (_, window) {optimizer.watchWindowShortcuts(window)})createWindow()app.on(activate, function () {if (BrowserWindow.getAllWindows().length 0) createWindow()}) })ipcMain.on(quit, () {app.quit() })app.on(window-all-closed, () {if (process.platform ! darwin) {app.quit()} })
http://www.hkea.cn/news/14272049/

相关文章:

  • 湖州网站建设有哪些网页制作实践 做网站
  • 宁夏交通厅建设局网站免费做英语卷子的网站
  • 江苏宏澄建设有限公司网站网页设计期末作品源代码
  • 做趣味图形的网站中文html网站模板下载
  • 上海网站公司设计怎么查找网站备案主体
  • 网站备案 核验单网站怎么设置支付
  • 塘沽网站优化海外网站建设推广最好的
  • 福建省文明建设办公室网站seo推广培训
  • 响应式的网站建设一个多少钱建设外贸型网站
  • 成品网站管理系统WordPress网络功能
  • 英文网站建设 淮安国外网站网站app
  • 网站建设基本步骤包括哪些flash怎么做网页
  • 建网页和网站的区别wordpress 快速安装
  • 谁做的四虎网站是多少钱邢台集团网站建设费用
  • 合肥做装修哪个网站好天津市津南区教育网站建设招标
  • 品牌网站建设收费情况深圳深圳建设网站
  • 派点网站建设重庆电力建设公司网站
  • 山西住房建设部网站西部数码网站管理助手 301
  • 做公司网站哪家 上海wordpress修改社交
  • 网站建设开票开什么内容小程序怎么开通
  • 怎么自己开发网站企业如何申请网站
  • 网站功能模块是什么百度广告管家
  • 购物网站建设与开发wordpress做淘宝的交流插件
  • 温州好的网站推广郑州出租车网
  • 做it的网站有哪些wordpress优酷插件
  • 忻州网站建设公司建设银行网站上预览电子回单
  • 建设应用型网站的意义网络维护电话
  • 做区位图的网站大理公司网站建设
  • 做网店好还是网站网站优化建设山东
  • 美团网站除佣金表格怎么做网上电影网站怎么做的