Focus a new client in the `awful.layout.suit.max` layout - awesome-wm

I am coming from i3 and I only used two layouts tiled and stacked. I am currently looking for a way to get the stacked layout into awesome.
It seems that awful.layout.suit.max is very close to what I want. The problem that I have is that I can't seem to focus any clients.
awful.client.focus.bydirection doesn't seem to do anything with the max layout. I looked at how awful.layout.suit.max and awful.layout.suit.max and there doesn't seem to be anything special.
So I assume awful.client.focus.bydirection doesn't work because the clients are stacked. awful.client.focus.byidx(-1) doesn't seem to do anything.
How would I select a new client in the awful.layout.suit.max layout?

Try my Collision module. It has all the necessary logic to support geometric navigation. This includes rather hacky tricks to work with all default layouts.

Related

What can I use to represent data?

I'm doing a project at work where I'm taking the value of 8 sliders, running the values through a formula, then displaying that value on the screen. I would like to accompany with a type of vertical graph/bar that will span a grid. I tried using progress bars, which I ran into issues with both expanding the progress bar to the height of the grid, and displaying the value once the value went backwards. I had the same layout issues with the slider, once rotated -90 degrees the slider won't expand the height of the grid. Does anyone have any suggestions on what I could try or and objects that I haven't thought of?
I've been happy using Syncfusion to chart data in Xamarin.Forms. It sets up fast and comes with lots of friendly defaults so you can see right away whether it's working. Link to Syncfusion. If you want to see it used for real I'm using it in my app over here.
It sounds like from your question and the comments that while you're intent on charting data you're also very set on using a Grid to do something. From many experiences I've had in the past I would warn you to be careful about blaming the graphing/charting/drawing library for things going haywire when the problem could very well be that you are using the wrong layout or using it in the wrong way.

would a css grid framework be a good fit for creating application like layouts?

