I'm looking for some help to use PageHeadStyle components which is available in Ubuntu SDK. If somebody has example, I will be grateful.
Thanks.
|
I'm looking for some help to use PageHeadStyle components which is available in Ubuntu SDK. If somebody has example, I will be grateful. Thanks. |
||||
|
|
|
The Ubuntu SDK offers style components in Ubuntu.Components 1.2 version to allow app developers to customize components to their liking. PageHeadStyle is one such component that can be used to customize the page header throughout the app. Before using this style component, one needs to first define a custom application theme which would include these custom style components and instruct the application to use this. Creating a application theme can be done by either deriving it from an existing system theme provided in Ubuntu Touch like Ambiance or SuruDark, or creating a theme from scratch. The latter is definitely the recommended way of creating a new theme since there are many style API that are still unstable and could change in the future. Let's define our application in a new folder called MyTheme. The second step would be to create a file called parent_theme where you put the URI of the theme your application theme derives from. Your parent_theme would look like,
Let's also define our theme's palette colors by creating a file called Palette.qml,
Now let's use the PageHeadStyle to customize our page header by creating a file called PageHeadStyle.qml which has the following structure,
Your MyTheme folder structure should look like,
And then in your main qml file where MainView is defined, you can load your application theme by,
And then your application should look like,
Voila, here's your themed app! You can find more details about ubuntu touch app development at developer.ubuntu.com where SDK developers blog about this. This application theming guide was created by Zsombor Egri (SDK Dev) here. You can find the entire sample code here. |
|||
|
|