mirror of
https://invent.kde.org/system/dolphin
synced 2024-10-28 03:21:56 +00:00
[PlacesPanel] Remove horizontal scrollbar
This MR removes the horizontal scrollbar of the Places panel. For titles that don't fit in the panel, their elided versions will be used (i.e., with ...).
BUG: 301758
(cherry picked from commit deaf5916f2
)
This commit is contained in:
parent
3fe971e174
commit
90699c2c2d
|
@ -7,10 +7,15 @@
|
|||
#include "placesview.h"
|
||||
|
||||
#include "dolphin_placespanelsettings.h"
|
||||
#include "kitemviews/kitemlistheader.h"
|
||||
|
||||
#include <QGraphicsSceneResizeEvent>
|
||||
|
||||
PlacesView::PlacesView(QGraphicsWidget* parent) :
|
||||
KStandardItemListView(parent)
|
||||
{
|
||||
header()->setAutomaticColumnResizing(false);
|
||||
|
||||
const int iconSize = PlacesPanelSettings::iconSize();
|
||||
if (iconSize >= 0) {
|
||||
setIconSize(iconSize);
|
||||
|
@ -36,3 +41,9 @@ int PlacesView::iconSize() const
|
|||
return option.iconSize;
|
||||
}
|
||||
|
||||
void PlacesView::resizeEvent(QGraphicsSceneResizeEvent *event)
|
||||
{
|
||||
KStandardItemListView::resizeEvent(event);
|
||||
|
||||
header()->setColumnWidth(QByteArrayLiteral("text"), event->newSize().width());
|
||||
}
|
||||
|
|
|
@ -23,6 +23,9 @@ public:
|
|||
|
||||
void setIconSize(int size);
|
||||
int iconSize() const;
|
||||
|
||||
protected:
|
||||
void resizeEvent(QGraphicsSceneResizeEvent *event) override;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue