How to force awesome to respect xterm geometry settings? - awesome-wm

If I have 2 floating xterms open and open a third one, it seems the -geometry settings I give on the command line are ignored and awesome tries to figure out on its own where the third xterm should go. How do I force it to respect the -geometry setting?

In the rules, you have a placement property. It defaults to "place stuff on the current screen where there is the most room".
You need to remove or override this for xterm. You can do this either by adding a new rule or editing the current ones. Adding function() end as the placement function in an xterm specific rule should override the catch-all rule.

Related

Why does a picture appear in the GUI Builder and on the device but not in Codename One Simulator?

I am designing my app UI with the GUI Builder. I created a new Form and defined a style as follow :
FinishFlagIcon {
background-image: url(pics/FinishFlag.png);
cn1-background-type: cn1-image-scaled-fit;
cn1-source-dpi: 320;
font-size: 11.9mm;
}
I set this style on a label and it appears on the GUI Builder.
However when I launch the project in the simulator it does not appear anymore.
I also tried to use a Scaled Label and defined the icon as FinishFlag (which was present in the res file), and again it appeared in the GUI Builder but not in the simulator. Of course there is no error printed in the console telling me the file could not be found.
Please note: the res/myCustomTheme.css folder holds all the subfolders related to the png (and those subfolders are populated with low to hd pngs) and the src/theme.res has the pictures (folowing Shai's advice) :
So what should I do to make the picture appear in the simulator ?
Edit : I tried to hand code the UI and added a Label (with the UIID defined above) to the the central area of a BorderLayout. I does not appear either until I add 3 spaces or more to the Label. I did not try again with the GUI Builder. It looks odd to me, is it done on purpose ?
Edit September 13th 2017 : If I build the app and open it on a real Android device then the labels appear.
Edit September 15th 2017 : For people having the issue of component not showing, as advised in the accepted answer the solution consists in removing top or bottom constraint of the component not showing and setting it to auto (click on the lock) so that there is enough space for the components. So eventually after setting to "auto" the bottom constraint of the progress bar an labels the expected result appear on the simulator :
Any help appreciated,
The images in your issue are a red herring. It looks like the problem is with your layout insets. Notice that none of your lower components are showing up in the simulator. The "progression" label, the three zeroes, etc...
I can't see the constraints you are using for the flags or the zeroes labels, but I can see that the "progression" label has fixed insets on both top and bottom. This may result in a zero height if there isn't enough space for it. Try changing either the top or bottom insets to "auto" so that they are flexible.
Try changing the simulator to use the desktop theme so that you can resize the window and see how the form looks at different sizes.
You can also easily verify this by overriding the layoutContainer() method of the form, and check the height that your flag label is getting:
public void layoutContainer() {
super.layoutContainer();
System.out.println("finishflag height: "+gui_FinishFlag.getHeight());
}
I'm not sure what's the "right" solution for this so maybe Steve can interject but this is what's happening.
You have two resource files: theme & theme.css.
The images in theme.css work great for your styles. However, since the loading process loads theme and not theme.css the simulator is unaware of these images as the theme res file doesn't know of them.
The GUI builder is probably scanning all the res files here so it lets you do that which might be a mistake... You have the following options to workaround this:
Load theme.css and discard theme - you will need to define the inheritNativeThemeBool flag and should no longer use the designer tool if you take that approach
Use the designer tool to load the images rather than CSS
Explicitly load the css res file using Resources.open and explicitly pass it to the Form
Explicitly load the css res file using Resources.open and set it as the global resource file

How do I set or change specific style sheet properties in Qt for a QWidget, without resetting the whole style sheet?

I've been searching for a while for an answer to this problem and I'm rather surprised that I have not found a solution. I'm working with Qt on Mac and would like to customize QPushbuttons and other QWidgets, but I want to maintain the native look somewhat as well. For example, if I want to remove the margins of a QButton using style sheets, I do:
QPushButton btn(this);
...
btn.setStyleSheet("margin:0;");
This indeed removes the margins, but it also removes the native style already set for default buttons. Of course, I just want to modify margins using style sheets, how do I do this?
Also, I would expect that btn.styleSheet() would return the native style sheet, but it is blank by default. Only when I set my own style sheet, does it return a valid value, but only for the property I set. I get that setStyleSheet would reset the style sheet, but how do I modify certain properties and leave everything else as is?
TL;DR: It can't be done that way.
The native style cannot be generally expressed as a CSS style sheet, thus styleSheet() is empty by default on all styles. Thus, unfortunately, it's not possible to change native style elements one-by-one, since typically they are drawn by the platform APIs that allow little if any customization.
For examples, a QPushButton is drawn by the native calls on both OS X and Windows.
In the specific case of the margin, though, you can easily work around by creating a proxy style that returns smaller control rectangle and crops and transforms the painter before passing it to the base style. This also works for colorization/color substitution etc. You basically have to accept that the base style has to do the drawing, and then it's up to you to tweak it.

blockUI - change font-family & remove padded area on overlay?

Using blockUI. I looked through the options in the documentation, through the plugin itself, and even here on stackoverflow and I can't find where to change the font-family declaration for this. It appears to be using Times by default. Also, the font is displayed over a padded area. Is there a way I can remove that padded area part, I want only the text on top of the dimmed screen. Thanks.
Use message option for this.
Document here http://jquery.malsup.com/block/#options

Print background image in IE without enable "Print background colors and images"

Is possible to print a background-image whithout enabling "Print Background colors and images" in Advanced tab of Internet Options ?
I think to use a alternative way without "background-image"... Using div tag and position absolute is possible to emulate the same effect of background-image? Also I would like to repeat the background image through the page.
The ability to print background images (those images specified as background-images in the markup) is entirely up to the end user, you can not control this programmatically from your code. There is a plugin for Firefox that provides a JavaScript API to control many print settings - this might be able to control background-images. However, this obviously only works in Firefox and is dependent on the end user having this particular plugin installed.
You could use absolutely positioned IMG tags and manage the z-index of layered containers to push the IMG to the back, but TBH it's starting to get messy and you may not be able to achieve the affect you are after and maintain correct semantic markup. Certainly if you want the IMG to repeat you'd have to resort to JavaScript to create and position multiple IMG tags, or create one large image that you have manually tiled - not recommended.
Unless you have a specific requirement, users generally do not want (or need) background images to be printed - hence the easy reach option in the browser. So it may be best to rethink the problem. Print and screen are two very different media so you shouldn't necessarily try to mimic on screen display in print, hence CSS's ability to create print only stylesheets - if that is what you are trying to achieve?

How can I memorize all CSS shorthands?

I never forgot and always use shorthand for margin and padding because it runs clockwise, but how do you remember the others?
Do you use CSS shorthand wherever possible?
What are the best ways to remember different shorthands?
Update:
I also found 2 good shorthand Cheat-sheet.
Png - http://www.catchmyfame.com/wp-content/uploads/2009/07/CSS-Shorthand-Cheat-Sheet.png
PDF - http://www.eddiewelker.com/wp-content/uploads/2007/09/csscheatsheet.pdf
Here’s a decent CSS shorthand cheat sheet (PDF).
I personally am not good at memorizing such things, so I use the specific attributes, background-position background-image background-repeat etc. instead of the shorthand.
I find it's less error prone, and makes for more maintainable code: You can search & replace specific settings project-wide, which is impossible when using shorthand.
Use an editor that understands the shorthand syntax and gives you some degree of auto complete on them. I too don't need one that tells me margin goes top, right, bottom, left, but it is useful to have one that tells me the options for background for example.
Visual Studio does this - it won't be the right choice for everyone obviously, but if Visual Studio does it I'm sure there must be many others that do too.
I've previously had only the difficulty to remember the order to declare the a pseudoselectors link, visited, hover and active (it actually matters!). Here I use the LoVe HAte mnemonic for.
ctrl+T for new tab
ctrl+K for Google search bar
"css font shorthand" and
done!

Resources