Mercurial > minori
comparison include/gui/widgets/text.h @ 365:f81bed4e04ac
*: megacommit that probably breaks things
author | Paper <paper@paper.us.eu.org> |
---|---|
date | Wed, 02 Oct 2024 23:06:43 -0400 |
parents | 6b0768158dcd |
children |
comparison
equal
deleted
inserted
replaced
364:99c961c91809 | 365:f81bed4e04ac |
---|---|
26 void SetText(const std::string& title); | 26 void SetText(const std::string& title); |
27 | 27 |
28 protected: | 28 protected: |
29 QPointer<QLabel> title_; | 29 QPointer<QLabel> title_; |
30 QPointer<QFrame> separator_; | 30 QPointer<QFrame> separator_; |
31 }; | |
32 | |
33 class Label final : public QLabel { | |
34 Q_OBJECT | |
35 | |
36 public: | |
37 Label(QWidget *parent = nullptr); | |
38 Label(const QString &string, QWidget *parent = nullptr); | |
39 void SetElidingMode(bool elide); | |
40 | |
41 protected: | |
42 void paintEvent(QPaintEvent *event) override; | |
43 | |
44 private: | |
45 bool elide_; | |
31 }; | 46 }; |
32 | 47 |
33 /* This is a nice clean wrapper around Label suitable for our needs. */ | 48 /* This is a nice clean wrapper around Label suitable for our needs. */ |
34 class Paragraph : public QWidget { | 49 class Paragraph : public QWidget { |
35 Q_OBJECT | 50 Q_OBJECT |
63 | 78 |
64 protected: | 79 protected: |
65 QPointer<QWidget> contents_; | 80 QPointer<QWidget> contents_; |
66 QPointer<QGridLayout> contents_layout_; | 81 QPointer<QGridLayout> contents_layout_; |
67 | 82 |
68 std::vector<std::pair<QSharedPointer<QLabel>, QSharedPointer<QLabel>>> data_; | 83 std::vector<std::pair<QSharedPointer<Label>, QSharedPointer<Label>>> data_; |
69 }; | 84 }; |
70 | 85 |
71 /* this is just a generic QLabel with a specific font and foreground role, | 86 /* this is just a generic QLabel with a specific font and foreground role, |
72 * which is why it's defined inline */ | 87 * which is why it's defined inline */ |
73 class Title final : public Paragraph { | 88 class Title final : public Paragraph { |