Skip to content

Commit

Permalink
Default Style|ProgressWidget: Icon tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Sep 13, 2013
1 parent f9cf783 commit 22582a7
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 12 deletions.
4 changes: 2 additions & 2 deletions doomsday/client/data/defaultstyle.pack/colors.dei
Expand Up @@ -43,11 +43,11 @@ group choice {

group progress {
group light {
color wheel { rgb <1.0, 1.0, 1.0, 0.5> }
color wheel { rgb <1.0, 1.0, 1.0, 0.25> }
color shadow { rgb <0.0, 0.0, 0.0, 0.54> }
}
group dark {
color wheel { rgb <0.0, 0.0, 0.0, 0.5> }
color wheel { rgb <0.0, 0.0, 0.0, 0.25> }
color shadow { rgb <1.0, 1.0, 1.0, 0.54> }
}
}
Expand Down
Binary file modified doomsday/client/data/defaultstyle.pack/graphics/network.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified doomsday/client/data/defaultstyle.pack/graphics/updater.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions doomsday/client/data/defaultstyle.pack/images.dei
Expand Up @@ -34,4 +34,5 @@ group toggle {
group progress {
image wheel { path = "graphics/progress-wheel.png" }
image gear { path = "graphics/progress-gear.png" }
image mini { path = "graphics/progress-mini.png" }
}
12 changes: 6 additions & 6 deletions doomsday/client/src/ui/widgets/progresswidget.cpp
Expand Up @@ -55,7 +55,7 @@ DENG_GUI_PIMPL(ProgressWidget), public Lockable

void updateStyle()
{
self.setImageColor(style().colors().colorf(colorId) * Vector4f(1, 1, 1, .5f));
self.setImageColor(style().colors().colorf(colorId) /* * Vector4f(1, 1, 1, .5f)*/);
}

void glInit()
Expand Down Expand Up @@ -86,16 +86,16 @@ ProgressWidget::ProgressWidget(String const &name) : d(new Instance(this))

void ProgressWidget::useMiniStyle()
{
/// @todo Make this look better.
// Don't use the normal wheel.
setImage(de::Image());

d->gearId = "gear"; // Mini gear icon.
d->gearId = "progress.mini";
d->colorId = "text";
setImageScale(1);
setAlignment(ui::AlignCenter, LabelWidget::AlignByCombination);

// Resize to the height of the default font.
float hgt = style().fonts().font("default").height().value();
setOverrideImageSize(Vector2f(hgt, hgt));
setOverrideImageSize(style().fonts().font("default").height().value());
}

ProgressWidget::Mode ProgressWidget::mode() const
Expand Down Expand Up @@ -239,7 +239,7 @@ void ProgressWidget::glMakeGeometry(DefaultVertexBuf::Builder &verts)

DefaultVertexBuf::Builder gear;
DefaultVertexBuf::Type v;
v.rgba = style().colors().colorf(d->colorId);
v.rgba = style().colors().colorf(d->colorId) * Vector4f(1, 1, 1, 2);

for(int i = 0; i <= edgeCount; ++i)
{
Expand Down
22 changes: 18 additions & 4 deletions doomsday/client/src/updater/updater.cpp
Expand Up @@ -119,6 +119,7 @@ class UpdaterStatusWidget : public ProgressWidget
UpdaterStatusWidget()
{
useMiniStyle();
setColor("text");
setSizePolicy(ui::Expand, ui::Expand);

// The notification has a hidden button that can be clicked.
Expand Down Expand Up @@ -266,10 +267,24 @@ DENG2_OBSERVES(App, StartupComplete)
ClientWindow::main().notifications().showOrHide(status, show);
}

void queryLatestVersion(bool notifyAlways)
void showCheckingNotification()
{
status->setRange(Rangei(0, 1));
status->setProgress(0, 0);
status->setImage(ClientApp::windowSystem().style().images().image("updater"));
showNotification(true);
}

void showDownloadNotification()
{
status->setMode(ProgressWidget::Indefinite);
status->setImage(Image());
showNotification(true);
}

void queryLatestVersion(bool notifyAlways)
{
showCheckingNotification();

UpdaterSettings().setLastCheckTime(de::Time());
alwaysShowNotification = notifyAlways;
Expand Down Expand Up @@ -354,8 +369,7 @@ DENG2_OBSERVES(App, StartupComplete)
//availableDlg = 0;

// The notification provides access to the download dialog.
showNotification(true);
status->setMode(ProgressWidget::Indefinite);
showDownloadNotification();

LOG_MSG("Download and install.");

Expand Down Expand Up @@ -520,7 +534,7 @@ void Updater::downloadCompleted(int)
_E(.) "Doomsday will be shut down before the installation can start. "
"The game is not saved automatically, so you will have to "
"save the game before installing the update."));
msg->buttons().items()
msg->buttons()
<< new DialogButtonItem(DialogWidget::Accept | DialogWidget::Default, tr("I'll Save First"))
<< new DialogButtonItem(DialogWidget::Reject, tr("Discard Progress & Install"));

Expand Down

0 comments on commit 22582a7

Please sign in to comment.