Skip to content
Permalink
Browse files

[ui] resurrect home folder

  • Loading branch information
nirvn committed Oct 3, 2018
1 parent 359986d commit 3235fb54220490db5d3ce1e1a58625c45de9234c
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"><path d="M1.5 2.501V13.75s.019.75.75.75h11.5s.749 0 .749-.75L14.5 4.5H9.2l-2-2H1.5z" fill="#eee" stroke="#888a85"/><path d="M4.505 9.5L8 6l3.505 3.5" fill="none" stroke="#333" stroke-linecap="round"/><path d="M5.505 9v3.5h5V9" fill="none" stroke="#333" stroke-linecap="round"/></svg>
@@ -508,6 +508,13 @@ A Collection: logical collection of layers or subcollections, e.g. GRASS locatio
%Docstring
Shared open directory icon.

.. versionadded:: 3.4
%End

static QIcon homeDirIcon();
%Docstring
Shared home directory icon.

.. versionadded:: 3.4
%End
};
@@ -90,9 +90,6 @@ void QgsBrowserModel::addRootItems()
// give the home directory a prominent third place
QgsDirectoryItem *item = new QgsDirectoryItem( nullptr, tr( "Home" ), QDir::homePath(), QStringLiteral( HOME_PREFIX ) + QDir::homePath() );
item->setSortKey( QStringLiteral( " 2" ) );
QStyle *style = QApplication::style();
QIcon homeIcon( style->standardIcon( QStyle::SP_DirHomeIcon ) );
item->setIcon( homeIcon );
connectItem( item );
mRootItems << item;

@@ -94,6 +94,11 @@ QIcon QgsDataCollectionItem::openDirIcon()
return QgsApplication::getThemeIcon( QStringLiteral( "/mIconFolderOpen.svg" ) );
}

QIcon QgsDataCollectionItem::homeDirIcon()
{
return QgsApplication::getThemeIcon( QStringLiteral( "mIconFolderHome.svg" ) );
}

QIcon QgsDataCollectionItem::iconDir()
{
return QgsApplication::getThemeIcon( QStringLiteral( "/mIconFolder.svg" ) );
@@ -730,6 +735,9 @@ void QgsDirectoryItem::init()

QIcon QgsDirectoryItem::icon()
{
if ( mDirPath == QDir::homePath() )
return homeDirIcon();

// still loading? show the spinner
if ( state() == Populating )
return QgsDataItem::icon();
@@ -530,6 +530,12 @@ class CORE_EXPORT QgsDataCollectionItem : public QgsDataItem
* \since QGIS 3.4
*/
static QIcon openDirIcon();

/**
* Shared home directory icon.
* \since QGIS 3.4
*/
static QIcon homeDirIcon();
};

/**

0 comments on commit 3235fb5

Please sign in to comment.
You can’t perform that action at this time.