diff options
author | Ken Moore <ken@ixsystems.com> | 2016-12-05 12:30:23 -0500 |
---|---|---|
committer | Ken Moore <ken@ixsystems.com> | 2016-12-05 12:30:23 -0500 |
commit | 5e027876c9aea2f7d7aed8e7e26b7f6dfada31c7 (patch) | |
tree | b9bffe6e5072cbc507b5244471ad5df6e3c19c1a /src-qt5/desktop-utils/lumina-fm | |
parent | Have the "start-lumina-desktop" binary check for an existing lockfile and rem... (diff) | |
download | lumina-5e027876c9aea2f7d7aed8e7e26b7f6dfada31c7.tar.gz lumina-5e027876c9aea2f7d7aed8e7e26b7f6dfada31c7.tar.bz2 lumina-5e027876c9aea2f7d7aed8e7e26b7f6dfada31c7.zip |
Commit a couple tweaks for lumina-fm - trying to get the drag and drop highlighting working.
Diffstat (limited to 'src-qt5/desktop-utils/lumina-fm')
-rw-r--r-- | src-qt5/desktop-utils/lumina-fm/BrowserWidget.cpp | 9 | ||||
-rw-r--r-- | src-qt5/desktop-utils/lumina-fm/widgets/DDListWidgets.h | 11 |
2 files changed, 12 insertions, 8 deletions
diff --git a/src-qt5/desktop-utils/lumina-fm/BrowserWidget.cpp b/src-qt5/desktop-utils/lumina-fm/BrowserWidget.cpp index 0d9c33f8..0486e337 100644 --- a/src-qt5/desktop-utils/lumina-fm/BrowserWidget.cpp +++ b/src-qt5/desktop-utils/lumina-fm/BrowserWidget.cpp @@ -29,7 +29,7 @@ BrowserWidget::BrowserWidget(QString objID, QWidget *parent) : QWidget(parent){ readDateFormat(); freshload = true; //nothing loaded yet numItems = 0; - + this->setMouseTracking(true); } BrowserWidget::~BrowserWidget(){ @@ -137,10 +137,9 @@ QStringList BrowserWidget::history(){ } void BrowserWidget::setShowActive(bool show){ - if(!show){ this->setStyleSheet("QAbstractScrollArea{ background-color: rgba(10,10,10,10); } QHeaderView{ background-color: lightgrey; }"); } - else{ - this->setStyleSheet( ""); - } + QString base = "";//"QListWidget::item,QTreeWidget::item{ border: 1px solid transparent; background-color: red; } QListWidget::item:hover,QTreeWidget::item:hover{ border: 1px solid black; background-color: blue; }"; + if(!show){ base.prepend("QAbstractScrollArea{ background-color: rgba(10,10,10,10); } QHeaderView{ background-color: lightgrey; } "); } + this->setStyleSheet(base); } // This function is only called if user changes sessionsettings. By doing so, operations like sorting by date diff --git a/src-qt5/desktop-utils/lumina-fm/widgets/DDListWidgets.h b/src-qt5/desktop-utils/lumina-fm/widgets/DDListWidgets.h index f7373432..254362fd 100644 --- a/src-qt5/desktop-utils/lumina-fm/widgets/DDListWidgets.h +++ b/src-qt5/desktop-utils/lumina-fm/widgets/DDListWidgets.h @@ -45,6 +45,7 @@ public: this->setWrapping(true); this->setMouseTracking(true); this->setSortingEnabled(true); //This sorts *only* by name - type is not preserved + //this->setStyleSheet("QListWidget::item{ border: 1px solid transparent; border-radius: 5px; background-color: transparent;} QListWidget::item:hover{ border-color: black; } QListWidget::item:focus{ border-color: lightblue; }"); } ~DDListWidget(){} @@ -85,7 +86,7 @@ protected: ev->acceptProposedAction(); //allow this to be dropped here }else{ ev->ignore(); - } + } } void dragMoveEvent(QDragMoveEvent *ev){ @@ -93,12 +94,15 @@ protected: //Change the drop type depending on the data/dir QString home = QDir::homePath(); //qDebug() << "Drag Move:" << home << this->whatsThis(); - if( this->whatsThis().startsWith(home) ){ ev->setDropAction(Qt::MoveAction); } - else{ ev->setDropAction(Qt::CopyAction); } + if( this->whatsThis().startsWith(home) ){ ev->setDropAction(Qt::MoveAction); this->setCursor(Qt::DragMoveCursor); } + else{ ev->setDropAction(Qt::CopyAction); this->setCursor(Qt::DragCopyCursor);} ev->acceptProposedAction(); //allow this to be dropped here + //this->setCursor(Qt::CrossCursor); }else{ + this->setCursor(Qt::ForbiddenCursor); ev->ignore(); } + this->update(); } void dropEvent(QDropEvent *ev){ @@ -127,6 +131,7 @@ protected: } //qDebug() << "Drop Event:" << dirpath << files; if(!files.isEmpty()){ emit DataDropped( dirpath, files ); } + this->setCursor(Qt::ArrowCursor); } void mouseReleaseEvent(QMouseEvent *ev){ |