I am developing an app using Qt 5.5
I have a main window with a dock, and a dockable window which can be dragged out/popped out, floating in its own separate window. (QDockWidget)
The resize border width of the main window is perfectly adequate, so resizing the main window using the mouse is very easy.
Resize margin width of main window (ie: when docked):
The space within the red border here represents the area where the mouse cursor changes to a resize cursor.
Resize margin width of undocked window (ie: when hovering):
When I pop out my docked window (QDockWidget), so that it's now floating, the resize border width drops down to a single pixel
As such, it is almost impossible to resize a floating dock window.
I am running Ubuntu Gnome 14.04, so using Gnome 3 with (I think?) Adwaita theme.
I have tested this on default Ubuntu 14.04, so using Unity, and this is not an issue there (the resize border width is several pixels, so much easier to "find" with the mouse)
Question:
How can I configure Gnome 3 / Adwaita to increase this border width?
Related
I wonder about this bottom and left gap, and also wanna remove it
It occurs only when i open "vim", not Iterm itself
Is there any solution?
The general principle is that the screen of a terminal emulator is a grid where each cell has the same dimensions as the others and those dimensions are determined by the font and font size used. If the window's dimensions and the grid's dimension are incompatible, then the window can't be filled with the grid and you have that kind of gap.
In this case, the cell dimensions are 16px * 38px so the grid can only fit in a box whose dimensions are a multiple of 16 in width and a multiple of 38 in height.
Now, your screen's dimensions appear to be 1630px * 2862px, which is rather unusual. The width is not a multiple of 16 and the height is not a multiple of 38, so, with your current font settings it is impossible to fill the screen.
For that to be theoretically possible, you would need font settings that make individual cells 16.3px wide and 38.16px tall, or some other "impossible" ratio.
Note that you also have a padding, here, that effectively prevents the grid to ever fill the window anyway.
None of that is really a problem when the program you run in your terminal emulator doesn't paint the background of those cells but your Vim colorscheme does, which makes the effect described above apparent.
The only practical workarounds are:
Define the same background in Vim and in your terminal emulator.
Make Vim's background transparent.
I have a dialog created in Qt Designer with contents that resize when the window is resized.
When the window height is made too small, the text in the window clips as follows:
How do I prevent the labels from being clipped?
Most specifically, the window must not resize any smaller than the size of the word wrapped text without clipping.
I'm making an emacs-esque toy text editor. At startup, there's one large window (a QTextEdit derivative) in the top center of the screen, with a minibuffer (QLineEdit derivative) underneath. Both of the actual editing widgets are contained in the grids of parent classes called Window and MiniWindow (Window also keeps track of a QLabel that appears directly beneath the QTextEdit).
My Window object is at location 1, 1 in the grid, and my MiniWindow object is at 2, 1. I've set content margins to 0 and spacing to 0, which looks great at first, but when I try to grow the window by dragging on the corner, this starts to happen:
As you can see, the screen is divided into two rows (as it should be), but half of the vertical length of the screen is dedicated to each row. What I need is for the top Window to stretch its length during resizing so that it is always adjacent to the MiniWindow underneath. Is there some other option I need to be setting?
Nevermind, got it.
I was having this problem because the QLineEdit object was in the grid of my container class, MiniWindow. The height of a MiniWindow object is free to vary with the window resizing in a way that a QLineEdit alone would not be. The fix was set to the maximumHeight of MiniWindow to approximately the height of a QLineEdit, which is around 16.
Works great now.
I'm playing about with the most recent NSDocument in a Swift document-based-app. One thing that's a bit odd is that the starting location for a new window is near the bottom of the screen.
Playing with the Storyboard a bit, its not clear how to use the built-in settings to come up with a reasonable "near the top" selection - the setting moves up from the bottom, not down from the top, so the position would change depending on the screen size?
I assume there's a position mechanism I can hook, but it's not obvious in the shell code that's supplied. Any hints?
OS X coordinate system is flipped in contrast to iOS. So the 0,0 is the bottom left corner.
You can calculate the position of your window in similar manner (any screen size)
CGFloat width = NSWidth([self.window screen].frame);
CGFloat height = NSHeight([self.window screen].frame);
[self.window setFrame:NSMakeRect(100, height - 100, width, height) display:YES];
Most easiest is to set initial height to 900 and forget about it and enable window restoration -> this will cause to open the window where it previously was and this is where it user wants.
Select your window in Storyboard. And fill initial position coordinates
We have an application that draws a colored border around specific application windows and dialogs.
We use GetWindowRect to get the rectangle of an application window. But on Windows 10 this function includes the shadowing border resulting in a large gap between our colored border and the application window. So we need to compensate for the shadowing border.
Which API can we use to determine the width of the shadowing border around application windows and dialogs in Windows 10?
I found the solution. Use DwmGetWindowAttribute with DWMWA_EXTENDED_FRAME_BOUNDS to get the correct size:
DwmGetWindowAttribute(hWnd, DWMWA_EXTENDED_FRAME_BOUNDS, &rect, sizeof(rect));