Skip to content

Commit

Permalink
libappfw: Dialog titles can optionally have an icon
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Aug 23, 2015
1 parent 0c366cb commit d60f064
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
6 changes: 5 additions & 1 deletion doomsday/sdk/libappfw/src/dialogs/messagedialog.cpp
Expand Up @@ -13,7 +13,7 @@
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
* General Public License for more details. You should have received a copy of
* the GNU Lesser General Public License along with this program; if not, see:
* http://www.gnu.org/licenses</small>
* http://www.gnu.org/licenses</small>
*/

#include "de/MessageDialog"
Expand Down Expand Up @@ -43,6 +43,10 @@ DENG_GUI_PIMPL(MessageDialog)
title->setTextColor("accent");
title->setSizePolicy(ui::Fixed, ui::Expand);
title->setAlignment(ui::AlignLeft);
title->setTextAlignment(ui::AlignRight);
title->setOverrideImageSize(title->font().ascent().valuei());
title->setImageColor(style().colors().colorf("accent"));
title->setTextGap("gap");
title->setTextLineAlignment(ui::AlignLeft);
message->setSizePolicy(ui::Fixed, ui::Expand);
message->setAlignment(ui::AlignLeft);
Expand Down
15 changes: 10 additions & 5 deletions doomsday/sdk/libappfw/src/widgets/dialogwidget.cpp
Expand Up @@ -13,7 +13,7 @@
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
* General Public License for more details. You should have received a copy of
* the GNU Lesser General Public License along with this program; if not, see:
* http://www.gnu.org/licenses</small>
* http://www.gnu.org/licenses</small>
*/

#include "de/DialogWidget"
Expand Down Expand Up @@ -158,15 +158,20 @@ public ChildWidgetOrganizer::IFilter
.setBottom("")
.setTop (style().rules().rule("gap") + style().rules().rule("dialog.gap"))
.setLeft(style().rules().rule("gap") + style().rules().rule("dialog.gap"));
heading->setSizePolicy(ui::Expand, ui::Expand);
heading->setSizePolicy(ui::Filled, ui::Expand);
heading->setTextColor("accent");
heading->setAlignment(ui::AlignLeft);
heading->setImageColor(style().colors().colorf("accent"));
heading->setOverrideImageSize(heading->font().ascent().valuei());
heading->setTextGap("dialog.gap");
heading->setTextAlignment(ui::AlignRight);
heading->setTextLineAlignment(ui::AlignLeft);
heading->setFillMode(LabelWidget::FillWithText);
container->add(heading);

heading->rule()
.setInput(Rule::Top, self.rule().top())
.setInput(Rule::Left, self.rule().left());
.setInput(Rule::Top, self.rule().top())
.setInput(Rule::Left, self.rule().left())
.setInput(Rule::Right, area->rule().right());

area->rule().setInput(Rule::Top, heading->rule().bottom());
}
Expand Down

0 comments on commit d60f064

Please sign in to comment.