I have a Qt window with a toolbar. I have several actions in it, with their icons set to some of qt standard icons.
However, they are rather small. I want to enlarge toolbar and the buttons inside, so that their icons would stretch accordingly. How should i go about it?
As of now, toolbar was filled using QtCreatir's designer.
You can add a stylesheet. There are several ways to do that (http://qt-project.org/doc/qt-4.8/stylesheet.html). I use an external stylesheet and increase the toolbar size with following code:
QToolButton
{
height: 64px;
width: 64px;
}
Related
This Stackblitz example opens a simple dialog which contains a radio group in the mat-dialog-content div.
You can see that the dialog-content shows an ugly scrollbar:
This does not happen when other components are used: e.g. input, etc.
Using chrome dev-tools, I can see that the mat-radio-buttons have a height of 20px:
but the mat-radio-group only has a height of 17px:
Is this a bug in angular material components (the example uses version 12.0.4), or is there a simple workaround/css that we can use to get rid of the scrollbar?
I've tried explicitly setting the height on the mat-radio-group, but this has no effect.
Notes:
in production we do of course have many dialogs and some of them are large and need the scrollbars
we need an application wide solution/workaround
simply hiding the scrollbars is not okay: it must remain auto so that the dialog can react to size changes (e.g. user rotates device, some items are shown/hidden dynamically, etc.
For now we came up with a workaround that fixes the issue in all our 30+ dialogs.
The nice thing is that we can apply it in one place, in styles.scss:
.mat-dialog-content {
padding-bottom: 10px !important;
}
We just add a padding to the bottom of the dialog content area and then scrollbars: auto works as expected in all our dialogs (small and large). i.e. when you make the browser window larger/smaller, the scrollbar is automatically shown/hidden.
And it also works when there are multiple mat-radio-groups in one dialog.
The additional padding between the content and bottom dialog-actions is acceptable for our ui.
Stackblitz example with workaround
The reason this happens is due to the ripple effect on the radio button - which takes up additional space and causes the scrollbar to show. See https://github.com/angular/components/issues/20344
There are a number of ways to resolve this, such as using padding or margins on the components or on the dialog content itself like you did. The important thing is that there is enough space added to accommodate the ripple.
I am struggling with a primefaces calendar problem on a webpage rendered on a mobile device (tablet). It seems that the css values calculated by primefaces to show the popup calendar are not recalculated on window rotation (you need to click on it again to recalculate).
Here is an example:
I have my webpage displayed in portrait mode. I clicked the calendar icon and the position of the popup is good:
(notice the css with left: 719.406px, calculated by primefaces). Everything OK so far.
Now I rotate to landscape mode:
Notice that the popup is no longer near the calendar icon. Also, the css states that, by having the same left value.
In order to get it correct, I need to click anywhere on the screen to close the pop up, then click again on the calendar icon:
The position is now good, with a different and correct value of left: 1061.91px.
How can I make primefaces automatically readjust the css without having to double click each time?
The solution found for me so far was to add a custom value for the right alignment with the screen and override the left one:
.ui-datepicker.ui-widget.ui-widget-content {
left: auto !important;
right: 10px;
}
But the above solution is very specific for this screen and luckily because I always have the calendar button in the right part of the screen, so I can always assume that 10 pixels from the right will look ok.
I also noticed that ui-datepicker-div is a child of body element, so I cannot link it with the button with css.
Any ideas/help of a general solution will be highly appreciated.
Primefaces version: 6.2
This problem is fixed with Primefaces 7.0.RC3.
It was released a week ago.
https://mvnrepository.com/artifact/org.primefaces/primefaces/7.0.RC3
The title says it all. How do you go about doing this? For example, editing the width of a file upload button results in this: http://i.imgur.com/jacnps2.png For comparison, here's an ordinary file upload button: http://i.imgur.com/tIy05HA.png
The red rectangle represents the area the button normally takes up. In addition, when you hover your cursor over that spot (except for where the red and blue rectangles overlap), your cursor will transform into a hand icon, indicating that something will happen when you click that area. However, nothing happens.
The blue rectangle represents what portion of the screen you can click (which is mostly invisible, and much smaller than usual) to make the file upload form appear.
Trying to edit the file upload button's height yields similar results, only vertically instead of horizontally.
For the sake of explaining what my goal is: I'd like to overly a transparent or invisible file upload button on top of user avatars on my website. So far I've pulled off the easy parts, making the file upload button transparent and overlaying it on top of a user's avatar, but I haven't figured out how to edit the usable dimensions of the file upload button. For a working example of this, if you have a facebook profile, go to your profile and hover your mouse over your avatar. The words "Update Profile Picture" will appear and you can click them to edit your avatar directly from your profile instead of having to go to a separate settings page.
You can't style the file upload buttons, they are native to the browser and rendered differently in different browsers. All those styles file upload buttons are not actual file upload buttons but are simulating the file upload button's behaviour.
There are different approaches to this using CSS and Javascript. Most of them involve hiding the native button and placing a custom button on top it using position: absolute and opacity CSS properties and simulating the click on native button when clicked on the custom button.
As there are quite some solutions on the web to this, I will refer you to those instead of posting a solution here.
See below:
http://geniuscarrier.com/how-to-style-a-html-file-upload-button-in-pure-css/
http://tympanus.net/codrops/2015/09/15/styling-customizing-file-inputs-smart-way/
Cross-browser custom styling for file upload button
I did it with an after element and an icon from FontAwesome
# your-page.html.erb
<div>
<label class="button-image">
<%= f.file_field :attachment, value: "", class: "active-storage-button" %>
</label>
</div>
# app/assets/stylesheets/your-page.scss
.button-image:hover::after {
content: "\f196";
font: normal normal normal 100px/1 FontAwesome;
color: #778899;
padding: 10%;
right: 10%;
position: relative;
}
.active-storage-button{
display: none;
}
# for hover effect
.button-image:hover::after {
color: #5a5a5a;
cursor: pointer;
}
The flex title window component is nice and all, but before it shows up it insists on blurring out the background of your window if it's set to modal. What if I want it to just show up immediately or at least speed it up so that the user doesn't have to wait around to enter data. Am I going to have to build a custom component based on TitleWindow to get this or not have it be modal? If I were to do that could I extend current TitleWindow or just copy out the source directly?
Play with Application styles, such as modalTransparencyDuration.
Yes, you can apply those in the CSS:
global {
modalTransparencyBlur: 2;
modalTransparency: 0.8;
modalTransparencyColor: #000000;
modalTransparencyDuration: 500;
}
In your PopupManager set the modal to false.This will allow the user to interact with other popups.
PopUpManager.addPopUp(titleWindow, this, false);
How do I increase the native FORM submit button size for OSX-Safari?
I want to keep the native look of a FORM submit button for it's respective operating system while also enlarging the size of the submit button. (Meaning, no use of images, custom borders etc..)
Using the following CSS:
input.submitbutton {font-size:150%;}
On Windows, this increase the submit button size height and width as desired ... regardless of the browser (Safari, Firefox, IE, Chrome).
But on OSX - Safari does not increase the button size at all. The form button size remains the default size.
Try to include this CSS property on your style:
-webkit-appearance: button;
Hope this helps!
Safari's form buttons are notoriously hard to style (if not impossible).
As others have said, height is pretty much untouchable.
What you can do is set the font size to an exact pixel size to resize the button.
input.submitbutton {font-size:14px;}
That should make the font size larger and the button as well. It does max out though...you can't just keep increasing the font size.
The "native look" of a pushbutton includes a fixed height by definition
Push Button Specifications
Control sizes:
Push buttons are
available in regular, small, and mini
sizes. The height of a push button is
fixed for each size, but you specify
the width, depending on the length of
the label text you supply. If you
don’t specify a wide enough button,
the end caps clip the text.
What you want would not be "native" and therefore will necessarily involve the creation of a custom image, or you can always do something like this
http://girliemac.com/blog/2009/04/30/css3-gradients-no-image-aqua-button/
If you apply a border to the button, Safari abandons it's glossy button and you can do what you like with it.
I am using several input type="button" and they style ok using:
input[type="button"] {
-webkit-appearance: button;
height:40px;
}
They did not style without the -wbkit- line.
or use the <button> tag.
Particletree! Rediscovering the Button Element
It’s an edge case, but if you’re trying all sorts of things and just can’t get Safari to make button labels smaller, you might have activated the “Never use font sizes smaller than X” option in Safari’s preferences:
This snagged me yesterday. Just turn it off and Safari will be much more likely to respect your CSS directives.
input.submitbutton{
width:200px;
height:500px;
}
Seems obvious, but have you tried changing the element size instead of the font size?