Skip to content

Commit

Permalink
UI|Client|PopupWidget: "Info" style for popups
Browse files Browse the repository at this point in the history
A popup widget may now configure itself for "informational" use.
  • Loading branch information
skyjake committed Aug 24, 2013
1 parent d81079e commit 52c309d
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 4 deletions.
15 changes: 11 additions & 4 deletions doomsday/client/data/defaultstyle.pack/colors.dei
Expand Up @@ -30,6 +30,13 @@ group label {
color dimaccent { rgb <0.85, 0.68, 0.34> }
}

group popup {
group info {
color background { rgb <1.0, 1.0, 1.0> }
color glow { rgb $= inverted.glow.rgb }
}
}

group choice {
color popup { rgb $= gui.colorAlpha(background.rgb, 1.0) }
}
Expand All @@ -54,10 +61,10 @@ group editor {
color cursor { rgb $= gui.colorAlpha(accent.rgb, 0.7) }
color hint { rgb $= textaccent.rgb }

group completion {
color background { rgb <1.0, 1.0, 1.0> }
color glow { rgb $= inverted.glow.rgb }
}
#group completion {
# color background { rgb <1.0, 1.0, 1.0> }
# color glow { rgb $= inverted.glow.rgb }
#}
}

group log {
Expand Down
6 changes: 6 additions & 0 deletions doomsday/client/include/ui/widgets/popupwidget.h
Expand Up @@ -85,6 +85,12 @@ class PopupWidget : public GuiWidget
*/
void setClickToClose(bool clickCloses);

/**
* Sets the style of the popup to the one used for informational popups
* rather than interactive (the default) ones.
*/
void useInfoStyle();

// Events.
void viewResized();
void update();
Expand Down
3 changes: 3 additions & 0 deletions doomsday/client/src/ui/widgets/consolecommandwidget.cpp
Expand Up @@ -50,10 +50,13 @@ public IGameChangeObserver
completions->setMaximumLineWidth(640);

popup = new PopupWidget;
popup->useInfoStyle();
/*
popup->set(Background(st.colors().colorf("editor.completion.background"),
Background::BorderGlow,
st.colors().colorf("editor.completion.glow"),
st.rules().rule("glow").valuei()));
*/
popup->setContent(completions);

// Height for the content: depends on the document height (plus margins), but at
Expand Down
8 changes: 8 additions & 0 deletions doomsday/client/src/ui/widgets/popupwidget.cpp
Expand Up @@ -323,6 +323,14 @@ void PopupWidget::setClickToClose(bool clickCloses)
d->clickToClose = clickCloses;
}

void PopupWidget::useInfoStyle()
{
set(Background(style().colors().colorf("popup.info.background"),
Background::BorderGlow,
style().colors().colorf("popup.info.glow"),
style().rules().rule("glow").valuei()));
}

void PopupWidget::viewResized()
{
GuiWidget::viewResized();
Expand Down

0 comments on commit 52c309d

Please sign in to comment.