Changeset View
Changeset View
Standalone View
Standalone View
importer/thumbnailpage.cpp
Show First 20 Lines • Show All 45 Lines • ▼ Show 20 Line(s) | |||||
46 | #include <lib/semanticinfo/sorteddirmodel.h> | 46 | #include <lib/semanticinfo/sorteddirmodel.h> | ||
47 | #include <lib/thumbnailview/abstractthumbnailviewhelper.h> | 47 | #include <lib/thumbnailview/abstractthumbnailviewhelper.h> | ||
48 | #include <lib/thumbnailview/previewitemdelegate.h> | 48 | #include <lib/thumbnailview/previewitemdelegate.h> | ||
49 | #include <documentdirfinder.h> | 49 | #include <documentdirfinder.h> | ||
50 | #include <importerconfigdialog.h> | 50 | #include <importerconfigdialog.h> | ||
51 | #include <serializedurlmap.h> | 51 | #include <serializedurlmap.h> | ||
52 | #include <ui_thumbnailpage.h> | 52 | #include <ui_thumbnailpage.h> | ||
53 | #include <lib/thumbnailprovider/thumbnailprovider.h> | 53 | #include <lib/thumbnailprovider/thumbnailprovider.h> | ||
54 | 54 | | |||
rkflx: Remove | |||||
55 | namespace Gwenview | 55 | namespace Gwenview | ||
56 | { | 56 | { | ||
57 | 57 | | |||
58 | static const int DEFAULT_THUMBNAIL_SIZE = 128; | 58 | static const int DEFAULT_THUMBNAIL_SIZE = 128; | ||
59 | static const qreal DEFAULT_THUMBNAIL_ASPECT_RATIO = 3. / 2.; | 59 | static const qreal DEFAULT_THUMBNAIL_ASPECT_RATIO = 3. / 2.; | ||
60 | 60 | | |||
61 | static const char* URL_FOR_BASE_URL_GROUP = "UrlForBaseUrl"; | 61 | static const char* URL_FOR_BASE_URL_GROUP = "UrlForBaseUrl"; | ||
62 | 62 | | |||
▲ Show 20 Lines • Show All 94 Lines • ▼ Show 20 Line(s) | 86 | { | |||
157 | { | 157 | { | ||
158 | mThumbnailView->setModel(mFinalModel); | 158 | mThumbnailView->setModel(mFinalModel); | ||
159 | 159 | | |||
160 | mThumbnailView->setSelectionMode(QAbstractItemView::ExtendedSelection); | 160 | mThumbnailView->setSelectionMode(QAbstractItemView::ExtendedSelection); | ||
161 | mThumbnailView->setThumbnailViewHelper(new ImporterThumbnailViewHelper(q)); | 161 | mThumbnailView->setThumbnailViewHelper(new ImporterThumbnailViewHelper(q)); | ||
162 | 162 | | |||
163 | PreviewItemDelegate* delegate = new PreviewItemDelegate(mThumbnailView); | 163 | PreviewItemDelegate* delegate = new PreviewItemDelegate(mThumbnailView); | ||
164 | delegate->setThumbnailDetails(PreviewItemDelegate::FileNameDetail); | 164 | delegate->setThumbnailDetails(PreviewItemDelegate::FileNameDetail); | ||
165 | delegate->setContextBarActions(PreviewItemDelegate::SelectionAction); | 165 | PreviewItemDelegate::ContextBarActions actions; | ||
166 | switch (GwenviewConfig::thumbnailActions()) | ||||
167 | { | ||||
168 | case ThumbnailActions::None: | ||||
169 | actions = PreviewItemDelegate::NoAction; | ||||
170 | break; | ||||
171 | case ThumbnailActions::ShowSelectionButtonOnly: | ||||
172 | case ThumbnailActions::AllButtons: | ||||
173 | actions = PreviewItemDelegate::SelectionAction; | ||||
174 | break; | ||||
175 | } | ||||
176 | delegate->setContextBarActions(actions); | ||||
166 | mThumbnailView->setItemDelegate(delegate); | 177 | mThumbnailView->setItemDelegate(delegate); | ||
167 | 178 | | |||
168 | // Colors | 179 | // Colors | ||
169 | int value = GwenviewConfig::viewBackgroundValue(); | 180 | int value = GwenviewConfig::viewBackgroundValue(); | ||
170 | QColor bgColor = QColor::fromHsv(0, 0, value); | 181 | QColor bgColor = QColor::fromHsv(0, 0, value); | ||
171 | QColor fgColor = value > 128 ? Qt::black : Qt::white; | 182 | QColor fgColor = value > 128 ? Qt::black : Qt::white; | ||
172 | 183 | | |||
173 | QPalette pal = mThumbnailView->palette(); | 184 | QPalette pal = mThumbnailView->palette(); | ||
▲ Show 20 Lines • Show All 286 Lines • Show Last 20 Lines |
Remove