Skip to content

Commit

Permalink
Merge pull request #24 from walokra/ichthyosaurus-ui-patch
Browse files Browse the repository at this point in the history
Various small fixes, changes, and improvements
  • Loading branch information
walokra authored Dec 18, 2020
2 parents 251a9cd + 289d196 commit 45b2344
Show file tree
Hide file tree
Showing 23 changed files with 434 additions and 547 deletions.
1 change: 1 addition & 0 deletions harbour-sailimgur.pro
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ OTHER_FILES = \
qml/pages/GalleryNavigation.qml \
qml/pages/GalleryContentPage.qml \
qml/pages/GalleryContentDelegate.qml \
qml/pages/GalleryLoadingNavigation.qml \
qml/pages/GalleryMode.qml \
qml/pages/CommentsModel.qml \
qml/pages/GalleryModel.qml \
Expand Down
15 changes: 1 addition & 14 deletions qml/components/imgur.js
Original file line number Diff line number Diff line change
Expand Up @@ -458,21 +458,8 @@ function fillAlbumImagesModel(output, model) {
var link_original;

if (output.link) {
//console.debug("link=" + output.link);
link = IMGUR_IMG_URL;
link_original = output.link;
if (parseInt(output.width) > 640) {
// if image isn't gif then get the smaller one
var ext = getExt(output.link);
if (ext === "gif" || ext === "GIF") {
link = output.link;
} else {
link += output.id+"l."+ext; // l=640x640 aspec
}
} else {
link = output.link;
}

link = output.link;
}

var imageData = {
Expand Down
9 changes: 5 additions & 4 deletions qml/pages/AccountPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Page {
property string url : "anonymous";
property string bio : "";
property string created : "";
property int reputation : 0;
property string reputation : "";
//property var pro_expiration : false;

onLoad: {
Expand Down Expand Up @@ -72,7 +72,8 @@ Page {
spacing: Theme.paddingMedium;

Label {
text: reputation + qsTr(" reputation");
// text: reputation + qsTr(" reputation");
text: reputation;
color: constant.colorHighlight;
font.pixelSize: Screen.sizeCategory >= Screen.Large
? constant.fontSizeSmall : constant.fontSizeXSmall
Expand Down Expand Up @@ -290,9 +291,9 @@ Page {
//var pro_expr = (pro_expiration === false) ? pro_expiration : Utils.formatEpochDatetime(output.pro_expiration);
account_id = output.id;
url = output.url;
bio = output.bio;
bio = (output.bio) ? output.bio : "";
created = date;
reputation = output.reputation;
reputation = output.reputation_name;
//pro_expiration = pro_expr;
}
}
Expand Down
39 changes: 4 additions & 35 deletions qml/pages/AlbumInfoColumn.qml
Original file line number Diff line number Diff line change
Expand Up @@ -119,19 +119,10 @@ Item {
id: actionButtons;
anchors.horizontalCenter: parent.horizontalCenter;
width: childrenRect.width;
height: constant.iconSizelarge
spacing: Theme.paddingLarge * 2;
height: constant.iconSizeMedium

// IconButton {
// id: dislikeButton;
// enabled: loggedIn;
// icon.width: constant.iconSizeSmall;
// icon.height: icon.width;
// icon.source: constant.iconDislike + "?" + ((galleryContentModel.vote === "down") ? "red" : constant.iconDefaultColor)
// onClicked: {
// internal.galleryVote("down");
// }
// }
visible: loggedIn

Rectangle {
id: dislikeRect;
Expand All @@ -155,20 +146,9 @@ Item {
}
}

// IconButton {
// id: likeButton;
// enabled: loggedIn;
// icon.width: constant.iconSizeMedium;
// icon.height: icon.width;
// icon.source: constant.iconLike + "?" + ((galleryContentModel.vote === "up") ? "green" : constant.iconDefaultColor)
// onClicked: {
// internal.galleryVote("up");
// }
// }

Rectangle {
id: likeRect;
width: constant.iconSizeLarge
width: constant.iconSizeMedium
height: width
anchors.verticalCenter: parent.verticalCenter

Expand All @@ -179,7 +159,7 @@ Item {
id: likeButton;
anchors.centerIn: parent;
enabled: loggedIn;
icon.width: constant.iconSizeLarge
icon.width: constant.iconSizeMedium
icon.height: icon.width
icon.source: constant.iconLike;
onClicked: {
Expand All @@ -188,17 +168,6 @@ Item {
}
}

// IconButton {
// id: favoriteButton;
// enabled: loggedIn;
// icon.width: constant.iconSizeSmall;
// icon.height: icon.width;
// icon.source: constant.iconFavorite + "?" + ((galleryContentModel.favorite) ? "green" : constant.iconDefaultColor)
// onClicked: {
// internal.galleryFavorite(is_album);
// }
// }

Rectangle {
id: favRect;
width: constant.iconSizeMedium
Expand Down
10 changes: 10 additions & 0 deletions qml/pages/ChangelogDialog.qml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@ Dialog {
anchors.margins: Theme.paddingSmall;
spacing: Theme.paddingSmall;

SectionHeader { text: qsTr("Version") + " 0.10.0 (2020-12-19)" }

Label {
width: parent.width;
wrapMode: Text.Wrap;
font.pixelSize: Screen.sizeCategory >= Screen.Large
? constant.fontSizeSmall : constant.fontSizeXSmall
text: qsTr("User interface updates from patch by ichthyosaurus.");
}

SectionHeader { text: qsTr("Version") + " 0.9.0 (2016-07-16)" }

Label {
Expand Down
28 changes: 15 additions & 13 deletions qml/pages/CommentDelegate.qml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,14 @@ Item {
MouseArea {
anchors.fill: parent;
onClicked: {
if (commentActionButtons.visible) {
commentActionButtons.visible = false;
if (loggedIn) {
if (commentActionButtons.visible) {
commentActionButtons.visible = false;
} else {
commentActionButtons.visible = true;
}
} else {
commentActionButtons.visible = true;
commentActionButtons.visible = false;
}
}
}
Expand All @@ -57,29 +61,28 @@ Item {
anchors { left: parent.left; right: parent.right; }
height: commentPoints.height

property var fontSize: constant.fontSizeIgnore

Label {
id: commentAuthor;
anchors { left: parent.left; }
wrapMode: Text.Wrap;
text: author;
font.pixelSize: Screen.sizeCategory >= Screen.Large
? constant.fontSizeXSmall : constant.fontSizeXXSmall;
font.pixelSize: parent.fontSize;
}

Label {
id: commentPoints;
anchors { left: commentAuthor.right; }
text: ", " + points + "p";
font.pixelSize: Screen.sizeCategory >= Screen.Large
? constant.fontSizeXSmall : constant.fontSizeXXSmall;
font.pixelSize: parent.fontSize;
}

Label {
id: commentDatetime;
anchors { left: commentPoints.right; leftMargin: constant.paddingSmall; right: parent.right; }
text: ", " + datetime;
font.pixelSize: Screen.sizeCategory >= Screen.Large
? constant.fontSizeXSmall : constant.fontSizeXXSmall;
font.pixelSize: parent.fontSize;
elide: Text.ElideRight;
}
}
Expand All @@ -89,16 +92,15 @@ Item {
anchors { left: parent.left; right: parent.right; }
wrapMode: Text.Wrap;
text: comment;
font.pixelSize: Screen.sizeCategory >= Screen.Large
? constant.fontSizeSmall : constant.fontSizeXSmall;
font.pixelSize: constant.fontSizeNormal;
height: commentText.paintedHeight;
textFormat: Text.StyledText;
linkColor: Theme.highlightColor;
onLinkActivated: {
contextLink = link;
contextMenu = commentContextMenu.createObject(commentListView);
contextMenu.show(commentDelegate);
contextMenu.anchors.left = depthRow.right
contextMenu.open(commentDelegate);
contextMenu.x = depthRow.x + depthRow.width;
}
}

Expand Down
10 changes: 9 additions & 1 deletion qml/pages/Constant.qml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ QtObject {
property int fontSizeXLarge : Theme.fontSizeExtraLarge;
property int fontSizeXXLarge : Theme.fontSizeHuge;

property var fontSizeHeader: Theme.fontSizeLarge;
property var fontSizeTitle: Theme.fontSizeLarge;
property var fontSizeNormal: Theme.fontSizeMedium;
property var fontSizeMeta: Theme.fontSizeSmall;
property var fontSizeIgnore: Theme.fontSizeExtraSmall;

// icons
property string iconDislike : "image://theme/icon-m-down";
property string iconLike : "image://theme/icon-m-up";
Expand All @@ -66,7 +72,9 @@ QtObject {
property string iconRight: "image://theme/icon-m-right";
property string iconLeft: "image://theme/icon-m-left";
property string iconPlay: "image://theme/icon-m-play";
property string iconSave: "image://theme/icon-m-download";
property string iconSave: "image://theme/icon-m-cloud-download";
property string iconSaveDone: "image://theme/icon-m-image";
property string iconSaving: "image://theme/icon-m-sync";
property string iconInfo: "image://theme/icon-m-about";
property string iconBrowser: "image://theme/icon-m-region";
property string iconClipboard: "image://theme/icon-m-clipboard";
Expand Down
27 changes: 14 additions & 13 deletions qml/pages/GalleryContentDelegate.qml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Item {

if (animated === false) {
imageLoader.active = true;
} else if (type === "image/gif" && (mp4 !== "") && settings.useVideoLoader === true) {
} else if ((type === "image/gif" || type === "video/mp4" || (mp4 !== "")) && settings.useVideoLoader === true) {
// If gifv video is under maxGifSize, use animatedImage (smoother)
if (size && size.indexOf("MiB") > -1) {
var sizeNo = size.replace(" MiB", "");
Expand Down Expand Up @@ -59,16 +59,15 @@ Item {
id: galleryContainer;
anchors.left: parent.left; anchors.right: parent.right;
height: childrenRect.height;
//height: drawer.height + imageDescText.height + indexLabel.height + Theme.paddingSmall;

Drawer {
id: drawer;

anchors.left: parent.left; anchors.right: parent.right;
dock: page.isPortrait ? Dock.Left : Dock.Bottom;
height: imageColumn.height;
backgroundSize: parent.width / 5;

// background: Item { }
background: Item {
id: drawerContextMenu;
anchors.left: parent.left; anchors.right: parent.right;
Expand All @@ -93,8 +92,7 @@ Item {
anchors.rightMargin: constant.paddingSmall;
wrapMode: Text.Wrap;
text: title;
font.pixelSize: Screen.sizeCategory >= Screen.Large
? constant.fontSizeSmall : constant.fontSizeXSmall;
font.pixelSize: constant.fontSizeNormal;
color: constant.colorHighlight;
anchors { left: parent.left; right: parent.right; }
visible: (title && is_album) ? true : false;
Expand All @@ -107,7 +105,7 @@ Item {
visible: active;
asynchronous: true;

width: Math.min(vWidth, parent.width);
width: Screen.width;
height: (active) ? vHeight : 0;

anchors.horizontalCenter: parent.horizontalCenter;
Expand All @@ -132,24 +130,27 @@ Item {
}
} // Drawer

// ImageButtons { }

Label {
id: imageDescText;
wrapMode: Text.Wrap;
text: description;
font.pixelSize: Screen.sizeCategory >= Screen.Large
? constant.fontSizeSmall : constant.fontSizeXSmall;
anchors { left: parent.left; right: parent.right; }
anchors.leftMargin: constant.paddingSmall;
anchors.rightMargin: constant.paddingSmall;
font.pixelSize: constant.fontSizeNormal;
anchors {
left: parent.left
right: parent.right
leftMargin: constant.paddingSmall;
rightMargin: constant.paddingSmall;
}
visible: (description) ? true : false;
elide: Text.ElideRight;
textFormat: Text.StyledText;
linkColor: Theme.highlightColor;
onLinkActivated: {
//console.log("Link clicked! " + link);
contextLink = link;
contextMenu = commentContextMenu.createObject(galleryContainer);
contextMenu.show(galleryContentDelegate);
contextMenu.open(galleryContentDelegate);
}
}
}
Expand Down
Loading

0 comments on commit 45b2344

Please sign in to comment.