Skip to content

Commit

Permalink
UI|Home: Use a "file" icon for data files
Browse files Browse the repository at this point in the history
Packages are represented by the package box icon, other files use
the new file icon.
  • Loading branch information
skyjake committed Jul 2, 2016
1 parent 8fdbcc8 commit e6ad1f8
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Expand Up @@ -36,6 +36,7 @@ image refresh { path = "graphics/refresh.png" }
image fold { path = "graphics/fold.png" }
image gauge { path = "graphics/gauge.png" }
image gear { path = "graphics/gear.png" }
image file { path = "graphics/file.png" }
image package { path = "graphics/package.png" }
close {
image ring { path = "graphics/close.png" }
Expand Down
16 changes: 14 additions & 2 deletions doomsday/apps/client/src/ui/widgets/packageswidget.cpp
Expand Up @@ -29,6 +29,7 @@
#include <de/LineEditWidget>
#include <de/Loop>
#include <de/MenuWidget>
#include <de/NativeFile>
#include <de/PackageLoader>
#include <de/PopupButtonWidget>
#include <de/ProgressWidget>
Expand Down Expand Up @@ -252,9 +253,20 @@ DENG_GUI_PIMPL(PackagesWidget)

void updateContents()
{
String pkgId = packageId();
if (pkgId.startsWith("file."))
{
icon().setStyleImage("file", "default");

// Local files should not be indicated to be packages.
if (NativeFile const *native = _item->file->source()->maybeAs<NativeFile>())
{
pkgId = _E(s) + native->nativePath().pretty() + _E(.);
}
}
label().setText(String(_E(b) "%1\n" _E(l) "%2")
.arg(_item->label())
.arg(packageId()));
.arg(pkgId));

String auxColor = "accent";

Expand All @@ -273,7 +285,7 @@ DENG_GUI_PIMPL(PackagesWidget)

if (highlight)
{
icon().setImageColor(style().colors().colorf("accent"));
icon().setImageColor(style().colors().colorf("inverted.text"));
useColorTheme(_owner.d->unselectedItemHilit, _owner.d->selectedItemHilit);
auxColor = "background";
}
Expand Down

0 comments on commit e6ad1f8

Please sign in to comment.