Merge pull request #8208 from SamGondelman/qmlFixes

Fixed issues in Browser.qml and UpdateDialog.qml
This commit is contained in:
Brad Davis 2016-07-07 19:51:37 -07:00 committed by GitHub
commit 829a871d6f
4 changed files with 21 additions and 42 deletions

View file

@ -3,12 +3,14 @@ import QtQuick.Controls 1.2
import QtWebEngine 1.1
import "controls-uit"
import "styles" as HifiStyles
import "styles-uit"
import "windows"
ScrollingWindow {
id: root
HifiConstants { id: hifi }
HifiStyles.HifiConstants { id: hifistyles }
title: "Browser"
resizable: true
destroyOnHidden: true
@ -46,7 +48,7 @@ ScrollingWindow {
id: back;
enabled: webview.canGoBack;
text: hifi.glyphs.backward
color: enabled ? hifi.colors.text : hifi.colors.disabledText
color: enabled ? hifistyles.colors.text : hifistyles.colors.disabledText
size: 48
MouseArea { anchors.fill: parent; onClicked: webview.goBack() }
}
@ -55,7 +57,7 @@ ScrollingWindow {
id: forward;
enabled: webview.canGoForward;
text: hifi.glyphs.forward
color: enabled ? hifi.colors.text : hifi.colors.disabledText
color: enabled ? hifistyles.colors.text : hifistyles.colors.disabledText
size: 48
MouseArea { anchors.fill: parent; onClicked: webview.goForward() }
}
@ -64,7 +66,7 @@ ScrollingWindow {
id: reload;
enabled: webview.canGoForward;
text: webview.loading ? hifi.glyphs.close : hifi.glyphs.reload
color: enabled ? hifi.colors.text : hifi.colors.disabledText
color: enabled ? hifistyles.colors.text : hifistyles.colors.disabledText
size: 48
MouseArea { anchors.fill: parent; onClicked: webview.goForward() }
}
@ -105,7 +107,7 @@ ScrollingWindow {
focus: true
colorScheme: hifi.colorSchemes.dark
placeholderText: "Enter URL"
Component.onCompleted: scriptsModel.filterRegExp = new RegExp("^.*$", "i")
Component.onCompleted: ScriptDiscoveryService.scriptsModelFilter.filterRegExp = new RegExp("^.*$", "i")
Keys.onPressed: {
switch(event.key) {
case Qt.Key_Enter:

View file

@ -3,13 +3,16 @@ import QtQuick 2.3
import QtQuick.Controls 1.3
import QtQuick.Controls.Styles 1.3
import QtGraphicalEffects 1.0
import "controls-uit"
import "styles" as HifiStyles
import "styles-uit"
import "windows"
ScrollingWindow {
id: root
HifiConstants { id: hifi }
HifiStyles.HifiConstants { id: hifistyles }
objectName: "UpdateDialog"
width: updateDialog.implicitWidth
height: updateDialog.implicitHeight
@ -40,22 +43,6 @@ ScrollingWindow {
width: updateDialog.contentWidth + updateDialog.borderWidth * 2
height: mainContent.height + updateDialog.borderWidth * 2 - updateDialog.closeMargin / 2
MouseArea {
width: parent.width
height: parent.height
anchors {
horizontalCenter: parent.horizontalCenter
verticalCenter: parent.verticalCenter
}
drag {
target: root
minimumX: 0
minimumY: 0
maximumX: root.parent ? root.maximumX : 0
maximumY: root.parent ? root.maximumY : 0
}
}
}
Image {
@ -89,7 +76,7 @@ ScrollingWindow {
text: "Update Available"
font {
family: updateDialog.fontFamily
pixelSize: hifi.fonts.pixelSize * 1.5
pixelSize: hifistyles.fonts.pixelSize * 1.5
weight: Font.DemiBold
}
color: "#303030"
@ -100,10 +87,10 @@ ScrollingWindow {
text: updateDialog.updateAvailableDetails
font {
family: updateDialog.fontFamily
pixelSize: hifi.fonts.pixelSize * 0.6
pixelSize: hifistyles.fonts.pixelSize * 0.6
letterSpacing: -0.5
}
color: hifi.colors.text
color: hifistyles.colors.text
anchors {
top: updateAvailable.bottom
}
@ -130,12 +117,12 @@ ScrollingWindow {
Text {
id: releaseNotes
wrapMode: Text.Wrap
width: parent.width - updateDialog.closeMargin
width: parent.parent.width - updateDialog.closeMargin
text: updateDialog.releaseNotes
color: hifi.colors.text
color: hifistyles.colors.text
font {
family: updateDialog.fontFamily
pixelSize: hifi.fonts.pixelSize * 0.65
pixelSize: hifistyles.fonts.pixelSize * 0.65
}
}
}
@ -157,7 +144,7 @@ ScrollingWindow {
color: "#0c9ab4" // Same as logo
font {
family: updateDialog.fontFamily
pixelSize: hifi.fonts.pixelSize * 1.2
pixelSize: hifistyles.fonts.pixelSize * 1.2
weight: Font.DemiBold
}
anchors {
@ -169,7 +156,7 @@ ScrollingWindow {
MouseArea {
id: cancelButtonAction
anchors.fill: parent
onClicked: updateDialog.closeDialog()
onClicked: root.shown = false
cursorShape: "PointingHandCursor"
}
}
@ -185,7 +172,7 @@ ScrollingWindow {
color: "#0c9ab4" // Same as logo
font {
family: updateDialog.fontFamily
pixelSize: hifi.fonts.pixelSize * 1.2
pixelSize: hifistyles.fonts.pixelSize * 1.2
weight: Font.DemiBold
}
anchors {

View file

@ -48,14 +48,6 @@ const QString& UpdateDialog::releaseNotes() const {
return _releaseNotes;
}
void UpdateDialog::closeDialog() {
hide();
}
void UpdateDialog::hide() {
((QQuickItem*)parent())->setVisible(false);
}
void UpdateDialog::triggerUpgrade() {
auto applicationUpdater = DependencyManager::get<AutoUpdater>();
applicationUpdater.data()->performAutoUpdate(applicationUpdater.data()->getBuildData().lastKey());

View file

@ -21,22 +21,20 @@ class UpdateDialog : public OffscreenQmlDialog {
Q_OBJECT
HIFI_QML_DECL
Q_PROPERTY(QString updateAvailableDetails READ updateAvailableDetails)
Q_PROPERTY(QString releaseNotes READ releaseNotes)
Q_PROPERTY(QString updateAvailableDetails READ updateAvailableDetails CONSTANT)
Q_PROPERTY(QString releaseNotes READ releaseNotes CONSTANT)
public:
UpdateDialog(QQuickItem* parent = nullptr);
const QString& updateAvailableDetails() const;
const QString& releaseNotes() const;
private:
QString _updateAvailableDetails;
QString _releaseNotes;
protected:
void hide();
Q_INVOKABLE void triggerUpgrade();
Q_INVOKABLE void closeDialog();
};