mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-05 22:55:18 +00:00
Rename markup_mode to use_markup.
The old name was proper when there were three modi, now there are only two so the new name is better.
This commit is contained in:
parent
ccd1bac40d
commit
56203964b7
@ -70,7 +70,7 @@ void tformula_debugger::pre_show(CVideo& /*video*/, twindow& window)
|
||||
c++;
|
||||
}
|
||||
|
||||
stack_label->set_markup_mode(true);
|
||||
stack_label->set_use_markup(true);
|
||||
stack_label->set_label(stack_text.str());
|
||||
window.keyboard_capture(stack_label);
|
||||
|
||||
@ -97,7 +97,7 @@ void tformula_debugger::pre_show(CVideo& /*video*/, twindow& window)
|
||||
}
|
||||
}
|
||||
|
||||
execution_label->set_markup_mode(true);
|
||||
execution_label->set_use_markup(true);
|
||||
execution_label->set_label(execution_text.str());
|
||||
|
||||
// state
|
||||
|
@ -427,11 +427,9 @@ void tlobby_main::update_gamelist()
|
||||
gamelistbox_->add_row(data);
|
||||
tgrid* grid = gamelistbox_->get_row_grid(gamelistbox_->get_item_count() - 1);
|
||||
|
||||
find_widget<tcontrol>(grid, "name", false)
|
||||
.set_markup_mode(true);
|
||||
find_widget<tcontrol>(grid, "name", false).set_use_markup(true);
|
||||
|
||||
find_widget<tcontrol>(grid, "status", false)
|
||||
.set_markup_mode(true);
|
||||
find_widget<tcontrol>(grid, "status", false).set_use_markup(true);
|
||||
|
||||
ttoggle_panel& row_panel =
|
||||
find_widget<ttoggle_panel>(grid, "panel", false);
|
||||
@ -549,8 +547,7 @@ void tlobby_main::update_playerlist()
|
||||
|
||||
tgrid* grid = target_list->list->get_row_grid(target_list->list->get_item_count() - 1);
|
||||
|
||||
find_widget<tlabel>(grid, "player", false)
|
||||
.set_markup_mode(true);
|
||||
find_widget<tlabel>(grid, "player", false).set_use_markup(true);
|
||||
|
||||
find_widget<ttoggle_panel>(grid, "userpanel", false)
|
||||
.set_callback_mouse_left_double_click(boost::bind(
|
||||
@ -730,7 +727,7 @@ void tlobby_main::increment_waiting_whsipers(const std::string& name)
|
||||
tgrid* grid = roomlistbox_->get_row_grid(t - &open_windows_[0]);
|
||||
//this breaks for some reason
|
||||
//tlabel& label = grid->get_widget<tlabel>("room", false);
|
||||
//label.set_markup_mode(tcontrol::PANGO_MARKUP);
|
||||
//label.set_use_markup(true);
|
||||
//label.set_label(colorize("<" + t->name + ">", "red"));
|
||||
find_widget<timage>(grid, "pending_messages", false)
|
||||
.set_visible(twidget::VISIBLE);
|
||||
@ -749,7 +746,7 @@ void tlobby_main::increment_waiting_messages(const std::string& room)
|
||||
tgrid* grid = roomlistbox_->get_row_grid(idx);
|
||||
//this breaks for some reason
|
||||
//tlabel& label = grid->get_widget<tlabel>("room", false);
|
||||
//label.set_markup_mode(tcontrol::PANGO_MARKUP);
|
||||
//label.set_use_markup(true);
|
||||
//label.set_label(colorize(t->name, "red"));
|
||||
find_widget<timage>(grid, "pending_messages", false)
|
||||
.set_visible(twidget::VISIBLE);
|
||||
|
@ -149,7 +149,7 @@ void show_message(CVideo& video, const std::string& title,
|
||||
|
||||
int show_message(CVideo& video, const std::string& title,
|
||||
const std::string& message, const tmessage::tbutton_style button_style,
|
||||
bool /*message_markup_mode*/,
|
||||
bool /*message_use_markup*/,
|
||||
bool /*message_title_mode*/)
|
||||
{
|
||||
/** @todo implement the markup mode. */
|
||||
@ -185,11 +185,11 @@ int show_message(CVideo& video, const std::string& title,
|
||||
}
|
||||
|
||||
void show_error_message(CVideo& video, const std::string& message,
|
||||
bool message_markup_mode)
|
||||
bool message_use_markup)
|
||||
{
|
||||
LOG_STREAM(err, lg::general) << message << '\n';
|
||||
show_message(video, _("Error"), message,
|
||||
tmessage::ok_button, message_markup_mode);
|
||||
tmessage::ok_button, message_use_markup);
|
||||
}
|
||||
|
||||
} // namespace gui2
|
||||
|
@ -157,15 +157,15 @@ void show_message(CVideo& video, const std::string& title,
|
||||
* @param title The title of the dialog.
|
||||
* @param message The message to show in the dialog.
|
||||
* @param button_style The style of the button(s) shown.
|
||||
* @param message_markup_mode The markup mode used for the title.
|
||||
* @param title_markup_mod The markup mode used for the title.
|
||||
* @param message_use_markup Use markup for the message?
|
||||
* @param title_use_markup Use markup for the title?
|
||||
*
|
||||
* @returns The retval of the dialog shown.
|
||||
*/
|
||||
int show_message(CVideo& video, const std::string& title,
|
||||
const std::string& message, const tmessage::tbutton_style button_style,
|
||||
bool message_markup_mode = false,
|
||||
bool title_markup_mode = false);
|
||||
bool message_use_markup = false,
|
||||
bool title_use_markup = false);
|
||||
|
||||
/**
|
||||
* Shows an error message to the user.
|
||||
@ -173,10 +173,10 @@ int show_message(CVideo& video, const std::string& title,
|
||||
* @param video The video which contains the surface to draw
|
||||
* upon.
|
||||
* @param message The message to show in the dialog.
|
||||
* @param message_markup_mode The markup mode used for the title.
|
||||
* @param message_use_markup Use markup for the message?
|
||||
*/
|
||||
void show_error_message(CVideo& video, const std::string& message,
|
||||
bool message_markup_mode = false);
|
||||
bool message_use_markup = false);
|
||||
|
||||
} // namespace gui2
|
||||
|
||||
|
@ -30,19 +30,19 @@ void ttransient_message::pre_show(CVideo& /*video*/, twindow& window)
|
||||
{
|
||||
tlabel& title = find_widget<tlabel>(&window, "title", false);
|
||||
title.set_label(title_);
|
||||
title.set_markup_mode(title_markup_mode_);
|
||||
title.set_use_markup(title_use_markup_);
|
||||
|
||||
tlabel& message = find_widget<tlabel>(&window, "message", false);
|
||||
message.set_label(message_);
|
||||
message.set_markup_mode(message_markup_mode_);
|
||||
message.set_use_markup(message_use_markup_);
|
||||
message.set_can_wrap(true);
|
||||
}
|
||||
|
||||
void show_transient_message(CVideo& video, const std::string& title,
|
||||
const std::string& message, bool message_markup_mode, bool title_markup_mode)
|
||||
const std::string& message, bool message_use_markup, bool title_use_markup)
|
||||
{
|
||||
ttransient_message dlg(title, title_markup_mode,
|
||||
message, message_markup_mode);
|
||||
ttransient_message dlg(title, title_use_markup,
|
||||
message, message_use_markup);
|
||||
dlg.show(video);
|
||||
}
|
||||
|
||||
|
@ -26,13 +26,13 @@ class ttransient_message
|
||||
{
|
||||
public:
|
||||
ttransient_message(const std::string& title,
|
||||
bool title_markup_mode,
|
||||
bool title_use_markup,
|
||||
const std::string& message,
|
||||
bool message_markup_mode)
|
||||
bool message_use_markup)
|
||||
: title_(title)
|
||||
, title_markup_mode_(title_markup_mode)
|
||||
, title_use_markup_(title_use_markup)
|
||||
, message_(message)
|
||||
, message_markup_mode_(message_markup_mode)
|
||||
, message_use_markup_(message_use_markup)
|
||||
{}
|
||||
|
||||
protected:
|
||||
@ -43,14 +43,14 @@ private:
|
||||
/** The title for the dialog. */
|
||||
std::string title_;
|
||||
|
||||
/** The markup mode for the title. */
|
||||
bool title_markup_mode_;
|
||||
/** Use markup for the title. */
|
||||
bool title_use_markup_;
|
||||
|
||||
/** The message to show to the user. */
|
||||
std::string message_;
|
||||
|
||||
/** The markup mode for the message. */
|
||||
bool message_markup_mode_;
|
||||
/** Use markup for the message. */
|
||||
bool message_use_markup_;
|
||||
|
||||
/** Inherited from tdialog. */
|
||||
twindow* build_window(CVideo& video);
|
||||
@ -69,13 +69,13 @@ private:
|
||||
* upon.
|
||||
* @param title The title of the dialog.
|
||||
* @param message The message to show in the dialog.
|
||||
* @param message_markup_mode The markup mode used for the title.
|
||||
* @param title_markup_mod The markup mode used for the title.
|
||||
* @param message_use_markup Use markup for the message?
|
||||
* @param title_markup_mod Use markup for the title?
|
||||
*/
|
||||
void show_transient_message(CVideo& video, const std::string& title,
|
||||
const std::string& message,
|
||||
bool message_markup_mode = false,
|
||||
bool title_markup_mode = false);
|
||||
bool message_use_markup = false,
|
||||
bool title_use_markup = false);
|
||||
|
||||
} // namespace gui2
|
||||
|
||||
|
@ -60,11 +60,11 @@ void twml_message_::pre_show(CVideo& /*video*/, twindow& window)
|
||||
// Set the markup
|
||||
tlabel& title = find_widget<tlabel>(&window, "title", false);
|
||||
title.set_label(title_);
|
||||
title.set_markup_mode(true);
|
||||
title.set_use_markup(true);
|
||||
|
||||
tcontrol& message = find_widget<tcontrol>(&window, "message", false);
|
||||
message.set_label(message_);
|
||||
message.set_markup_mode(true);
|
||||
message.set_use_markup(true);
|
||||
// The message label might not always be a scroll_label but the capturing
|
||||
// shouldn't hurt.
|
||||
window.keyboard_capture(&message);
|
||||
@ -75,7 +75,7 @@ void twml_message_::pre_show(CVideo& /*video*/, twindow& window)
|
||||
|
||||
if(has_input_) {
|
||||
caption.set_label(input_caption_);
|
||||
caption.set_markup_mode(true);
|
||||
caption.set_use_markup(true);
|
||||
input.set_value(*input_text_);
|
||||
input.set_maximum_length(input_maximum_lenght_);
|
||||
window.keyboard_capture(&input);
|
||||
@ -155,11 +155,10 @@ void twml_message_::pre_show(CVideo& /*video*/, twindow& window)
|
||||
tgrid* grid = options.get_row_grid(i);
|
||||
assert(grid);
|
||||
|
||||
find_widget<tcontrol>(grid, "label", false)
|
||||
.set_markup_mode(true);
|
||||
find_widget<tcontrol>(grid, "label", false).set_use_markup(true);
|
||||
|
||||
find_widget<tcontrol>(grid, "description", false)
|
||||
.set_markup_mode(true);
|
||||
.set_use_markup(true);
|
||||
}
|
||||
|
||||
// Avoid negetive and 0 since item 0 is already selected.
|
||||
|
@ -28,7 +28,7 @@ namespace gui2 {
|
||||
|
||||
tcontrol::tcontrol(const unsigned canvas_count)
|
||||
: label_()
|
||||
, markup_mode_(false)
|
||||
, use_markup_(false)
|
||||
, use_tooltip_on_label_overflow_(true)
|
||||
, tooltip_()
|
||||
, help_message_()
|
||||
@ -71,7 +71,7 @@ void tcontrol::set_members(const string_map& data)
|
||||
|
||||
itor = data.find("use_markup");
|
||||
if(itor != data.end()) {
|
||||
set_markup_mode(utils::string_bool(itor->second));
|
||||
set_use_markup(utils::string_bool(itor->second));
|
||||
}
|
||||
}
|
||||
|
||||
@ -248,13 +248,13 @@ void tcontrol::set_label(const t_string& label)
|
||||
set_dirty();
|
||||
}
|
||||
|
||||
void tcontrol::set_markup_mode(bool markup_mode)
|
||||
void tcontrol::set_use_markup(bool use_markup)
|
||||
{
|
||||
if(markup_mode == markup_mode_) {
|
||||
if(use_markup == use_markup_) {
|
||||
return;
|
||||
}
|
||||
|
||||
markup_mode_ = markup_mode;
|
||||
use_markup_ = use_markup;
|
||||
update_canvas();
|
||||
set_dirty();
|
||||
}
|
||||
@ -267,7 +267,7 @@ void tcontrol::update_canvas()
|
||||
// set label in canvases
|
||||
foreach(tcanvas& canvas, canvas_) {
|
||||
canvas.set_variable("text", variant(label_));
|
||||
canvas.set_variable("text_markup", variant(markup_mode_));
|
||||
canvas.set_variable("text_markup", variant(use_markup_));
|
||||
canvas.set_variable("text_maximum_width", variant(max_width));
|
||||
canvas.set_variable("text_maximum_height", variant(max_height));
|
||||
canvas.set_variable("text_wrap_mode", variant(can_wrap()
|
||||
@ -310,7 +310,7 @@ tpoint tcontrol::get_best_text_size(const tpoint& minimum_size, const tpoint& ma
|
||||
const tpoint border(config_->text_extra_width, config_->text_extra_height);
|
||||
tpoint size = minimum_size - border;
|
||||
|
||||
renderer_.set_text(label_, markup_mode_);
|
||||
renderer_.set_text(label_, use_markup_);
|
||||
|
||||
renderer_.set_font_size(config_->text_font_size);
|
||||
renderer_.set_font_style(config_->text_font_style);
|
||||
|
@ -200,8 +200,8 @@ public:
|
||||
const t_string& label() const { return label_; }
|
||||
virtual void set_label(const t_string& label);
|
||||
|
||||
virtual void set_markup_mode(bool use_markup);
|
||||
bool get_markup_mode() const { return markup_mode_; }
|
||||
virtual void set_use_markup(bool use_markup);
|
||||
bool get_use_markup() const { return use_markup_; }
|
||||
|
||||
const t_string& tooltip() const { return tooltip_; }
|
||||
// Note setting the tooltip_ doesn't dirty an object.
|
||||
@ -253,8 +253,8 @@ private:
|
||||
/** Contain the non-editable text associated with control. */
|
||||
t_string label_;
|
||||
|
||||
/** The markup mode of the label_. */
|
||||
bool markup_mode_;
|
||||
/** Use markup for the label? */
|
||||
bool use_markup_;
|
||||
|
||||
/**
|
||||
* If the text doesn't fit on the label should the text be used as tooltip?
|
||||
|
@ -39,15 +39,15 @@ void tscroll_label::set_label(const t_string& label)
|
||||
}
|
||||
}
|
||||
|
||||
void tscroll_label::set_markup_mode(bool markup_mode)
|
||||
void tscroll_label::set_use_markup(bool use_markup)
|
||||
{
|
||||
// Inherit.
|
||||
tcontrol::set_markup_mode(markup_mode);
|
||||
tcontrol::set_use_markup(use_markup);
|
||||
|
||||
if(content_grid()) {
|
||||
tlabel* widget =
|
||||
find_widget<tlabel>(content_grid(), "_label", false, true);
|
||||
widget->set_markup_mode(markup_mode);
|
||||
widget->set_use_markup(use_markup);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -44,7 +44,7 @@ public:
|
||||
void set_label(const t_string& label);
|
||||
|
||||
/** Inherited from tcontrol. */
|
||||
void set_markup_mode(bool markup_mode);
|
||||
void set_use_markup(bool use_markup);
|
||||
|
||||
/** Inherited from tcontainer_. */
|
||||
void set_self_active(const bool active)
|
||||
|
Loading…
x
Reference in New Issue
Block a user