mirror of
https://github.com/parchlinux/calamares.git
synced 2025-06-28 09:55:37 -04:00
Split out Labels view from Bars view.
Both are QAbstractItemViews and can be used on top of a PartitionModel, together or separately.
This commit is contained in:
parent
b65fe87503
commit
eed8d3b83b
5 changed files with 405 additions and 209 deletions
|
@ -32,7 +32,7 @@ class PartitionBarsView : public QAbstractItemView
|
|||
{
|
||||
public:
|
||||
explicit PartitionBarsView( QWidget* parent = nullptr );
|
||||
~PartitionBarsView();
|
||||
virtual ~PartitionBarsView();
|
||||
|
||||
QSize minimumSizeHint() const override;
|
||||
|
||||
|
@ -45,8 +45,6 @@ public:
|
|||
QRect visualRect( const QModelIndex& index ) const override;
|
||||
void scrollTo( const QModelIndex& index, ScrollHint hint = EnsureVisible ) override;
|
||||
|
||||
void setLabelsVisible( bool visible = true );
|
||||
|
||||
protected:
|
||||
// QAbstractItemView API
|
||||
QRegion visualRegionForSelection( const QItemSelection& selection ) const override;
|
||||
|
@ -61,13 +59,6 @@ protected slots:
|
|||
|
||||
private:
|
||||
void drawPartitions( QPainter* painter, const QRect& rect, const QModelIndex& parent );
|
||||
void drawLabels( QPainter* painter, const QRect& rect, const QModelIndex& parent );
|
||||
QSize sizeForAllLabels( int maxLineWidth ) const;
|
||||
QSize sizeForLabel( const QStringList& text ) const;
|
||||
void drawLabel( QPainter* painter, const QStringList& text, const QColor& color, const QPoint& pos );
|
||||
QModelIndexList getIndexesToDraw( const QModelIndex& parent ) const;
|
||||
|
||||
bool m_showLabels;
|
||||
};
|
||||
|
||||
#endif /* PARTITIONPREVIEW_H */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue