Style

The styling of an andlabs-UI-based application is platform-specific and is normally set by the operating system. Some support user-based customization, which can subtly or vastly affect the look and feel of your application—so it's important to consider the possible variations during your application design and testing.

When run on Microsoft Windows, the toolkit in use is Common Controls (discussed in the Chapter 4Walk - Building Graphical Windows Applications). Essentially, the controls will look somewhat different across versions of Windows, which helps the applications blend in with the evolving desktop's look and feel. Most user-customization options within Windows are focused on the newer ("Universal") applications, but may show some color changes within applications built using Common Controls (and therefore with andlabs UI). Be sure to consider which versions of Windows you intend to support when testing your application layout and design.

Apple also evolves their macOS widget toolkit look and feel over time, though most recent versions (since OS X 10.5—released in 2007) remain largely consistent in the layout and sizing of components. Applications running on andlabs UI in the macOS environment should remain fairly consistent across all supported versions—unless users enable the new dark mode in macOS Mojave (released in late 2018). Following this new user-configuration option, the user interface may be presented in a light (default) or dark mode to match the user's preference. Application designers should consider this and ensure their content presents well in both configurations.

The widgets used within andlabs UI adapt correctly to this new style, but custom content may not. There is currently no API to detect which color mode is being used and so the easiest approach is to either limit your interface to standard controls or to pick a color scheme that will look suitable in either mode:

Side- by-side comparison of macOS light and dark modes (copyright IDG UK via MacWorld)

In Linux, andlabs UI toolkit is built upon the GTK+ widget set, which is designed to allow theming and style adjustments. While these types of themes can't substantially change the layout of components, they can significantly impact the sizing, padding, and colouring that a theme provides, and so affect the flow and sizing of an application's user interface. This can present a challenge for software developers who want to support the inherent flexibility in their programs. There are over a thousand GTK+ themes, and many can be found on the Gnome Look website: https://www.gnome-look.org/browse/cat/135/ord/top/. GTK+ Theming is explored further in Chapter 6, Go-GTK - Multiple Platforms with GTK. where we take a deeper look at the GTK+ toolkit.

 These two screenshots compare a popular light and dark theme—clearly they can change more than simply the color scheme:

GTK+ SuperFlat and Vertex themes compared

Each of these platform themes and configuration options can have an impact on the look and feel of the resulting application. If you're planning to support these visual styles, the best strategy is to avoid custom controls, and draw features and let the native controls adapt appropriately. If your application requires custom content or rendering, it will be important to choose a color palette that works well across many different themes or styles.