Skip to content

Instantly share code, notes, and snippets.

@elpuri
Created January 26, 2011 01:18
Show Gist options
  • Save elpuri/796040 to your computer and use it in GitHub Desktop.
Save elpuri/796040 to your computer and use it in GitHub Desktop.
KittyApp v2
import Qt 4.7
Rectangle {
....
Row {
anchors.fill: parent
NavigationButton {
id: kittyButton
active: viewSwitcher.currentView == kittyView
....
}
NavigationButton {
id: friendsButton
active: viewSwitcher.currentView == friendsView
....
}
NavigationButton {
id: shopButton
active: viewSwitcher.currentView == shopView
....
}
}
}
import Qt 4.7
Item {
property bool active
property url activeIcon
property url inactiveIcon
....
Image {
id: icon
source: active ? activeIcon : inactiveIcon
....
}
Text {
id: label
....
color: active ? "#ffddee" : "#a52246"
style: Text.Raised
styleColor: active ? "#30000000" : "#20ffffff"
}
....
}
Text {
id: titleText
anchors.centerIn: parent
anchors.verticalCenterOffset: 3
font.family: "Lato Black"
font.pixelSize: 32
color: "#ffddee"
styleColor: "#2f000000"
style: Text.Sunken
text: viewSwitcher.currentView.viewTitle // <----
}
Loader {
property bool keepLoaded : true
property url viewSource
property string viewTitle : item.viewTitle
Loader {
property bool keepLoaded : true
property url viewSource
property string viewTitle : item == null ? "" : item.viewTitle <---------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment