ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright (C) 2020 by Savoir-faire Linux |
| 3 | * Author: Albert BabĂ <albert.babig@savoirfairelinux.com> |
| 4 | * |
| 5 | * This program is free software; you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License as published by |
| 7 | * the Free Software Foundation; either version 3 of the License, or |
| 8 | * (at your option) any later version. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU General Public License |
| 16 | * along with this program. If not, see <https://www.gnu.org/licenses/>. |
| 17 | */ |
| 18 | |
| 19 | import QtQuick 2.14 |
| 20 | import QtQuick.Controls 1.4 |
| 21 | import net.jami.Models 1.0 |
| 22 | |
| 23 | |
| 24 | Label { |
| 25 | property string eText : "" |
| 26 | property int maxWidth: 100 |
| 27 | property int fontSize: JamiTheme.textFontSize |
| 28 | |
| 29 | font.pointSize: fontSize |
| 30 | font.kerning: true |
| 31 | |
| 32 | text: elided.elidedText |
| 33 | |
| 34 | horizontalAlignment: Text.AlignLeft |
| 35 | verticalAlignment: Text.AlignVCenter |
| 36 | color: "black" |
| 37 | |
| 38 | TextMetrics { |
| 39 | id: elided |
| 40 | elide: Text.ElideRight |
| 41 | elideWidth: maxWidth |
| 42 | text: eText |
| 43 | } |
| 44 | } |