mirror of
https://git.jami.net/savoirfairelinux/jami-client-qt.git
synced 2025-08-04 14:55:43 +02:00
misc: fix svg icon coloration
Change-Id: Idfe409c6e01f8437cba2659e79234a6083bec04e
This commit is contained in:
parent
b3fb4e3aa7
commit
24a8631c34
11 changed files with 59 additions and 90 deletions
|
@ -62,8 +62,6 @@ ApplicationWindow {
|
|||
|
||||
anchors.fill: parent
|
||||
|
||||
smooth: true
|
||||
antialiasing: true
|
||||
source: "qrc:/images/logo-jami-standard-coul.svg"
|
||||
}
|
||||
|
||||
|
|
|
@ -102,22 +102,13 @@ AbstractButton {
|
|||
return normalImageSource
|
||||
}
|
||||
|
||||
layer {
|
||||
enabled: imageColor || checkedColor
|
||||
effect: ColorOverlay {
|
||||
id: overlay
|
||||
color: {
|
||||
if (checked && checkedImageColor)
|
||||
return checkedImageColor
|
||||
else if (imageColor)
|
||||
return imageColor
|
||||
else
|
||||
return JamiTheme.transparentColor
|
||||
}
|
||||
}
|
||||
// Mipmap does not render correctly on linux
|
||||
mipmap: false
|
||||
smooth: true
|
||||
color: {
|
||||
if (checked && checkedImageColor)
|
||||
return checkedImageColor
|
||||
else if (imageColor)
|
||||
return imageColor
|
||||
else
|
||||
return JamiTheme.transparentColor
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ import QtGraphicalEffects 1.14
|
|||
|
||||
import net.jami.Models 1.0
|
||||
|
||||
Image {
|
||||
Item {
|
||||
id: root
|
||||
|
||||
property real containerWidth: 30
|
||||
|
@ -31,8 +31,8 @@ Image {
|
|||
property int padding: 0
|
||||
property point offset: Qt.point(0, 0)
|
||||
|
||||
property string normalSource
|
||||
property string checkedSource
|
||||
property alias source: image.source
|
||||
property alias status: image.status
|
||||
property string color: "transparent"
|
||||
|
||||
property bool isSvg: {
|
||||
|
@ -47,29 +47,37 @@ Image {
|
|||
width: Math.trunc(containerWidth * Math.sqrt(2) * 0.5) + 3 - padding
|
||||
height: Math.trunc(containerHeight * Math.sqrt(2) * 0.5) + 3 - padding
|
||||
|
||||
fillMode: Image.PreserveAspectFit
|
||||
smooth: false
|
||||
antialiasing: false
|
||||
asynchronous: true
|
||||
|
||||
layer {
|
||||
enabled: true
|
||||
effect: ColorOverlay { color: root.color }
|
||||
}
|
||||
|
||||
function setSourceSize() {
|
||||
sourceSize = undefined
|
||||
if (isSvg)
|
||||
sourceSize = Qt.size(width, height)
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: ScreenInfo
|
||||
|
||||
function onDevicePixelRatioChanged() {
|
||||
setSourceSize()
|
||||
image.setSourceSize()
|
||||
}
|
||||
}
|
||||
|
||||
Component.onCompleted: setSourceSize()
|
||||
Image {
|
||||
id: image
|
||||
|
||||
anchors.fill: root
|
||||
|
||||
fillMode: Image.PreserveAspectFit
|
||||
smooth: true
|
||||
antialiasing: true
|
||||
asynchronous: true
|
||||
visible: false
|
||||
|
||||
function setSourceSize() {
|
||||
sourceSize = undefined
|
||||
if (isSvg)
|
||||
sourceSize = Qt.size(width, height)
|
||||
}
|
||||
|
||||
Component.onCompleted: setSourceSize()
|
||||
}
|
||||
|
||||
ColorOverlay {
|
||||
anchors.fill: image
|
||||
source: image
|
||||
color: root.color
|
||||
}
|
||||
}
|
||||
|
|
|
@ -74,7 +74,6 @@ MenuItem {
|
|||
visible: status === Image.Ready
|
||||
|
||||
color: iconColor !== "" ? iconColor : JamiTheme.textColor
|
||||
smooth: true
|
||||
opacity: 0.7
|
||||
}
|
||||
|
||||
|
|
|
@ -66,9 +66,6 @@ ModalPopup {
|
|||
Layout.preferredWidth: 250
|
||||
Layout.preferredHeight: 88
|
||||
|
||||
smooth: true
|
||||
antialiasing: true
|
||||
|
||||
source: JamiTheme.darkTheme?
|
||||
"qrc:/images/logo-jami-standard-coul-white.svg" :
|
||||
"qrc:/images/logo-jami-standard-coul.svg"
|
||||
|
|
|
@ -188,16 +188,12 @@ Label {
|
|||
ResponsiveImage {
|
||||
id: arrowDropDown
|
||||
|
||||
width: 24
|
||||
height: 24
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
|
||||
layer {
|
||||
enabled: true
|
||||
effect: ColorOverlay {
|
||||
color: JamiTheme.textColor
|
||||
}
|
||||
}
|
||||
width: 24
|
||||
height: 24
|
||||
|
||||
color: JamiTheme.textColor
|
||||
|
||||
source: !root.popup.opened ?
|
||||
"qrc:/images/icons/expand_more-24px.svg" :
|
||||
|
|
|
@ -116,7 +116,6 @@ ItemDelegate {
|
|||
containerHeight: size
|
||||
|
||||
anchors.centerIn: parent
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
source: ItemAction ? ItemAction.icon.source : ""
|
||||
color: ItemAction ? ItemAction.icon.color : null
|
||||
|
||||
|
@ -189,7 +188,6 @@ ItemDelegate {
|
|||
contentItem: ResponsiveImage {
|
||||
source: isVertical ? "qrc:/images/icons/chevron_left_black_24dp.svg" :
|
||||
"qrc:/images/icons/expand_less-24px.svg"
|
||||
smooth: true
|
||||
color: "white"
|
||||
}
|
||||
|
||||
|
@ -217,7 +215,6 @@ ItemDelegate {
|
|||
IconSource : (menuItem.ListView.isCurrentItem ?
|
||||
"qrc:/images/icons/check_box-24px.svg" :
|
||||
"qrc:/images/icons/check_box_outline_blank-24px.svg")
|
||||
smooth: true
|
||||
color: "white"
|
||||
}
|
||||
Text {
|
||||
|
|
|
@ -63,11 +63,7 @@ Rectangle {
|
|||
height: 20
|
||||
|
||||
source: "qrc:/images/icons/ic_baseline-search-24px.svg"
|
||||
|
||||
layer.enabled: true
|
||||
layer.effect: ColorOverlay {
|
||||
color: JamiTheme.primaryForegroundColor
|
||||
}
|
||||
color: JamiTheme.primaryForegroundColor
|
||||
}
|
||||
|
||||
TextField {
|
||||
|
|
|
@ -129,57 +129,46 @@ Item {
|
|||
ResponsiveImage {
|
||||
id: isHostIndicator
|
||||
|
||||
visible: participantIsHost
|
||||
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
Layout.leftMargin: 6
|
||||
|
||||
containerHeight: 12
|
||||
containerWidth: 12
|
||||
|
||||
visible: participantIsHost
|
||||
|
||||
source: "qrc:/images/icons/star_outline-24px.svg"
|
||||
layer {
|
||||
enabled: true
|
||||
effect: ColorOverlay { color: JamiTheme.whiteColor }
|
||||
mipmap: false
|
||||
smooth: true
|
||||
}
|
||||
color: JamiTheme.whiteColor
|
||||
}
|
||||
|
||||
ResponsiveImage {
|
||||
id: isModeratorIndicator
|
||||
|
||||
visible: participantIsModerator
|
||||
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
Layout.leftMargin: 6
|
||||
|
||||
containerHeight: 12
|
||||
containerWidth: 12
|
||||
|
||||
visible: participantIsModerator
|
||||
|
||||
source: "qrc:/images/icons/moderator.svg"
|
||||
layer {
|
||||
enabled: true
|
||||
effect: ColorOverlay { color: JamiTheme.whiteColor }
|
||||
mipmap: false
|
||||
smooth: true
|
||||
}
|
||||
color: JamiTheme.whiteColor
|
||||
}
|
||||
|
||||
ResponsiveImage {
|
||||
id: isMutedIndicator
|
||||
|
||||
visible: participantIsMuted
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
Layout.leftMargin: 6
|
||||
|
||||
containerHeight: 12
|
||||
containerWidth: 12
|
||||
|
||||
visible: participantIsMuted
|
||||
|
||||
source: "qrc:/images/icons/mic_off-24px.svg"
|
||||
layer {
|
||||
enabled: true
|
||||
effect: ColorOverlay { color: JamiTheme.whiteColor }
|
||||
mipmap: false
|
||||
smooth: true
|
||||
}
|
||||
color: JamiTheme.whiteColor
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -54,10 +54,9 @@ Rectangle {
|
|||
Layout.preferredHeight: Math.min(welcomePageColumnLayout.width / 3, 110)
|
||||
Layout.bottomMargin: 10
|
||||
|
||||
smooth: true
|
||||
antialiasing: true
|
||||
|
||||
source: JamiTheme.darkTheme? "qrc:/images/logo-jami-standard-coul-white.svg" : "qrc:/images/logo-jami-standard-coul.svg"
|
||||
source: JamiTheme.darkTheme ?
|
||||
"qrc:/images/logo-jami-standard-coul-white.svg" :
|
||||
"qrc:/images/logo-jami-standard-coul.svg"
|
||||
}
|
||||
|
||||
Label {
|
||||
|
|
|
@ -69,10 +69,9 @@ Rectangle {
|
|||
Layout.preferredWidth: 330
|
||||
Layout.preferredHeight: 110
|
||||
|
||||
smooth: true
|
||||
antialiasing: true
|
||||
|
||||
source: JamiTheme.darkTheme ? "qrc:/images/logo-jami-standard-coul-white.svg" : "qrc:/images/logo-jami-standard-coul.svg"
|
||||
source: JamiTheme.darkTheme ?
|
||||
"qrc:/images/logo-jami-standard-coul-white.svg" :
|
||||
"qrc:/images/logo-jami-standard-coul.svg"
|
||||
}
|
||||
|
||||
MaterialButton {
|
||||
|
|
Loading…
Add table
Reference in a new issue