From c53b03d4ef58a420ba3835616f560b109d9064e8 Mon Sep 17 00:00:00 2001 From: Andreas Traczyk <andreas.traczyk@savoirfairelinux.com> Date: Mon, 31 May 2021 16:58:56 -0400 Subject: [PATCH] calloverlay: use svg icon for menu expansion buttons Change-Id: I8d90b116740c9d671b6b65073ba9cff9c92e7646 Gitlab: #411 --- images/icons/chevron_left_black_24dp.svg | 1 + resources.qrc | 1 + src/commoncomponents/ResponsiveImage.qml | 5 +--- .../components/CallButtonDelegate.qml | 23 +++++++++++++------ 4 files changed, 19 insertions(+), 11 deletions(-) create mode 100644 images/icons/chevron_left_black_24dp.svg diff --git a/images/icons/chevron_left_black_24dp.svg b/images/icons/chevron_left_black_24dp.svg new file mode 100644 index 000000000..fad9a0553 --- /dev/null +++ b/images/icons/chevron_left_black_24dp.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0z" fill="none"/><path d="M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"/></svg> \ No newline at end of file diff --git a/resources.qrc b/resources.qrc index 4b8aac1be..9b40183a6 100644 --- a/resources.qrc +++ b/resources.qrc @@ -142,5 +142,6 @@ <file>images/icons/spk_black_24dp.svg</file> <file>images/icons/spk_none_black_24dp.svg</file> <file>images/icons/more_vert-24dp.svg</file> + <file>images/icons/chevron_left_black_24dp.svg</file> </qresource> </RCC> diff --git a/src/commoncomponents/ResponsiveImage.qml b/src/commoncomponents/ResponsiveImage.qml index a703d23a9..639505824 100644 --- a/src/commoncomponents/ResponsiveImage.qml +++ b/src/commoncomponents/ResponsiveImage.qml @@ -54,10 +54,7 @@ Image { layer { enabled: true - effect: ColorOverlay { - id: overlay - color: root.color - } + effect: ColorOverlay { color: root.color } } function setSourceSize() { diff --git a/src/mainview/components/CallButtonDelegate.qml b/src/mainview/components/CallButtonDelegate.qml index fe2383beb..892f635fd 100644 --- a/src/mainview/components/CallButtonDelegate.qml +++ b/src/mainview/components/CallButtonDelegate.qml @@ -156,10 +156,18 @@ ItemDelegate { indicator: null visible: menuAction !== undefined && !BadgeCount - anchors.horizontalCenter: parent.horizontalCenter + + y: isVertical ? 0 : -4 + x: isVertical ? -4 : 0 + anchors.horizontalCenter: isVertical ? + undefined : + parent.horizontalCenter + anchors.verticalCenter: isVertical ? + parent.verticalCenter : + undefined + width: 18 height: width - y: -4 Connections { target: menuAction !== undefined ? @@ -171,10 +179,11 @@ ItemDelegate { } } - contentItem: Text { - text: "^" - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter + contentItem: ResponsiveImage { + source: isVertical ? + "qrc:/images/icons/chevron_left_black_24dp.svg" : + "qrc:/images/icons/expand_less-24px.svg" + smooth: true color: "white" } @@ -231,7 +240,7 @@ ItemDelegate { -(implicitHeight - wrapper.height) / 2 : -implicitHeight - 12 x: isVertical ? - -implicitWidth - 24 : + -implicitWidth - 18 : -(implicitWidth - wrapper.width) / 2 - 18 implicitWidth: contentItem.implicitWidth -- GitLab