Adjusting Position and Dragging Functionality of Prompt Window in custom-electron-prompt Library on macOS
Closed this issue · 5 comments
Hello, I would like to raise an issue regarding the custom-electron-prompt library on GitHub. I am using this library on a macOS computer and I have noticed that the prompt window is displayed at the top of the screen and cannot be dragged. Could you please provide guidance on how to adjust the position of the window and make it more user-friendly? Thank you.
It shouldn't happen.
Did you set parentBrowserWindow
or alwaysOnTop
in the settings?
Can you share your code?
The code looks like this, and it displays perfectly fine on a Windows computer. However, the issue described earlier occurs on a Mac computer. Please see the screenshot below.
prompt1(
{
title: '注册',
icon: path.join(__dirname, '../favicon.png'),
alwaysOnTop: false,
// label: '提示:请在注册码有效时间内完成注册',
label:
'<p style="font-size:14px">彩虹客户端(' +
version +
')<span style="font-size:12px;color: red">(版权所有,请勿对外传播)</span></p><p style="font-size:12px">内部试用版本,有疑问请联系内部群进行反馈,关于注册码请联系管理员。</p><span style="font-size:16px">提示:请在注册码有效时间内完成注册</span>',
useHtmlLabel: true,
type: 'multiInput',
multiInputOptions: [
{
inputAttrs: {
type: 'text',
required: true,
placeholder: '请输入注册码',
},
},
],
buttonLabels: {
ok: '确定',
cancel: '取消',
},
resizable: true,
width: 600,
height: 260,
},
win,
)
Very weird... what you are describing (and your screenshot) indicate the window is created without a Title Bar - aka the browserWindow option frame = false
(https://www.electronjs.org/docs/latest/tutorial/window-customization#create-frameless-windows)
but the default options set the frame to true
, and it certainly doesnt differentiate between Windows and MacOS, and you didn't override it, so i'm no sure what's going on here
custom-electron-prompt/lib/index.js
Line 52 in 78d2965
- You can try passing the
frame = true
option but like I said, thats already the default so it shouldn't do anything - You can try not passing a parentBrowser window (remove the
win
second parameter)
btw this library usually works on macOS - https://github.com/th-ch/youtube-music uses it and never reported any problems (and they have developers on macOS and thousands of macOS users)
Very weird... what you are describing (and your screenshot) indicate the window is created without a Title Bar - aka the browserWindow option
frame = false
(https://www.electronjs.org/docs/latest/tutorial/window-customization#create-frameless-windows)but the default options set the frame to
true
, and it certainly doesnt differentiate between Windows and MacOS, and you didn't override it, so i'm no sure what's going on herecustom-electron-prompt/lib/index.js
Line 52 in 78d2965
- You can try passing the
frame = true
option but like I said, thats already the default so it shouldn't do anything- You can try not passing a parentBrowser window (remove the
win
second parameter)
btw this library usually works on macOS - https://github.com/th-ch/youtube-music uses it and never reported any problems (and they have developers on macOS and thousands of macOS users)
Thank you, when I deleted the second parameter 'win', it was successful, but I am not sure what impact deleting it will have😂
It means the prompt won't be "bound" to the main window - for example, you can minimize the main window and still see the prompt