Changeset View
Changeset View
Standalone View
Standalone View
app/startmainpage.cpp
Show All 27 Lines | |||||
28 | #include <QMenu> | 28 | #include <QMenu> | ||
29 | 29 | | |||
30 | #ifdef GTK_WORKAROUND_BROKE_IN_KF5_PORT | 30 | #ifdef GTK_WORKAROUND_BROKE_IN_KF5_PORT | ||
31 | #include <QPlastiqueStyle> | 31 | #include <QPlastiqueStyle> | ||
32 | #endif | 32 | #endif | ||
33 | 33 | | |||
34 | #include <QIcon> | 34 | #include <QIcon> | ||
35 | #include <QStyledItemDelegate> | 35 | #include <QStyledItemDelegate> | ||
36 | #include <QScroller> | ||||
36 | 37 | | |||
ngraham: Unnecessary whitespace change | |||||
37 | // KDE | 38 | // KDE | ||
38 | #include <KFilePlacesModel> | 39 | #include <KFilePlacesModel> | ||
39 | #include <KLocalizedString> | 40 | #include <KLocalizedString> | ||
40 | 41 | | |||
41 | // Local | 42 | // Local | ||
42 | #include <gvcore.h> | 43 | #include <gvcore.h> | ||
43 | #include <ui_startmainpage.h> | 44 | #include <ui_startmainpage.h> | ||
44 | #include <lib/dialogguard.h> | 45 | #include <lib/dialogguard.h> | ||
▲ Show 20 Lines • Show All 112 Lines • ▼ Show 20 Line(s) | 153 | if (styleIsGtkBased()) { | |||
157 | QStyle* fix = new QPlastiqueStyle(); | 158 | QStyle* fix = new QPlastiqueStyle(); | ||
158 | fix->setParent(this); | 159 | fix->setParent(this); | ||
159 | d->mHistoryWidget->tabBar()->setStyle(fix); | 160 | d->mHistoryWidget->tabBar()->setStyle(fix); | ||
160 | d->mPlacesTagsWidget->tabBar()->setStyle(fix); | 161 | d->mPlacesTagsWidget->tabBar()->setStyle(fix); | ||
161 | #endif | 162 | #endif | ||
162 | } | 163 | } | ||
163 | setFrameStyle(QFrame::NoFrame); | 164 | setFrameStyle(QFrame::NoFrame); | ||
164 | 165 | | |||
166 | d->mBookmarksView->setDragEnabled(false); | ||||
This breaks reordering by dragging in the places panel for mouse users, so I don't think this can be removed. rkflx: This breaks reordering by dragging in the places panel for mouse users, so I don't think this… | |||||
167 | QScroller* mScroller = QScroller::scroller(d->mBookmarksView->viewport()); | ||||
168 | QScrollerProperties scrollerProp = mScroller->scrollerProperties(); | ||||
169 | scrollerProp.setScrollMetric(QScrollerProperties::HorizontalOvershootPolicy,1); | ||||
170 | scrollerProp.setScrollMetric(QScrollerProperties::VerticalOvershootPolicy,1); | ||||
171 | mScroller->setScrollerProperties(scrollerProp); | ||||
172 | mScroller->grabGesture(d->mBookmarksView->viewport(), QScroller::TouchGesture); | ||||
This duplicates a lot of code from FolderViewContextManagerItem, so you might think about putting this into a separate function taking the viewport as a parameter (in app, but see lib/*utils* for some examples). rkflx: This duplicates a lot of code from `FolderViewContextManagerItem`, so you might think about… | |||||
173 | | ||||
165 | // Bookmark view | 174 | // Bookmark view | ||
166 | d->mBookmarksModel = new KFilePlacesModel(this); | 175 | d->mBookmarksModel = new KFilePlacesModel(this); | ||
167 | 176 | | |||
168 | d->mBookmarksView->setModel(d->mBookmarksModel); | 177 | d->mBookmarksView->setModel(d->mBookmarksModel); | ||
169 | d->mBookmarksView->setAutoResizeItemsEnabled(false); | 178 | d->mBookmarksView->setAutoResizeItemsEnabled(false); | ||
170 | 179 | | |||
171 | connect(d->mBookmarksView, &KFilePlacesView::urlChanged, this, &StartMainPage::urlSelected); | 180 | connect(d->mBookmarksView, &KFilePlacesView::urlChanged, this, &StartMainPage::urlSelected); | ||
172 | 181 | | |||
▲ Show 20 Lines • Show All 163 Lines • Show Last 20 Lines |
Unnecessary whitespace change