Let's assume I made a kivy window without borders:
from kivy import Config
Config.set ('graphics', 'borderless', '1')
After that, it is no longer a pattern to be able to move the window with the drag of the mouse.
Now my doubt. How do I move the window by dragging the mouse?
There is a module in kivy, called MotionEvent, but I don't know how to use it for my purpose.
Is there a function, which I can always call when I click and drag the window, causing each pixel dragged to call the function, iterating Values over the window position? Or a better way
You can probably set kivy.core.window.Window.pos, that might be compatible with coding up a dragging behaviour but I don't know how well it will work.
Related
What happens is that I initiate the window drag instruction with Neutralino.window.setDraggableRegion, it works but there is a very big problem in rendering.
I am on a windows system. Here is a video of the problem:
Video of the problem
As you specified, the window is dragging but the mouse doesn't move with the point you click on, instead the mouse is at a different position.
I Looked at how draggable region function works under the hood, and it's handled by the JavaScript Client File, by setting the window position to the amount of mouse has moved on x and y.
since the mouse pointer doesn't move instead the window moves relative to the position from where you started clicking.
I will raise this issue, and soon a fix for this will be out!
Issue has been raised
Is there a way to check if the root is visible (at least part of it is on the screen). I tried <tk.Tk>.winfo_viewable() and <tk.Tk>.ismapped() but both of them return True even if the window is fully hidden by another window. Checking if the window isn't focused wouldn't solve my problem.
I need it because I am working on improving this that uses <tk.Tk>.overrideredirect(True) to remove the title bar. The problem is that I can't Alt-Tab to the window so I want to call <tk.Tk>.overrideredirect(False) each time the window isn't (at least partially) visible.
Can I have a frameless but resizeable window in X?
Setting just MWM_DECOR_RESIZEH without the other flags doesn't make it resizeable.
I can resize it myself manually but then I need to scrape for themed mouse cursors which are non-standardized and are also different for each corner and side.
There are exactly two ways to resize windows:
Leave it to the window manager and be happy. This is recommended way for X. If someone don't like it, he can install another WM that will make it better.
Make it by yourself - draw border around window, track the mouse cursor and when the user drags the edges - resize the window in a way you like. In this case you must set the override-redirect flag of the window and WM will not mess with it.
I am trying to create a dockable window in Qt (it sits taking 4px width at the edge of the screen, always on top and it slides out when you hover it). I have to use WindowFlag BypassX11WindowManager (in order to hide taskbar hint, disable moving/resizing/etc. from window manager). I use these flags:
Qt::FramelessWindowHint
Qt::CustomizeWindowHint
Qt::X11BypassWindowManagerHint
Qt::WindowStaysOnTopHint
When I need my dock to be activated, I use the activateWindow() method. However, I have no idea, how to deactivate it.
Is there a way I can force my window deactivate? Now I can do it only by clicking another window and then return to the one that was active before revealing dock.
You should be able to use ->hide() to simply hide it if you don't want it to appear at certain points.
I assume, by the way, you know there is QDockWidget/ class that may help you as well. It's unclear from the above if you're using it or not.
I need to create a magnifier like feature in my app. Like the "loupe" effect on the iphone !
The problem is that I need to do that inside a popup window and I don't get how to make it work !
The popup window display a grid of colors that I generate and draw one by one using shapeDrawables. What I want is to display that color bigger, zoom on it when the user touch and move his finger around the popup window (color grid). The idea is to create a tracking-zooming effect on the colors so the user can see more clearly under wich color his finger is currently located.
Problems are :
I can't seem to create another popup window on top of this one, Android limitation I think ?
If I modify the current shapeDrawable, resize it, change the boundaries, It needs to re-display the popup window before it takes effect (which is not acceptable of course)
So, anyone knows of a way I could draw over that popup window ?
EDIT :
I've tried solving this issue using a Custom Toast object...But it doesn't quite do the trick. It works, but toast object appears slowly and so the touch motion is not in sync at all with the user movement over the color grid.
I'm not sure if this will help you or not, but you might be able to accomplish this by using a second Activity... this second Activity would use Android's translucent theme if you include the following attribute in your manifest:
<activity android:theme="#android:style/Theme.Translucent">
This second activity will now only contain what you place in your layout. That is... the "real" activity you're running will still be visible behind it (anywhere you don't cover it up with views in the new layout).
You also might prefer Theme.Dialog if you really want to resemble a popup.
Something to keep in mind if you take this approach is you will probably want to override onWindowFocusChanged() in the new activity, and finish() in the event of you losing focus. Additionally, you'll need to figure out how to share your data between the two activities.