Skip to content

Commit

Permalink
UI|Client: Inverted colors for Renderer Appearance profile picker popups
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Jan 1, 2016
1 parent 491de38 commit b0a3319
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions doomsday/apps/client/include/ui/widgets/profilepickerwidget.h
Expand Up @@ -47,6 +47,8 @@ class ProfilePickerWidget : public de::ChoiceWidget

ButtonWidget &button();

void useInvertedStyleForPopups();

signals:
void profileChanged();
void profileEditorRequested();
Expand Down
Expand Up @@ -71,6 +71,7 @@ public VariableGroupEditor::IOwner

// The contents of the editor will scroll.
container->add(profile = new ProfilePickerWidget(settings, tr("appearance")));
profile->useInvertedStyleForPopups();

// Sky settings.
skyGroup = new Group(this, "sky", tr("Sky"));
Expand Down
8 changes: 8 additions & 0 deletions doomsday/apps/client/src/ui/widgets/profilepickerwidget.cpp
Expand Up @@ -34,6 +34,7 @@ DENG_GUI_PIMPL(ProfilePickerWidget)
SettingsRegister &settings;
String description;
PopupButtonWidget *button;
bool invertedPopups = false;

Instance(Public *i, SettingsRegister& reg)
: Base(i)
Expand Down Expand Up @@ -96,6 +97,12 @@ ButtonWidget &ProfilePickerWidget::button()
return *d->button;
}

void ProfilePickerWidget::useInvertedStyleForPopups()
{
d->invertedPopups = true;
popup().useInfoStyle();
}

void ProfilePickerWidget::updateStyle()
{
ChoiceWidget::updateStyle();
Expand All @@ -110,6 +117,7 @@ void ProfilePickerWidget::openMenu()
auto *menu = new PopupMenuWidget;
menu->setAllowDirectionFlip(false);
menu->setDeleteAfterDismissed(true);
if(d->invertedPopups) menu->useInfoStyle();
d->button->setPopup(*menu, ui::Down);
menu->items()
<< new ActionItem(tr("Edit"), new SignalAction(this, SLOT(edit())))
Expand Down

0 comments on commit b0a3319

Please sign in to comment.