Applied some minor optimizations to the resource browser and right-aligned the file size column
This commit is contained in:
parent
6f98ae5bb8
commit
c1405bfac1
|
@ -49,7 +49,7 @@ void CResourceBrowser::OnSortModeChanged(int Index)
|
||||||
|
|
||||||
void CResourceBrowser::OnSearchStringChanged()
|
void CResourceBrowser::OnSearchStringChanged()
|
||||||
{
|
{
|
||||||
mpProxyModel->SetSearchString( mpUI->SearchBar->text() );
|
mpProxyModel->SetSearchString( TO_TWIDESTRING(mpUI->SearchBar->text()) );
|
||||||
}
|
}
|
||||||
|
|
||||||
void CResourceBrowser::OnDirectorySelectionChanged(const QModelIndex& rkNewIndex, const QModelIndex& /*rkPrevIndex*/)
|
void CResourceBrowser::OnDirectorySelectionChanged(const QModelIndex& rkNewIndex, const QModelIndex& /*rkPrevIndex*/)
|
||||||
|
|
|
@ -83,6 +83,9 @@
|
||||||
<property name="alternatingRowColors">
|
<property name="alternatingRowColors">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="selectionMode">
|
||||||
|
<enum>QAbstractItemView::SingleSelection</enum>
|
||||||
|
</property>
|
||||||
<property name="iconSize">
|
<property name="iconSize">
|
||||||
<size>
|
<size>
|
||||||
<width>16</width>
|
<width>16</width>
|
||||||
|
|
|
@ -17,7 +17,7 @@ public:
|
||||||
private:
|
private:
|
||||||
CResourceTableModel *mpModel;
|
CResourceTableModel *mpModel;
|
||||||
CVirtualDirectory *mpDirectory;
|
CVirtualDirectory *mpDirectory;
|
||||||
QString mSearchString;
|
TWideString mSearchString;
|
||||||
ESortMode mSortMode;
|
ESortMode mSortMode;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -56,7 +56,7 @@ public:
|
||||||
if (mpDirectory && !pEntry->IsInDirectory(mpDirectory))
|
if (mpDirectory && !pEntry->IsInDirectory(mpDirectory))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (!mSearchString.isEmpty() && !pEntry->Name().Contains(TO_TWIDESTRING(mSearchString), false))
|
if (!mSearchString.IsEmpty() && !pEntry->UppercaseName().Contains(mSearchString))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -74,14 +74,14 @@ public:
|
||||||
inline void SetDirectory(CVirtualDirectory *pDir)
|
inline void SetDirectory(CVirtualDirectory *pDir)
|
||||||
{
|
{
|
||||||
mpDirectory = pDir;
|
mpDirectory = pDir;
|
||||||
invalidateFilter();
|
invalidate();
|
||||||
}
|
}
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void SetSearchString(const QString& rkString)
|
void SetSearchString(const TWideString& rkString)
|
||||||
{
|
{
|
||||||
mSearchString = rkString;
|
mSearchString = rkString.ToUpper();
|
||||||
invalidateFilter();
|
invalidate();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -49,6 +49,9 @@ public:
|
||||||
else if (Role == Qt::ToolTipRole)
|
else if (Role == Qt::ToolTipRole)
|
||||||
return TO_QSTRING(pEntry->Directory()->FullPath() + pEntry->Name());
|
return TO_QSTRING(pEntry->Directory()->FullPath() + pEntry->Name());
|
||||||
|
|
||||||
|
else if (Role == Qt::TextAlignmentRole && rkIndex.column() == 2)
|
||||||
|
return Qt::AlignRight;
|
||||||
|
|
||||||
return QVariant::Invalid;
|
return QVariant::Invalid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue