From 3f28d7eb894984bd382f2f06d1b8614b77b2c4c7 Mon Sep 17 00:00:00 2001 From: Morgan McMillian Date: Sat, 22 Oct 2016 07:11:28 -0700 Subject: [PATCH] changed app cover to reflect a single unread for the active tab, added title bar, and started settings page --- assets/AppCover.qml | 30 +++++++------ assets/SettingsPage.qml | 96 +++++++++++++++++++++++++++++++++++++++++ assets/StreamTab.qml | 4 ++ assets/main.qml | 5 ++- buildnum | 2 +- config.pri | 1 + src/ActiveFrameQML.cpp | 6 +-- translations/Goober.ts | 12 +++--- 8 files changed, 132 insertions(+), 24 deletions(-) create mode 100644 assets/SettingsPage.qml diff --git a/assets/AppCover.qml b/assets/AppCover.qml index ba0ea5a..8c3fb5c 100644 --- a/assets/AppCover.qml +++ b/assets/AppCover.qml @@ -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 +// } +// } } diff --git a/assets/SettingsPage.qml b/assets/SettingsPage.qml new file mode 100644 index 0000000..2449976 --- /dev/null +++ b/assets/SettingsPage.qml @@ -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 {} + } + } +} diff --git a/assets/StreamTab.qml b/assets/StreamTab.qml index ce6c434..b3f81e3 100644 --- a/assets/StreamTab.qml +++ b/assets/StreamTab.qml @@ -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 diff --git a/assets/main.qml b/assets/main.qml index f3ff552..ddb893f 100644 --- a/assets/main.qml +++ b/assets/main.qml @@ -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() diff --git a/buildnum b/buildnum index cde50ca..a5b5e0f 100644 --- a/buildnum +++ b/buildnum @@ -1 +1 @@ -179 \ No newline at end of file +181 \ No newline at end of file diff --git a/config.pri b/config.pri index f9dd25a..6b5b4df 100644 --- a/config.pri +++ b/config.pri @@ -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) \ diff --git a/src/ActiveFrameQML.cpp b/src/ActiveFrameQML.cpp index badd99b..60d02e1 100644 --- a/src/ActiveFrameQML.cpp +++ b/src/ActiveFrameQML.cpp @@ -21,8 +21,8 @@ ActiveFrameQML::ActiveFrameQML(QObject *parent) : SceneCover(parent) global_unread_label = mainContainer->findChild("global_label"); global_unread_label->setParent(mainContainer); - home_unread_label = mainContainer->findChild("home_label"); - home_unread_label->setParent(mainContainer); +// home_unread_label = mainContainer->findChild("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); } diff --git a/translations/Goober.ts b/translations/Goober.ts index 45fdd2c..0aa1ecb 100644 --- a/translations/Goober.ts +++ b/translations/Goober.ts @@ -129,22 +129,22 @@ StreamTab - + New Post - + To Top - + To Bottom - + Reload @@ -158,11 +158,13 @@ + Home - + + Global