]>
cloud.milkyroute.net Git - dolphin.git/blob - src/dolphincontroller.cpp
1 /***************************************************************************
2 * Copyright (C) 2006 by Peter Penz (peter.penz@gmx.at) *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
9 * This program is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12 * GNU General Public License for more details. *
14 * You should have received a copy of the GNU General Public License *
15 * along with this program; if not, write to the *
16 * Free Software Foundation, Inc., *
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
18 ***************************************************************************/
20 #include "dolphincontroller.h"
24 DolphinController::DolphinController(QObject
* parent
) :
26 m_showHiddenFiles(false),
28 m_zoomInPossible(false),
29 m_zoomOutPossible(false),
30 m_additionalInfoCount(0),
35 DolphinController::~DolphinController()
39 void DolphinController::setUrl(const KUrl
& url
)
47 void DolphinController::triggerContextMenuRequest(const QPoint
& pos
)
50 emit
requestContextMenu(pos
);
53 void DolphinController::triggerActivation()
58 void DolphinController::indicateDroppedUrls(const KUrl::List
& urls
,
60 const QModelIndex
& destIndex
,
63 emit
urlsDropped(urls
, destPath
, destIndex
, source
);
67 void DolphinController::indicateSortingChange(DolphinView::Sorting sorting
)
69 emit
sortingChanged(sorting
);
72 void DolphinController::indicateSortOrderChange(Qt::SortOrder order
)
74 emit
sortOrderChanged(order
);
77 void DolphinController::setShowHiddenFiles(bool show
)
79 if (m_showHiddenFiles
!= show
) {
80 m_showHiddenFiles
= show
;
81 emit
showHiddenFilesChanged(show
);
85 void DolphinController::setShowPreview(bool show
)
87 if (m_showPreview
!= show
) {
89 emit
showPreviewChanged(show
);
93 void DolphinController::setAdditionalInfoCount(int count
)
95 if (m_additionalInfoCount
!= count
) {
96 m_additionalInfoCount
= count
;
97 emit
additionalInfoCountChanged(count
);
101 void DolphinController::triggerZoomIn()
106 void DolphinController::triggerZoomOut()
111 void DolphinController::drawHoverIndication(QWidget
* widget
,
115 QPainter
painter(widget
);
117 QBrush
blendedBrush(brush
);
118 QColor color
= blendedBrush
.color();
120 blendedBrush
.setColor(color
);
122 const int radius
= 10;
123 QPainterPath
path(QPointF(bounds
.left(), bounds
.top() + radius
));
124 path
.quadTo(bounds
.left(), bounds
.top(), bounds
.left() + radius
, bounds
.top());
125 path
.lineTo(bounds
.right() - radius
, bounds
.top());
126 path
.quadTo(bounds
.right(), bounds
.top(), bounds
.right(), bounds
.top() + radius
);
127 path
.lineTo(bounds
.right(), bounds
.bottom() - radius
);
128 path
.quadTo(bounds
.right(), bounds
.bottom(), bounds
.right() - radius
, bounds
.bottom());
129 path
.lineTo(bounds
.left() + radius
, bounds
.bottom());
130 path
.quadTo(bounds
.left(), bounds
.bottom(), bounds
.left(), bounds
.bottom() - radius
);
133 painter
.setRenderHint(QPainter::Antialiasing
);
134 painter
.fillPath(path
, blendedBrush
);
138 void DolphinController::triggerItem(const KFileItem
& item
)
140 emit
itemTriggered(item
);
143 void DolphinController::emitItemEntered(const KFileItem
& item
)
145 emit
itemEntered(item
);
148 void DolphinController::emitViewportEntered()
150 emit
viewportEntered();
153 #include "dolphincontroller.moc"