This commit is contained in:
Wayne Chen 2018-06-19 16:27:58 -07:00
commit 3dbd181a9f
4 changed files with 22 additions and 16 deletions

View file

@ -62,8 +62,6 @@ Original.Button {
hifi.buttons.pressedColor[control.color] hifi.buttons.pressedColor[control.color]
} else if (control.hovered) { } else if (control.hovered) {
hifi.buttons.hoveredColor[control.color] hifi.buttons.hoveredColor[control.color]
} else if (!control.hovered && control.focus) {
hifi.buttons.focusedColor[control.color]
} else { } else {
hifi.buttons.colorStart[control.color] hifi.buttons.colorStart[control.color]
} }
@ -78,8 +76,6 @@ Original.Button {
hifi.buttons.pressedColor[control.color] hifi.buttons.pressedColor[control.color]
} else if (control.hovered) { } else if (control.hovered) {
hifi.buttons.hoveredColor[control.color] hifi.buttons.hoveredColor[control.color]
} else if (!control.hovered && control.focus) {
hifi.buttons.focusedColor[control.color]
} else { } else {
hifi.buttons.colorFinish[control.color] hifi.buttons.colorFinish[control.color]
} }

View file

@ -11,7 +11,6 @@ Item {
height: parent !== null ? parent.height : undefined height: parent !== null ? parent.height : undefined
property var parentStackItem: null property var parentStackItem: null
property int headerHeight: 70 property int headerHeight: 70
property string url
property string scriptURL property string scriptURL
property bool keyboardEnabled: false property bool keyboardEnabled: false
property bool keyboardRaised: false property bool keyboardRaised: false
@ -23,6 +22,7 @@ Item {
property bool punctuationMode: false property bool punctuationMode: false
property bool passwordField: false property bool passwordField: false
property bool isDesktop: false property bool isDesktop: false
property alias url: web.url
property alias webView: web.webViewCore property alias webView: web.webViewCore
property alias profile: web.webViewCoreProfile property alias profile: web.webViewCoreProfile
property bool remove: false property bool remove: false
@ -81,7 +81,7 @@ Item {
color: hifi.colors.baseGray color: hifi.colors.baseGray
font.pixelSize: 12 font.pixelSize: 12
verticalAlignment: Text.AlignLeft verticalAlignment: Text.AlignLeft
text: root.url text: web.url
anchors { anchors {
top: nav.bottom top: nav.bottom
horizontalCenter: parent.horizontalCenter; horizontalCenter: parent.horizontalCenter;
@ -131,11 +131,11 @@ Item {
function loadUrl(url) { function loadUrl(url) {
web.webViewCore.url = url web.webViewCore.url = url
root.url = web.webViewCore.url;
} }
onUrlChanged: { Rectangle {
loadUrl(url); anchors.fill: web;
color: hifi.colors.white;
} }
FlickableWebViewCore { FlickableWebViewCore {

View file

@ -253,8 +253,12 @@ Item {
anchors.left: parent.left; anchors.left: parent.left;
anchors.right: parent.right; anchors.right: parent.right;
Item { // On empty history. We don't want to flash and then replace, so don't show until we know we're zero. Item {
visible: transactionHistoryModel.count === 0 && transactionHistoryModel.currentPageToRetrieve < 0; // On empty history. We don't want to flash and then replace, so don't show until we know we should.
// The history is empty when it contains 1 item (the pending item count) AND there are no pending items.
visible: transactionHistoryModel.count === 1 &&
transactionHistoryModel.retrievedAtLeastOnePage &&
transactionHistoryModel.get(0).count === 0;
anchors.centerIn: parent; anchors.centerIn: parent;
width: parent.width - 12; width: parent.width - 12;
height: parent.height; height: parent.height;

View file

@ -365,15 +365,23 @@ QFile* Snapshot::savedFileForSnapshot(QImage& shot,
// DON'T append ".jpg" to the filename. QT will save the image in the format associated with the // DON'T append ".jpg" to the filename. QT will save the image in the format associated with the
// filename's suffix. // filename's suffix.
// If you want lossless Snapshots, supply a `.png` filename. Otherwise, use `.jpeg` or `.jpg`. // If you want lossless Snapshots, supply a `.png` filename. Otherwise, use `.jpeg` or `.jpg`.
// For PNGs, we use a "quality" of "50". The output image quality is the same as "100"
// is the same as "0" -- the difference lies in the amount of compression applied to the PNG,
// which slightly affects the time it takes to save the image.
// Otherwise, ".jpg" is appended to the user's requested filename so that the image is saved in JPG format. // Otherwise, ".jpg" is appended to the user's requested filename so that the image is saved in JPG format.
// If the user hasn't supplied a specific filename for the snapshot: // If the user hasn't supplied a specific filename for the snapshot:
// Save the snapshot in JPG format according to FILENAME_PATH_FORMAT // Save the snapshot in JPG format at "100" quality according to FILENAME_PATH_FORMAT
int imageQuality = 100;
QString filename; QString filename;
if (!userSelectedFilename.isNull()) { if (!userSelectedFilename.isNull()) {
QFileInfo snapshotFileInfo(userSelectedFilename); QFileInfo snapshotFileInfo(userSelectedFilename);
QString userSelectedFilenameSuffix = snapshotFileInfo.suffix(); QString userSelectedFilenameSuffix = snapshotFileInfo.suffix();
userSelectedFilenameSuffix = userSelectedFilenameSuffix.toLower();
if (SUPPORTED_IMAGE_FORMATS.contains(userSelectedFilenameSuffix)) { if (SUPPORTED_IMAGE_FORMATS.contains(userSelectedFilenameSuffix)) {
filename = userSelectedFilename; filename = userSelectedFilename;
if (userSelectedFilenameSuffix == "png") {
imageQuality = 50;
}
} else { } else {
filename = userSelectedFilename + ".jpg"; filename = userSelectedFilename + ".jpg";
} }
@ -381,8 +389,6 @@ QFile* Snapshot::savedFileForSnapshot(QImage& shot,
filename = FILENAME_PATH_FORMAT.arg(username, now.toString(DATETIME_FORMAT)); filename = FILENAME_PATH_FORMAT.arg(username, now.toString(DATETIME_FORMAT));
} }
const int IMAGE_QUALITY = 100;
if (!isTemporary) { if (!isTemporary) {
// If user has requested specific path then use it, else use the application value // If user has requested specific path then use it, else use the application value
QString snapshotFullPath; QString snapshotFullPath;
@ -432,7 +438,7 @@ QFile* Snapshot::savedFileForSnapshot(QImage& shot,
imageFile = new QFile(snapshotFullPath); imageFile = new QFile(snapshotFullPath);
} }
shot.save(imageFile, 0, IMAGE_QUALITY); shot.save(imageFile, 0, imageQuality);
imageFile->close(); imageFile->close();
return imageFile; return imageFile;
@ -447,7 +453,7 @@ QFile* Snapshot::savedFileForSnapshot(QImage& shot,
} }
imageTempFile->setAutoRemove(isTemporary); imageTempFile->setAutoRemove(isTemporary);
shot.save(imageTempFile, 0, IMAGE_QUALITY); shot.save(imageTempFile, 0, imageQuality);
imageTempFile->close(); imageTempFile->close();
return imageTempFile; return imageTempFile;