Skip to content

Commit

Permalink
Revert "Story Viewer: only show upper gradient if no title is present"
Browse files Browse the repository at this point in the history
This reverts commit 5127230 on the behast of zookeeper.
  • Loading branch information
Vultraz committed Apr 10, 2017
1 parent 15daebd commit c452a4c
Showing 1 changed file with 24 additions and 26 deletions.
50 changes: 24 additions & 26 deletions src/gui/dialogs/story_viewer.cpp
Expand Up @@ -128,33 +128,11 @@ void story_viewer::display_part(window& window)
sound::play_sound(current_part_->sound());
}

//
// Title
//
label& title_label = find_widget<label>(&window, "title", false);

std::string title_text = current_part_->title();
bool showing_title;

if(current_part_->show_title() && !title_text.empty()) {
showing_title = true;

PangoAlignment title_text_alignment = storyscreen_alignment_to_pango(current_part_->title_text_alignment());

title_label.set_visible(widget::visibility::visible);
title_label.set_text_alignment(title_text_alignment);
title_label.set_label(title_text);
} else {
showing_title = false;

title_label.set_visible(widget::visibility::invisible);
}
config cfg, image;

//
// Background images
//
config cfg, image;

bool has_background = false;

for(const auto& layer : current_part_->get_background_layers()) {
Expand Down Expand Up @@ -212,9 +190,7 @@ void story_viewer::display_part(window& window)
cfg.add_child("image", image);
}

if(!showing_title) {
cfg.add_child("image", get_title_area_decor_config());
}
cfg.add_child("image", get_title_area_decor_config());

canvas& window_canvas = window.get_canvas(0);

Expand All @@ -224,6 +200,28 @@ void story_viewer::display_part(window& window)
window_canvas.set_is_dirty(true);
window.set_is_dirty(true);

//
// Title
//
label& title_label = find_widget<label>(&window, "title", false);

std::string title_text = current_part_->title();
bool showing_title;

if(current_part_->show_title() && !title_text.empty()) {
showing_title = true;

PangoAlignment title_text_alignment = storyscreen_alignment_to_pango(current_part_->title_text_alignment());

title_label.set_visible(widget::visibility::visible);
title_label.set_text_alignment(title_text_alignment);
title_label.set_label(title_text);
} else {
showing_title = false;

title_label.set_visible(widget::visibility::invisible);
}

//
// Story text
//
Expand Down

0 comments on commit c452a4c

Please sign in to comment.