]> cloud.milkyroute.net Git - dolphin.git/blob - src/search/barsecondrowflowlayout.h
Fix up 2f208662cbd604f879027d3cd633a5ce59182a4f
[dolphin.git] / src / search / barsecondrowflowlayout.h
1 /*
2 SPDX-FileCopyrightText: 2025 Felix Ernst <felixernst@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
5 */
6
7 #ifndef BARSECONDROWFLOWLAYOUT_H
8 #define BARSECONDROWFLOWLAYOUT_H
9
10 #include <QLayout>
11
12 namespace Search
13 {
14
15 /**
16 * @brief The layout for all Search::Bar contents which are not in the first row.
17 *
18 * For left-to-right languages the search location buttons are kept left-aligned while the chips are right-aligned. When there is not enough space for all the
19 * widgts in the current row, a new row is started and the Search::Bar is notified that it needs to resize itself.
20 */
21 class BarSecondRowFlowLayout : public QLayout
22 {
23 Q_OBJECT
24
25 public:
26 explicit BarSecondRowFlowLayout(QWidget *parent);
27 ~BarSecondRowFlowLayout();
28
29 void addItem(QLayoutItem *item) override;
30 Qt::Orientations expandingDirections() const override;
31 bool hasHeightForWidth() const override;
32 int count() const override;
33 QLayoutItem *itemAt(int index) const override;
34 QSize minimumSize() const override;
35 void setGeometry(const QRect &rect) override;
36 QSize sizeHint() const override;
37 QLayoutItem *takeAt(int index) override;
38
39 Q_SIGNALS:
40 void heightHintChanged();
41
42 private:
43 QList<QLayoutItem *> itemList;
44 };
45
46 }
47
48 #endif // BARSECONDROWFLOWLAYOUT_H