I have a webapp that I am making and it has some particular layout needs that are closer to an application than a website.
The layout has:
a left sidebar that is fixed to the left side of the browser window and has a static width until it stacks, this sidebar will have tabs in it
a content area that will expand to a certain max-width and then stop
a right side bar that is fixed the the right edge of the content
I've been struggling to really determine if using a grid system, like bootstrap, would be an appropriate fit for something like this. Having some rows/columns and a collapsible grid in the content area seems like it would make sense, but in the sidebars it seems like its best to not use a grid system at all. I don't particularly like the idea doing some layout in the html with bootstrap3 and some in css.
Basically my app has the same layout as http://qz.com/ and I want similar responsive design breaks, and with that I would like to know if there is one or more css frameworks that support that type of layout with little overriding.
if you have some experience with resposive design and media queries, i would code it myself to avoid the thousands of lines of unnecessary code that comes with frameworks/libraries. bootstrap is great, but it also requires a bit of effort to master, and it would be a bit overkill for this one layout (if i understand you correctly).
if you just need this one layout, i would really recommend you do code it from scratch (personally i'd use something like jQuery and LESS). i hope i understood your question correctly, and sorry if this was not very hands-on.
to sum it up: in my opinion you're probably better off coding it yourself, but bootstrap and other frameworks will provide valuable insight and inspiration for how to do it.

Grid layout - why should I use it, and should I use a framework like Bootstrap or Foundation?

I had experience with Twitter Bootstrap and Foundation, and I personally think the only thing I want to use is their grid system. Other features are just bloated.
So I read about the prospect of a grid layout. All of the articles I found are oriented toward an 'artistic' explanation (golden ratio ect). I am a coder at heart, I need a clear & logical reason to use a grid layout (for example: 'columns can be easily stacked on top of each other on mobile screen, and expand horizontally on larger screens'). Can someone give me the pros and cons of applying a grid system to my website? Personally do you think using a grid system is good?
If the answer is yes, should I use a premade grid system like from Twitter Bootstrap/Foundation or just make one for my own? All of the other features are unnecessary for me an irrelevant to my problem.
Thanks! :D
I agree with #kunalbhat that this might not be the best area to ask this but since you did I will try to answer it.
The grids are designed allow for speed and adaptability. Speed in multiple senses. The first part of the speed is the speed of writing the code. You can easily get the layout you want when you are using the grid system and everything aligns correctly. You don't have to remember your tables and columns and col-spans, etc.
The second speed is modifying your code. Inevitably you will need to go back and make changes, with a grid this is easily to do. Changing a col-md-7 to a col-md-6 easily makes a little tweak in the layout of your page that can easily be tracked and performed.
You mentioned responsive design, both Bootstrap and Foundation have responsive grids. The grids will snap to different sizes based on the viewport size. However you have control as well. For example if you want something to take 1/12th the screen in desktop, 1/4th on a tablet, and 100% on a phone that is easily done with Bootstrap and Foundation, both have grid classes that target specific viewports.
The also provide visibility classes based on those viewports.
For the "bloated" part that is easily solved. Using SCSS you can easily only import portions of a library. For example for one project I was on I only imported the Grid and it was considerably smaller.
I happen to think that this is a SO question, simply because of one of the main cons of CSS grid systems: semantic.
I think semantic is important for a web developer and having a class named col-md-7 is not the most semantic thing to do.
But I like grids, because they are easy and quick to use, so I started to use LESS. Because it allows me to use variables and functions(mixins) in CSS, I can build my own grid system on my CSS rather then on my HTLM.
You can start on Frameless and customize your own 'classes'.

Qt: Align controls that are in separate layouts

On a form designed with Qt Designer, I have two QGroupBoxes with a bunch of controls in each of them. Both group boxes have nearly the same contents (QLineEdits with associated labels).
What I want to do, however, is to align the controls together, as if they were part of the same grid layout. But since they are in separate containers, they can't share the same layout, and I don't want to give them a fixed width.
Is there a way to do it in Qt Designer? If not, is there a way to do it in code?
Thanks!
There is no way to do this in Designer. As far as I know, Qt does not provide a good way to do this in code either. If you really want this, you will probably have to rely on something a little hacky.
Here's my first idea: Override resizeEvent() in the widget that contains the two group boxes to get the preferred size (via sizeHint() or minimumSizeHint()) of all of the labels and set the fixed width of all the labels to the largest preferred width.
I would encourage you to ask yourself if this really matters (is it worth the development time?) and consider whether you can avoid the problem entirely with a slightly different UI design.
BTW, you might want to take a look at QFormLayout if you haven't already.

pure css layout for a web application?

I'm working on a web app that currently has a table-based layout. Ideally I'd like to go to pure css, or failing that, a hybrid tables-and-css layout* .
I've banged my head against the wall trying to understand css layouts and positioning. The main problem I'm encountering is that, depending on the state of the app, I have different things appearing in a 'section' of the layout -- what might be contained in a div or table. For instance, I might have some text and links, and then after user interaction, there might be a form, a table, some images, different text, etc. Anytime I find a css solution, it is for a fixed-element layout, or works in a specific case, etc. They're not robust solutions, in other words.
From this In Search of the One True Layout, the author about "Vertical placement of elements across grids/columns": "Designers face the choice of relying on elements being a particular height, resorting to tables or simply not bothering." Is this true? In my app, I can't rely on elements being a particular height.
Do I fall back on tables when I have elements of various hieghts ( which is quite a bit of the site, actually). I noticed that quite a bit of sites done by well-respected people and organizations use tables for layout in certain places, and not just for tabular data! This site included.
The chances are that there are CSS techniques to achieve what you want, but they may not be obvious if using CSS for complex layouts is new to you.
In your case, to 'get it done', I would recommend a hybrid type layout, and not feel bad about using a table to layout the pieces of the application that require those particular behaviours.
If it is particularly complex and difficult than a table might be the best and simplest approach even for the CSS expert.
Dynamic heights are only a problem if you need to implement a special effect of soem sort or a background image and oftent there are ways around that. It really depends on the Visual Design and what needs to be done to make each "block" flexible to use. Sometimes things arent possible but most of the time they are - they jsut tend to add complexity to the markup. But even that added complexity is easier for me to understand than nested tables :-)
My advice if you want to get things done and spend a ridiculous amount of time on css layout, browser compatibility, CSS reset, fonts:
write simple, valid, semantic HTML
use a simple CSS framework (like blueprint). You will rely on a simple grid system for positioning and layout.
add CSS classes to your HTML
add your custom CSS for colors, backgrounds...
Please reconsider using a table layout 'to get it done'; you will be disappointed, especially if you want to add some JS magic later.
I use CSS layouts for my web apps. But, my apps don't have wildly varying information, so I can set the content area and not have to worry about the layout looking "off" because a column is way out of balance with the rest of the content.
If you're having trouble with CSS layout and positioning, I'd suggest tables first, learn more about CSS/HTML positioning, and then convert your layout LATER. I'm sure that it's made for a frustrating experience learning CSS on a "real" project.
In the meantime, get some really good sources for CSS: books by Andy Budd, Simon Collison, Eric Meyer, et. al. Also, go to their blogs and dig into the archives. A really good book for CSS layout, positioning and general use is Beginning CSS Web Development by Simon Collison from APress. All the ins and outs with great working examples.

Resources