The New libhandy 0.0.10, Next TGP
The New libhandy 0.0.10, Next TGP

Newest posts by Adrien Plazas (see all)

Libhandy ..10 just bought unveiled, and you can get this new variation listed here. It arrives with a number of new adaptive widgets for your GTK app we’d like to notify you about:

The See Switcher

GNOME programs normally use a GtkStackSwitcher to swap concerning their sights. This design and style works good on a desktop, but not so well on seriously narrow units like cell telephones, so Tobias Bernard developed a far more modern-day and adaptive alternative – now readily available in libhandy as the HdyViewSwitcher:The New libhandy 0.0.10, Next TGP

In quite a few approaches, the HdyViewSwitcher functions very likewise to a GtkStackSwitcher: you assign it a GtkStack that contains your application’s web pages, and it will display screen a row of aspect-by-facet, homogeneously-sized buttons, each 1 representing a website page. It differs in that it can screen both of those the title and the icon of your internet pages, and that the structure of the buttons routinely adapts to a narrower version, dependent on the obtainable width. We have also added a see switcher bar, created to be utilised at the base of the window: HdyViewSwitcherBar (and we’d like to thank Zander Brown for the prototypes!).

The Squeezer

To finish the check out switcher style and design, we necessary a way to immediately change amongst having a see switcher in the header bar, and a view switcher bar at the bottom of the window.

We added HdySqueezer give it widgets, and it shows the 1st one that matches in the available space. A typical way to use it would be:


In the example above, if there is ample space the view switcher will be noticeable in the header bar if not, a widget mimicking the window’s title will be exhibited. In addition, you can reveal or conceal a HdyViewSwitcherBar at the base of your window, depending on which widget is presented by the squeezer, and show a solitary view switcher at a time.

A different Header Bar?

To make the see switcher function as meant, we will need to make certain it is normally strictly centered we also have to have to make positive the watch switcher fills all the peak of the header bar. Both equally of these are regretably not doable with GtkHeaderBar in GTK 3, so I forked it as HdyHeaderBar to, to start with, make guaranteed it does not drive its title widget to be vertically centered, and hence to permit it to fill all the accessible top and 2nd, to allow for deciding on among strictly or loosely centering its title widget (similarly to GtkHeaderBar).

The Preferences Window

To simplify crafting modern-day, adaptive and featureful purposes, I wrote a generic tastes window you can use to apply your application’s preferences window: HdyPreferencesWindow – and arranged it this way:

• the window is made up of web pages carried out via HdyPreferencesPage

• internet pages have a title, and comprise preferences teams applied via HdyPreferencesGroup

• teams can have a title, a description, and tastes applied by way of rows (HdyPreferencesRow) or any other widget

• preferences carried out via HdyPreferencesRow have a identify, and can be searched via their page title, group title or title

• HdyActionRow is a spinoff of HdyPreferencesRow, so you can use it (and its derivatives) to effortlessly apply your choices.

The following predicted version of libhandy is libhandy 1.. It will come with quite a few API fixes, which is why a main edition quantity bump is required. libhandy’s API has been stable for a lot of variations now, and we will warranty that exact security starting off from variation 1..

Adrien Plazas