Skip to content

Commit

Permalink
GUI2/Label: quick fix for label links not being formatted correctly
Browse files Browse the repository at this point in the history
In 8041a09 the label format was changed to an RGB string, but still passed around verbatim.
This is a quick fix that converts the color into a hex string. The color should probably be stored
as color_t internally, but I'm not sure what to do with the areas that involve formulas operating
on the string.
  • Loading branch information
Vultraz committed Dec 10, 2016
1 parent 7b34afd commit 4dbd219
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/gui/widgets/label.cpp
Expand Up @@ -264,7 +264,8 @@ label_definition::label_definition(const config& cfg)
label_definition::resolution::resolution(const config& cfg)
: resolution_definition(cfg)
, link_aware(cfg["link_aware"].to_bool(false))
, link_color(cfg["link_color"].str().size() > 0 ? cfg["link_color"].str() : "#ffff00")
// TODO: link_color should probably be stored as color_t internally, not as a string
, link_color(cfg["link_color"].empty() ? "#ffff00" : color_t::from_rgb_string(cfg["link_color"].str()).to_hex_string())
{
// Note the order should be the same as the enum state_t is label.hpp.
state.push_back(state_definition(cfg.child("state_enabled")));
Expand Down

0 comments on commit 4dbd219

Please sign in to comment.