Comments (12)
@SOVLOOKUP https://github.com/clouDr-f2e/rubick/releases/tag/v0.0.3-beta.9 试试看,应该已修复
这么做就不能用户调整窗口大小了,windows下setsize是有bug的,个人的解决方案:
let diff = { x: 0, y: 0, width: 0, height: 0 }
const moveBounds = (win, x, y) => {
var bounds = win.getBounds()
if (bounds.x != x || bounds.y != y) {
bounds.x = x
bounds.y = y
setBounds(win, bounds)
}
}
const setBounds = (win, bounds) => {
var _setbounds = {
x: bounds.x - diff.x,
y: bounds.y - diff.y,
width: bounds.width - diff.width,
height: bounds.height - diff.height
}
var _bounds = win.getBounds()
// 预期设定与当前位置偏差小于2px则忽略设定,否则可能窗口抖动
var x = _setbounds.x - _bounds.x
var y = _setbounds.y - _bounds.y
if (x * x + y * y > 4) {
win.setBounds(_setbounds)
_bounds = win.getBounds()
diff.x = _bounds.x - _setbounds.x
diff.y = _bounds.y - _setbounds.y
diff.width = _bounds.width - _setbounds.width
diff.height = _bounds.height - _setbounds.height
}
}
from rubick.
@SOVLOOKUP 是不是需要授权? 窗口拖拽依托于 robotjs
所以可能需要系统权限。如果未开启,可能无法拖东,也就导致了误触拖到边缘改变窗口了
from rubick.
不是授权的问题,已经开了管理员权限了,在win10的时候并不会发生这种情况。
为什么不像utools一样使用 -webkit-app-region: drag;
来定义拖动区域呢?
from rubick.
@SOVLOOKUP 需要对可点击区域设置 non-draggable,详见:https://www.jianshu.com/p/96327b044e85
from rubick.
@SOVLOOKUP 需要对可点击区域设置 non-draggable,详见:https://www.jianshu.com/p/96327b044e85
from rubick.
或者可以只将输入框设置为 dragable ,看作是一个自定义的标题栏
from rubick.
@SOVLOOKUP 输入框占了整个体积,如果输入框设置成 dragable 跟全部设置成dragable 差别不大了
from rubick.
@SOVLOOKUP https://github.com/clouDr-f2e/rubick/releases/tag/v0.0.3-beta.9 试试看,应该已修复
from rubick.
@nxnminieye 这是一个令人兴奋的点,可以提个 pr
from rubick.
@SOVLOOKUP https://github.com/clouDr-f2e/rubick/releases/tag/v0.0.3-beta.9 试试看,应该已修复
刚刚试了一下最新版本,问题并没有解决
from rubick.
@SOVLOOKUP 这次真的修复了
from rubick.
@SOVLOOKUP 这次真的修复了
还是没有完全修复,多拖几次,依然会越来越大,window下setBounds和getBounds的结果是不一致,当前的做法只是单次拖动不会越拖越大(事实上单次也大了一两个像素)
from rubick.
Related Issues (20)
- 同步报错
- 网页快开遇到的bug
- 希望可以原生支持win on arm
- 增加长按右键可弹出超级面板的功能 HOT 1
- 希望能增加常用插件,备忘录、todo等
- MAC设置不了快捷键 HOT 3
- 输入时无法输入空格 HOT 1
- 超级面板(系统)
- Ubuntu 20.04 启动后窗口空白
- 需要【翻译】功能 HOT 2
- 建议提高utools插件兼容性 HOT 2
- mac版本使用,分离窗口后程序坞能否独立显示。 HOT 1
- 无法定位程序输入点DiscardVirtualMemory于动态链接库KERNEL32.dll上。 HOT 1
- 希望列表支持上箭头,快速跳转到列表底部
- 请问这种情况,该如何修改插件?
- 本地启动拖入文件夹后再次打开会消失
- 支持最大化挺不错的,但是图标拉长了
- UI 插件 onPluginOut 钩子未被调用
- 截图工具会截取到自己的UI
- 编译问题
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rubick.