-
Notifications
You must be signed in to change notification settings - Fork 78
Add photo card component and update photo component #4317
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
gabriel-bolbotina
wants to merge
10
commits into
master
Choose a base branch
from
add-photo-card-component
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
14f1125
Created photo card component
gabriel-bolbotina 188dc39
Made changes to the photo card component
gabriel-bolbotina a5c1b74
Modified the font and proportions
gabriel-bolbotina 58548aa
Fixed Photo page and added the photoCard
gabriel-bolbotina fadc750
Replaced opacityMask and fastblur with MultiEffects in MMPhoto and MM…
gabriel-bolbotina 1bafbbc
Removed photo card page from gallery
gabriel-bolbotina 72c124f
Simplified photo card component
gabriel-bolbotina 0f13b28
Implemented code findings
gabriel-bolbotina 21e77d6
Set default text visible to false for MMPhotoCard
gabriel-bolbotina b3f605a
Merge branch 'master' into add-photo-card-component
gabriel-bolbotina File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,103 @@ | ||
| /*************************************************************************** | ||
| * * | ||
| * This program is free software; you can redistribute it and/or modify * | ||
| * it under the terms of the GNU General Public License as published by * | ||
| * the Free Software Foundation; either version 2 of the License, or * | ||
| * (at your option) any later version. * | ||
| * * | ||
| ***************************************************************************/ | ||
| pragma ComponentBehavior: Bound | ||
|
|
||
| import QtQuick | ||
gabriel-bolbotina marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| import QtQuick.Effects | ||
|
|
||
| Item { | ||
| id: root | ||
|
|
||
| property alias imageSource: bngImage.photoUrl | ||
| property string text: "" | ||
| property bool textVisible: false | ||
| property int size: 120 * __dp | ||
|
|
||
| signal clicked(url path) | ||
|
|
||
| height: size | ||
| width: size | ||
|
|
||
| layer.enabled: true | ||
| layer.effect: MultiEffect { | ||
| maskEnabled: true | ||
| maskSource: photoMask | ||
| autoPaddingEnabled: false | ||
| } | ||
|
|
||
| Rectangle { | ||
| id: photoMask | ||
| width: root.width | ||
| height: root.height | ||
| radius: 20 * __dp | ||
| visible: false | ||
| layer.enabled: true | ||
| } | ||
|
|
||
| MMPhoto { | ||
| id: bngImage | ||
| anchors.fill: root | ||
| fillMode: Image.PreserveAspectCrop | ||
| } | ||
|
|
||
| MultiEffect{ | ||
| id: blurFooter | ||
| height: root.height * 0.33 | ||
| visible: root.textVisible | ||
| anchors { | ||
| left: root.left | ||
| right: root.right | ||
| bottom: root.bottom | ||
| } | ||
|
|
||
| source: ShaderEffectSource { | ||
| sourceItem: bngImage | ||
| sourceRect: Qt.rect(0, bngImage.height - bngImage.height * 0.33, bngImage.width, | ||
| bngImage.height * 0.33) | ||
| recursive: false | ||
| } | ||
|
|
||
| autoPaddingEnabled: false | ||
| blurEnabled: true | ||
| blur: 0.8 | ||
| } | ||
|
|
||
| // tint overlay | ||
| Rectangle { | ||
| anchors.fill: blurFooter | ||
| color: __style.nightColor | ||
| opacity: 0.35 | ||
| visible: root.textVisible | ||
| } | ||
|
|
||
| Text { | ||
| visible: root.textVisible | ||
| text: root.text | ||
| width: root.width - 2 * (root.size * 0.15) | ||
| anchors.centerIn: blurFooter | ||
|
|
||
| color: __style.polarColor | ||
| font: __style.t5 | ||
|
|
||
| lineHeightMode: Text.FixedHeight | ||
| lineHeight: __style.margin16 | ||
| maximumLineCount: 2 | ||
|
|
||
| horizontalAlignment: Text.AlignHCenter | Text.AlignJustify | ||
| verticalAlignment: Text.AlignVCenter | ||
|
|
||
| wrapMode: Text.WordWrap | ||
| elide: Text.ElideRight | ||
| } | ||
|
|
||
| MMSingleClickMouseArea { | ||
| anchors.fill: root | ||
| onSingleClicked: root.clicked(root.imageSource) | ||
| } | ||
gabriel-bolbotina marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.