Skip to content

Instantly share code, notes, and snippets.

@andrewsomething
Created March 1, 2014 18:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrewsomething/9294239 to your computer and use it in GitHub Desktop.
Save andrewsomething/9294239 to your computer and use it in GitHub Desktop.
An example of the problem coloring a header...
import QtQuick 2.0
import Ubuntu.Components 0.1
import Ubuntu.Components.ListItems 0.1 as ListItem
MainView {
id: mainView
width: units.gu(40)
height: units.gu(60)
Rectangle {
id: headerBackground
height: header.height
width: header.width
anchors.fill: header
color: "#288369"
}
Tabs {
id: tabs
Tab {
title: i18n.tr("Pretty Hack")
page: Page {
Label {
anchors.centerIn: parent
text: "Sure looks nice here,\nbut check out the other tab."
}
}
}
Tab {
title: i18n.tr("Ugly Hack")
page: Page {
ListView {
id: list
spacing: units.gu(1)
anchors.fill: parent
model: model
delegate: ListItem.Standard {
text: model.info
}
}
ListModel {
id: model
ListElement {
info: "First item"
}
ListElement {
info: "Second item"
}
ListElement {
info: "Third item"
}
ListElement {
info: "Fourth item"
}
ListElement {
info: "Fifth item"
}
ListElement {
info: "Sixth item"
}
ListElement {
info: "Seventh item"
}
ListElement {
info: "Eight item"
}
ListElement {
info: "Nineth item"
}
}
}
}
Component.onCompleted: {
tabBar.__styleInstance.headerTextSelectedColor = "white";
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment