┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/panels
diff options
context:
space:
mode:
authorEugene Popov <[email protected]>2021-07-11 21:12:16 +0300
committerElvis Angelaccio <[email protected]>2021-07-18 16:58:10 +0000
commitdeaf5916f2f87d78825f33f2ba11475a24c9380f (patch)
tree4e3afcb1fe860253bb03ac80173f6823a99b5c26 /src/panels
parent3bde6ba13c3ba46369aa2c2e439fbf635c6aedea (diff)
[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
Diffstat (limited to 'src/panels')
-rw-r--r--src/panels/places/placesview.cpp11
-rw-r--r--src/panels/places/placesview.h3
2 files changed, 14 insertions, 0 deletions
diff --git a/src/panels/places/placesview.cpp b/src/panels/places/placesview.cpp
index 50446d44d..dc264e411 100644
--- a/src/panels/places/placesview.cpp
+++ b/src/panels/places/placesview.cpp
@@ -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());
+}
diff --git a/src/panels/places/placesview.h b/src/panels/places/placesview.h
index 6005e8b48..86515f56b 100644
--- a/src/panels/places/placesview.h
+++ b/src/panels/places/placesview.h
@@ -23,6 +23,9 @@ public:
void setIconSize(int size);
int iconSize() const;
+
+protected:
+ void resizeEvent(QGraphicsSceneResizeEvent *event) override;
};
#endif