changed app cover to reflect a single unread for the active tab, added

title bar, and started settings page
This commit is contained in:
Morgan McMillian 2016-10-22 07:11:28 -07:00
parent 10fe97ef90
commit 3f28d7eb89
8 changed files with 132 additions and 24 deletions

View file

@ -8,23 +8,27 @@ Container {
orientation: LayoutOrientation.LeftToRight
}
Label {
text: "Unread global:"
text: "Unread:"
textStyle.color: Color.Black
}
Label {
objectName: "global_label"
text: "0"
textStyle.color: Color.Black
}
}
Container {
layout: StackLayout {
orientation: LayoutOrientation.LeftToRight
}
Label {
text: "Unread home:"
}
Label {
objectName: "home_label"
text: "0"
}
}
// Container {
// layout: StackLayout {
// orientation: LayoutOrientation.LeftToRight
// }
// Label {
// text: "Unread home:"
// textStyle.color: Color.Black
// }
// Label {
// objectName: "home_label"
// text: "0"
// textStyle.color: Color.Black
// }
// }
}

96
assets/SettingsPage.qml Normal file
View file

@ -0,0 +1,96 @@
import bb.cascades 1.4
Page {
id: settingsPage
signal modifySetting(string setting, variant value)
titleBar: TitleBar {
title: qsTr("Settings")
}
ScrollView {
Container {
layout: StackLayout {}
Container {
topPadding: 15.0
}
Container {
layout: DockLayout {}
horizontalAlignment: HorizontalAlignment.Fill
verticalAlignment: VerticalAlignment.Fill
Container {
verticalAlignment: VerticalAlignment.Center
leftPadding: ui.sdu(3)
Label {
text: "This is my toggle"
}
}
Container {
rightPadding: ui.sdu(3)
horizontalAlignment: HorizontalAlignment.Right
ToggleButton {
checked: true
onCheckedChanged: {
if (checked) {
modifySetting("datenew", true)
} else {
modifySetting("datenew", false)
}
}
}
}
}
Divider {}
Container {
layout: DockLayout {}
horizontalAlignment: HorizontalAlignment.Fill
Container {
leftPadding: ui.sdu(3)
rightPadding: ui.sdu(3)
DropDown {
title: "Dropdown"
preferredWidth: 1440.0
onSelectedIndexChanged: {
modifySetting("sort", selectedValue)
}
Option {
text: "Option Zero"
value: 0
selected: sort == 0
}
Option {
text: "Option Three"
value: 3
selected: sort == 3
}
Option {
text: "Option One"
value: 1
selected: sort == 1
}
Option {
text: "Option Two"
value: 2
selected: sort == 2
}
}
}
}
Divider {}
Container {
layout: DockLayout {}
horizontalAlignment: HorizontalAlignment.Fill
leftPadding: 30.0
rightPadding: 30.0
Button {
preferredWidth: 1440.0
text: "Button"
onClicked: {
console.log("button")
}
}
}
Divider {}
}
}
}

View file

@ -24,6 +24,7 @@ import com.monkeystew.qtimer 1.0
NavigationPane {
id: nav
property alias title: titleBar.title
property string stream_type
property string endpoint
property int unread: -1
@ -34,6 +35,9 @@ NavigationPane {
signal closeLogin()
Page {
titleBar: TitleBar {
id: titleBar
}
Container {
ListView {
id: streamView

View file

@ -46,6 +46,7 @@ TabbedPane {
title: qsTr("Home")
delegate: Delegate {
StreamTab {
title: qsTr("Home")
stream_type: "Home"
onOpenLogin: {
loginSheet.open()
@ -57,7 +58,7 @@ TabbedPane {
}
imageSource: "asset:///icons/home.png"
onUnreadContentCountChanged: {
_activeFrame.setHomeUnread(unreadContentCount)
_activeFrame.setGlobalUnread(unreadContentCount)
}
}
@ -66,7 +67,7 @@ TabbedPane {
title: qsTr("Global")
delegate: Delegate {
StreamTab {
id: globalTab
title: qsTr("Global")
stream_type: "Global"
onOpenLogin: {
loginSheet.open()

View file

@ -1 +1 @@
179
181

View file

@ -72,6 +72,7 @@ config_pri_assets {
$$quote($$BASEDIR/assets/PostItem.qml) \
$$quote($$BASEDIR/assets/ProfilePage.qml) \
$$quote($$BASEDIR/assets/RefreshItem.qml) \
$$quote($$BASEDIR/assets/SettingsPage.qml) \
$$quote($$BASEDIR/assets/StreamTab.qml) \
$$quote($$BASEDIR/assets/ThreadPage.qml) \
$$quote($$BASEDIR/assets/icons/bell-slash.png) \

View file

@ -21,8 +21,8 @@ ActiveFrameQML::ActiveFrameQML(QObject *parent) : SceneCover(parent)
global_unread_label = mainContainer->findChild<Label*>("global_label");
global_unread_label->setParent(mainContainer);
home_unread_label = mainContainer->findChild<Label*>("home_label");
home_unread_label->setParent(mainContainer);
// home_unread_label = mainContainer->findChild<Label*>("home_label");
// home_unread_label->setParent(mainContainer);
}
ActiveFrameQML::~ActiveFrameQML()
@ -37,5 +37,5 @@ void ActiveFrameQML::setGlobalUnread(QString count)
void ActiveFrameQML::setHomeUnread(QString count)
{
home_unread_label->setText(count);
global_unread_label->setText(count);
}

View file

@ -129,22 +129,22 @@
<context>
<name>StreamTab</name>
<message>
<location filename="../assets/StreamTab.qml" line="117"/>
<location filename="../assets/StreamTab.qml" line="121"/>
<source>New Post</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../assets/StreamTab.qml" line="131"/>
<location filename="../assets/StreamTab.qml" line="135"/>
<source>To Top</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../assets/StreamTab.qml" line="157"/>
<location filename="../assets/StreamTab.qml" line="161"/>
<source>To Bottom</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../assets/StreamTab.qml" line="146"/>
<location filename="../assets/StreamTab.qml" line="150"/>
<source>Reload</source>
<translation type="unfinished"></translation>
</message>
@ -158,11 +158,13 @@
</message>
<message>
<location filename="../assets/main.qml" line="46"/>
<location filename="../assets/main.qml" line="49"/>
<source>Home</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../assets/main.qml" line="66"/>
<location filename="../assets/main.qml" line="67"/>
<location filename="../assets/main.qml" line="70"/>
<source>Global</source>
<translation type="unfinished"></translation>
</message>