Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Network
Kaidan
Commits
b243744a
Verified
Commit
b243744a
authored
Dec 23, 2019
by
Melvin Keskin
Committed by
Linus Jahn
Dec 30, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor usage of images with rounded corners
Signed-off-by:
Linus Jahn
<
lnj@kaidan.im
>
parent
d71fe8aa
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
74 additions
and
41 deletions
+74
-41
src/qml/elements/Avatar.qml
src/qml/elements/Avatar.qml
+18
-22
src/qml/elements/MediaPreviewImage.qml
src/qml/elements/MediaPreviewImage.qml
+1
-1
src/qml/elements/RoundImage.qml
src/qml/elements/RoundImage.qml
+2
-18
src/qml/elements/RoundedImage.qml
src/qml/elements/RoundedImage.qml
+52
-0
src/qml/qml.qrc
src/qml/qml.qrc
+1
-0
No files found.
src/qml/elements/Avatar.qml
View file @
b243744a
...
...
@@ -28,10 +28,7 @@
* along with Kaidan. If not, see <http://www.gnu.org/licenses/>.
*/
import
QtQuick
2.7
import
QtQuick
.
Layouts
1.3
import
org
.
kde
.
kirigami
2.8
as
Kirigami
Item
{
id
:
avatar
...
...
@@ -46,7 +43,6 @@ Item {
mipmap
:
true
height
:
width
anchors.fill
:
parent
isRound
:
true
}
TextAvatar
{
...
...
src/qml/elements/MediaPreviewImage.qml
View file @
b243744a
...
...
@@ -45,7 +45,7 @@ MediaPreview {
Layout.preferredWidth
:
Kirigami
.
Units
.
gridUnit
*
32
Layout.maximumWidth
:
message
?
messageSize
:
-
1
Animat
edImage
{
Round
edImage
{
id
:
image
fillMode
:
Image
.
PreserveAspectFit
...
...
src/qml/elements/RoundImage.qml
View file @
b243744a
...
...
@@ -29,24 +29,8 @@
*/
import
QtQuick
2.7
import
QtGraphicalEffects
1.0
Image
{
Rounded
Image
{
id
:
img
property
bool
isRound
:
true
layer.enabled
:
isRound
layer.effect
:
OpacityMask
{
maskSource
:
Item
{
width
:
img
.
paintedWidth
height
:
img
.
paintedHeight
Rectangle
{
anchors.centerIn
:
parent
width
:
Math
.
min
(
img
.
width
,
img
.
height
)
height
:
width
radius
:
Math
.
min
(
width
,
height
)
}
}
}
}
src/qml/elements/RoundedImage.qml
0 → 100644
View file @
b243744a
/*
* Kaidan - A user-friendly XMPP client for every device!
*
* Copyright (C) 2016-2019 Kaidan developers and contributors
* (see the LICENSE file for a full list of copyright authors)
*
* Kaidan 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 3 of the License, or
* (at your option) any later version.
*
* In addition, as a special exception, the author of Kaidan gives
* permission to link the code of its release with the OpenSSL
* project's "OpenSSL" library (or with modified versions of it that
* use the same license as the "OpenSSL" library), and distribute the
* linked executables. You must obey the GNU General Public License in
* all respects for all of the code used other than "OpenSSL". If you
* modify this file, you may extend this exception to your version of
* the file, but you are not obligated to do so. If you do not wish to
* do so, delete this exception statement from your version.
*
* Kaidan is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Kaidan. If not, see <http://www.gnu.org/licenses/>.
*/
import
QtQuick
2.6
import
QtGraphicalEffects
1.0
AnimatedImage
{
id
:
img
property
int
radius
:
roundedCornersRadius
layer.enabled
:
true
layer.effect
:
OpacityMask
{
maskSource
:
Item
{
width
:
img
.
paintedWidth
height
:
img
.
paintedHeight
Rectangle
{
anchors.centerIn
:
parent
width
:
Math
.
min
(
img
.
width
,
img
.
height
)
height
:
width
radius
:
img
.
radius
}
}
}
}
src/qml/qml.qrc
View file @
b243744a
...
...
@@ -19,6 +19,7 @@
<file>elements/RosterListItem.qml</file>
<file>elements/MessageCounter.qml</file>
<file>elements/ChatMessage.qml</file>
<file>elements/RoundedImage.qml</file>
<file>elements/RoundImage.qml</file>
<file>elements/IconButton.qml</file>
<file>elements/FileChooser.qml</file>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment