summaryrefslogtreecommitdiffstats
path: root/filestreewidget.cpp
diff options
context:
space:
mode:
authorArno <am@disconnect.de>2010-10-16 15:21:21 +0200
committerArno <am@disconnect.de>2010-10-16 15:21:21 +0200
commitd7db872a15418d20392990a65d9525c11e2a4fa4 (patch)
tree778104058f0fa87a5dbeb25aa7f6f410f2b748e4 /filestreewidget.cpp
parentbf5ccbe56631ac516751a9f194b643f77fdedf82 (diff)
downloadSheMov-d7db872a15418d20392990a65d9525c11e2a4fa4.tar.gz
SheMov-d7db872a15418d20392990a65d9525c11e2a4fa4.tar.bz2
SheMov-d7db872a15418d20392990a65d9525c11e2a4fa4.zip
Made hovering configurable
Revamped misc tab in configurationdialog to QGroupBoxes. Added options for enabling or disabling hovering over pictures or the archive tree. Also implemented an option to set the opacity for HoverWindow.
Diffstat (limited to 'filestreewidget.cpp')
-rw-r--r--filestreewidget.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/filestreewidget.cpp b/filestreewidget.cpp
index 0dab9a2..43611f9 100644
--- a/filestreewidget.cpp
+++ b/filestreewidget.cpp
@@ -269,9 +269,15 @@ void FilesTreeWidget::fileSelectionChanged(const QItemSelection &selected, const
emit sizeChanged(mSelectedSize);
}
-FilesTreeView::FilesTreeView(QWidget *parent) : QTreeView(parent){
+FilesTreeView::FilesTreeView(QWidget *parent) : QTreeView(parent), mHoverWin(new HoverWindow), mHover(false){
setAttribute(Qt::WA_Hover);
- mHoverWin = new HoverWindow;
+ readConfig();
+}
+
+void FilesTreeView::readConfig(){
+ QSettings s;
+ mHover = s.value("ui/hoverpics", true).toBool();
+ mHoverWin->setWindowOpacity(s.value("ui/hoveropacity", 10).toFloat() / 10.0);
}
void FilesTreeView::contextMenuEvent(QContextMenuEvent *event){
@@ -283,6 +289,10 @@ void FilesTreeView::contextMenuEvent(QContextMenuEvent *event){
}
bool FilesTreeView::event(QEvent *e){
+ QSettings s;
+ if(!s.value("ui/hoverpics").toBool()){
+ return true;
+ }
QModelIndex curIdx;
QHoverEvent *hEvent = static_cast<QHoverEvent*>(e);
QPoint hotSpot(hEvent->pos().x(), hEvent->pos().y() - SmGlobals::instance()->cursorOffset());