]>
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(DolphinView
* dolphinView
) :
26 m_zoomInPossible(false),
27 m_zoomOutPossible(false),
29 m_dolphinView(dolphinView
)
33 DolphinController::~DolphinController()
37 void DolphinController::setUrl(const KUrl
& url
)
45 void DolphinController::triggerUrlChangeRequest(const KUrl
& url
)
48 emit
requestUrlChange(url
);
52 void DolphinController::triggerContextMenuRequest(const QPoint
& pos
)
55 emit
requestContextMenu(pos
);
58 void DolphinController::requestActivation()
63 void DolphinController::indicateDroppedUrls(const KUrl::List
& urls
,
65 const KFileItem
& destItem
,
68 emit
urlsDropped(urls
, destPath
, destItem
, source
);
72 void DolphinController::indicateSortingChange(DolphinView::Sorting sorting
)
74 emit
sortingChanged(sorting
);
77 void DolphinController::indicateSortOrderChange(Qt::SortOrder order
)
79 emit
sortOrderChanged(order
);
82 void DolphinController::indicateAdditionalInfoChange(const KFileItemDelegate::InformationList
& info
)
84 emit
additionalInfoChanged(info
);
87 void DolphinController::indicateActivationChange(bool active
)
89 emit
activationChanged(active
);
92 void DolphinController::triggerZoomIn()
97 void DolphinController::triggerZoomOut()
102 void DolphinController::drawHoverIndication(QWidget
* widget
,
106 QPainter
painter(widget
);
108 QBrush
blendedBrush(brush
);
109 QColor color
= blendedBrush
.color();
111 blendedBrush
.setColor(color
);
113 const int radius
= 10;
114 QPainterPath
path(QPointF(bounds
.left(), bounds
.top() + radius
));
115 path
.quadTo(bounds
.left(), bounds
.top(), bounds
.left() + radius
, bounds
.top());
116 path
.lineTo(bounds
.right() - radius
, bounds
.top());
117 path
.quadTo(bounds
.right(), bounds
.top(), bounds
.right(), bounds
.top() + radius
);
118 path
.lineTo(bounds
.right(), bounds
.bottom() - radius
);
119 path
.quadTo(bounds
.right(), bounds
.bottom(), bounds
.right() - radius
, bounds
.bottom());
120 path
.lineTo(bounds
.left() + radius
, bounds
.bottom());
121 path
.quadTo(bounds
.left(), bounds
.bottom(), bounds
.left(), bounds
.bottom() - radius
);
124 painter
.setRenderHint(QPainter::Antialiasing
);
125 painter
.fillPath(path
, blendedBrush
);
129 void DolphinController::triggerItem(const KFileItem
& item
)
131 emit
itemTriggered(item
);
134 void DolphinController::emitItemEntered(const KFileItem
& item
)
136 emit
itemEntered(item
);
139 void DolphinController::emitViewportEntered()
141 emit
viewportEntered();
144 #include "dolphincontroller.moc"