2 actionbar tabs don't fill a screen width on FULLHD (xxhdpi) Android device - android-actionbar

I have required styles (from designer) applied on my TABs used in Actionbar for navigation and I use Actionbar Sherlock. They look perfectly from ldpi to xhdpi devices, but situation changes on xxhdpi devices.
I have only 2tabs and except mentioned styling, I have the same code as Sherlock DEMO app in "Tab Navigation". I found 2 older simmilar questions not answered yet.
Stacked ActionBar tab bar not filling parent
(I've got a simmilar problem, centered tabs. Sorry for inconvenience, I can't attach images because of rep points.)
and
action bar tabs not fill screen in android
Since the time of their posts, this is not only the issue of tablets, but now, there are many FULLHD (flagship) smartphones and this is becomming the big "design" issue.
I want my 2tabs to fill/match the full width of ANY device size, so in my case to fill 50% width each. Default Holo styled tabs doesn't look that bad (as shown in previous link), but my styled tabs on this big screen look much worse.
PS: Situation doesn't change if I make a text in tabs bigger or longer. Tabs don't adujst their width, instead they change their height and text takes 2 lines.

Unfortunatelly, this is a another JB changes:
https://android.googlesource.com/platform/frameworks/base/+/b8139af3dcae80c0030afd0354dc424a7c72c3d9
One of solution: set target SDK 15 or lower.

Related

Is there a way to limit the max size of a chart in chartjs whilst still maintaining responsiveness?

I made a responsive doughnut in chartjs. On mobile devices the size fills out the screen nicely and is as I'd like it but when I switch to desktop it also fills out the entire screen and is too big for my liking. Is there a way to set the relative size to for example, half screen when viewing on desktop and then reverting to full-screen if being viewed on mobile?
I tried the different settings on the chartjs site but can't find anything helpful.

qt on Mac: Form Layout fails to stretch horizontally

I'm still trying to do some pretty basic stuff with qt, and it's been a struggle. I'm specifically targeting for Mac. My current problem is getting the forms to not suck.
The simple problem. Create a new MainWindow app. Go into the Qt Creator (open Forms -> mainwindow.ui).
Drag 3 labels into place. Then I dragged 2 Line Edits and for fun, a Dial, but that part probably doesn't matter.
Click the main window and then tell it to use Form Layout. Within Qt Creator if I resize the window, my various line edits expand to fill the available space, exactly like I want.
Run the app. All the line edit fields are a fixed length, very short (if I don't override their minimum width), and do NOT resize as I resize the window.
Three quarters of the reason to use Form Layout is for resizing capability.
I've tried clicking on the central widget before setting to Form Layout: no change in behavior.
I do get reasonable behavior if I use a grid layout, although I have to add a vertical spacer at the bottom or my dial resizes crazily as I play with the window size.
So... Am I just doing something wrong with Form Layout? Or does it not work well on Mac and I should use Grid Layout instead?
I really miss Motif's XmFormLayout. It took time to set all the constraints, but I could make my forms do exactly what I wanted. Ah, but so 1990s.
On the panel to the right where you can see the objects, click the centralWidget. In the property panel, scroll down until you get to the layout properties of the form layout. Set the layoutFieldGrowthPolicy to ExpandingFieldsGrow.
By default, the line edits are not growing to fill the available space on macOS because they are not supposed to. This is some sort of macOS UI guideline. QFormLayout follows the platform conventions by default.
It would also be nice if I can figure out how to NOT necessarily expand everything to full width. I have a few Line Edit widgets that I'd like to keep short. They're going to hold TCP port numbers.
For those, set the Horizontal Policy property (it's grouped inside the sizePolicy property group in the properties panel) of the affected line edits to something suitable. In this case, probably to Fixed, but look up the documentation first of what each setting does.

resizing a MDI Tabbed Group

Using C++, MFC, I have an application with MDI Tabbed Groups. I have written code to
1
vote
0answers
21 views
programmatically create new tab groups and move tabs around. That all works fine.
But I am having trouble setting the size of the tab groups I make. By default, the groups are given a size that is half of the available space. I couldn't find an official size method on the tab control class. So I tried SetWindowPos() and MoveWindow() on the group controls instead. That seems to have an impact, but not a full impact.
For example, lets say I want group A to be 10% of the frame window's area, while group B takes 90%. When I issue calls to SetWindowPos() or MoveWindow(), I get about 30%:70% instead of 10%:90% I asked for. It seems like it wants to do what I said, but it is fighting it.
I also tried calling the tab control's AutoSizeWindow(FALSE) method beforehand.
But that didn't help.
Any ideas?
Any ideas?
Ok, my mistake. MoveWindow() works fine.
I just didn't notice that each tabgroup needed a rect with it's own origin. (every left would be 0)
I tried to setup rectangles that were in frame window coordinates.

Avoid truncation of Labels in a ListView

folks!
I use a listview (Icon mode) to display items which consist of an image and a label.
As you can see in the shots the row height is variable on y depending on the label length. The problem is that I want the complete labels to be drawn, but they are automatically shrinked into two lines:
The strange thing about it is that once you select an item the whole label will be shown:
This is also the case when deselecting the item, but when another item gets selected, only that one will be shown completely.
Is there a way (without drawing the text manually) to avoid truncation in my case?
If some code is needed to answer this question, don't hesitate to ask.
Greetings,
Satara
I'm guessing this was a design choice: make things look less cluttered. E.g. picture your desktop with all labels shown completely... will look messy in my case.
However, you can fix this by drawing the label yourself. Have a look into custom draw which is a service provided by the list control. The thing is that it's usually an all or nothing approach, so this will likely require you to draw everything yourself: border, image, label, etc. The other option is to get hacky: subclass the window and draw the labels again after Windows did in response to several messages (unfortunately Windows does not restrict the painting to WM_PAINT, an optimization that is a left-over from the old days...)

bold and normal font rendering

It is observed in some fonts sat Verdana, that the rendering for bold and normal text does not occupy the same width for a given text.
In my application i am making use of one such font ,and there is UI with list and highlighted item.
for highlighted item the font is same with bold attribute ,because of above mentioned font issue the text appears to move(enlarge and occupy more space )horizontally when the list is scrolled.
I can use bold font with one less in font size which seem ok but not perfect
Is there any corrective measure to resolve this?
What you describe is the default attribute of most proportional fonts. If having the string width increased seems ugly, try using other visual methods to draw attention to the selected item, such as changing the background color.
You could make the list items wide enough to accommodate size increase when it becomes bold.
If the highlight has to be bold, most likely your only option is using a proportional font (doesn't need to be courier, you may find some sans-serif proportional fonts acceptable).