fix(StatusBanner): TestNet banner overlaps left panel

let the text elide on the right side if the parent width is smaller
than ours

Related: status-im/status-desktop#6600
This commit is contained in:
Lukáš Tinkl 2022-07-25 11:35:37 +02:00 committed by Lukáš Tinkl
parent 2f650dc745
commit 59b2fe4641
1 changed files with 6 additions and 3 deletions

View File

@ -37,7 +37,7 @@ Column {
*/ */
property string statusText property string statusText
/*! /*!
\qmlproperty string StatusBanner::type \qmlproperty int StatusBanner::type
This property holds type of banner. Possible values are: This property holds type of banner. Possible values are:
\qml \qml
enum Type { enum Type {
@ -50,12 +50,12 @@ Column {
*/ */
property int type: StatusBanner.Type.Info property int type: StatusBanner.Type.Info
/*! /*!
\qmlproperty string StatusBanner::textPixels \qmlproperty int StatusBanner::textPixels
This property holds the pixels size of the text inside the banner. This property holds the pixels size of the text inside the banner.
*/ */
property int textPixels: 15 property int textPixels: 15
/*! /*!
\qmlproperty string StatusBanner::statusBannerHeight \qmlproperty int StatusBanner::statusBannerHeight
This property holds the height of the banner rectangle. This property holds the height of the banner rectangle.
*/ */
property int statusBannerHeight: 38 property int statusBannerHeight: 38
@ -94,9 +94,12 @@ Column {
StatusBaseText { StatusBaseText {
id: statusTxt id: statusTxt
anchors.fill: parent anchors.fill: parent
anchors.leftMargin: 8
anchors.rightMargin: 8
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
font.pixelSize: statusBanner.textPixels font.pixelSize: statusBanner.textPixels
elide: Text.ElideRight
text: statusBanner.statusText text: statusBanner.statusText
color: d.fontColor color: d.fontColor
} }