Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/util/css-config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ CssFromConfigDouble::CssFromConfigDouble(std::string option_name, std::string be
auto cb = [=]
{
std::stringstream ss;
ss.imbue(std::locale::classic());
ss << before << std::to_string(option_value.value()) << after;
std::cout << ss.str() << std::endl;
provider->load_from_string(ss.str());
Expand Down Expand Up @@ -55,11 +56,13 @@ CssFromConfigInt::CssFromConfigInt(std::string option_name, std::string css_befo
int value = option_value;
// TODO When we go up to c++20 use std::format
std::stringstream ss;
ss.imbue(std::locale::classic());
ss << css_before << std::to_string(value) << css_after;
provider->load_from_string(ss.str());
});
int value = option_value;
std::stringstream ss;
ss.imbue(std::locale::classic());
ss << css_before << std::to_string(value) << css_after;
provider->load_from_string(ss.str());

Expand All @@ -80,6 +83,7 @@ CssFromConfigIconSize::CssFromConfigIconSize(std::string option_name,
}

std::stringstream ss;
ss.imbue(std::locale::classic());
ss << ".wf-panel " << css_class << " {-gtk-icon-size:" << option_value.value() << "px;}";
provider->load_from_string(ss.str());
};
Expand All @@ -99,10 +103,12 @@ CssFromConfigString::CssFromConfigString(std::string option_name, std::string cs
{
// TODO When we go up to c++20 use std::format
std::stringstream ss;
ss.imbue(std::locale::classic());
ss << css_before << (std::string)option_value << css_after;
provider->load_from_string(ss.str());
});
std::stringstream ss;
ss.imbue(std::locale::classic());
ss << css_before << (std::string)option_value << css_after;
provider->load_from_string(ss.str());

Expand Down Expand Up @@ -146,6 +152,7 @@ void CssFromConfigFont::set_from_string()
}

std::stringstream ss;
ss.imbue(std::locale::classic());
ss << css_before << "font: " << size << unit << " " << before.str() << " " << after.str() << ";" <<
css_after;
auto css = ss.str();
Expand All @@ -155,6 +162,7 @@ void CssFromConfigFont::set_from_string()
} else
{
std::stringstream ss;
ss.imbue(std::locale::classic());
ss << css_before << "font: 1rem " << font_name << ";" << css_after;
auto css = ss.str();
provider->load_from_string(css);
Expand All @@ -172,6 +180,7 @@ CssFromConfigEdge::CssFromConfigEdge(std::string config_opt, std::string height_
auto callback = [=] ()
{
std::stringstream ss;
ss.imbue(std::locale::classic());
auto position = option_value.value();
if ((position == "top") || (position == "bottom"))
{
Expand Down