Resize electron.js app from draggable css area - css

My app uses a frameless window and I made a custom title bar along with it, I set the entire titlebar area to be draggable with -webkit-app-region: drag; so you can position the window on the desktop, but now I can't resize the app from those corners, is there any way to keep both?
Edit: I added -webkit-app-region: drag; to the buttons and the left title area because I lost control of the buttons and I can resize from corners and those edges, but the top edge is still inactive

Related

React-beautiful-dnd: Prevent page from scrolling when draggable is being dragged near edge of page

I'm using react-beautiful-dnd in a project and when I'm dragging a draggable, the page auto scrolls if I drag it near the top, bottom or sides of the page. I could theoretically fix this problem by placing the drag and drop container in the middle of the page so that the user probably wouldn't trigger the auto scroll as the draggable wouldn't be dragged to the edges of the page, but I'd prefer not to alter the layout in that way. Is there any way to disable the auto scrolling?

How to resize two layouts in a Qt widget?

I have a Qt Widget which contains two scroll areas vertically. In these scroll areas, labels are dynamically added and the count of labels always changes. Now I am trying to implement a feature where i can drag either the bottom border or top border of the second scroll area so that the view of the dragged border changes. Does anyone know how can this feature be achieved.

Semantic UI Modal fixed position

I am using Semantic UI 2.1. I have a modal which displays pictures. The pictures are varying sizes. I then have nav buttons to move back and forth between the pictures. The modal wants to keep resizing/recentering itself as I move through the photos. What that means is the navigation buttons keep moving up and down so a user can't just click, click, click to move through the photos. They have to click, move mouse, click, move mouse, etc.
Is it possible to have the modal fixed to the top? I am happy for it to resize but at a fixed top position. That way the nav buttons will stay under the user's mouse cursor.

How to increase the clickable area of a QPushButton in Qt?

The Back button in the top left corner of my touch user interface is a little hard to press on a resistive touchscreen, because the touch events are not so precise at the borders of the screen.
The visual size of the button can't really be increased because the screen space is needed for other things. Thus I would like to increase only the clickable area of the button. So when the user touches somewhere in the top left corner of the screen (as marked in red), the back button should be pressed. Note that the red area also overlaps another button. Ideally, the visual button state would also change to the "pressed" state.
Can anyone give me some pointers in the right direction? I have considered the following things, but I'm unsure which would work.
Overlaying the actual button with a larger, invisible button, painted with a transparent brush. But I have no idea how I could paint the smaller button as "pressed" when the user is pressing the invisible button.
Creating a new class based on QWidget, which has the size of the red area (with invisible background) and contains the actual button. Then relay touch events to the button so that it is pressed when the user touches the empty area.
Subclassing QPushButton and reimplementing QAbstractButton::hitButton to accept points outside of the button's area. But I guess that function would probably isn't even called when I touch outside the widget area.
To occupy more vertical space inside a layout, set buttons vertical policy to expanding.
To increase the clickable area without increasing the visual size, increase the margin.
To have the back button overlapping other buttons, don't put it to a layout. Instead set its parent directly and move it to the corner.
backButton = new QPushButton("< Back", mainWindow);
backButton->setStyleSheet("margin: 30;");
backButton->show();
backButton->resize(150, 90);
backButton->move(-30, -30);

How to handle a QDialog displayed out of screen?

I have a main widow. I move it to an bottom edge or corner. Then I open a dialog by click some button in it. The dialog is positioned at the center of the main window since I set the main window as its parent. However, the dialog is not displayed on the screen because the main window is at the edge or corner. How to make it displayed on screen?
You can move it with negative coordinates until it becomes on screen:
dialog.move(-dialog.width(), -dialog.height())
This should move it so it's bottom right edge aligns with main windows's top left edge.
Or you could make the dialog parentless and move it in relation to screen coordinates instead:
dialog.setParent(None)
dialog.move(400, 300)

Resources