mirror of https://github.com/lapce/lapce.git
Remove to_string on calls to new_text_layout
Only on the calls which are passing a static string, this is always safe.
This commit is contained in:
parent
c95fff30f5
commit
4e61787b5f
|
@ -488,7 +488,7 @@ fn paint(&mut self, ctx: &mut PaintCtx, data: &LapceTabData, _env: &Env) {
|
|||
);
|
||||
let text = ctx
|
||||
.text()
|
||||
.new_text_layout("Save".to_string())
|
||||
.new_text_layout("Save")
|
||||
.font(FontFamily::SYSTEM_UI, 13.0)
|
||||
.text_color(
|
||||
data.config
|
||||
|
@ -524,7 +524,7 @@ fn paint(&mut self, ctx: &mut PaintCtx, data: &LapceTabData, _env: &Env) {
|
|||
);
|
||||
let text = ctx
|
||||
.text()
|
||||
.new_text_layout("Cancel".to_string())
|
||||
.new_text_layout("Cancel")
|
||||
.font(FontFamily::SYSTEM_UI, 13.0)
|
||||
.text_color(
|
||||
data.config
|
||||
|
@ -612,7 +612,7 @@ fn paint(&mut self, ctx: &mut PaintCtx, data: &LapceTabData, _env: &Env) {
|
|||
|
||||
let text_layout = ctx
|
||||
.text()
|
||||
.new_text_layout("Command".to_string())
|
||||
.new_text_layout("Command")
|
||||
.font(FontFamily::SYSTEM_UI, 14.0)
|
||||
.default_attribute(TextAttribute::Weight(FontWeight::BOLD))
|
||||
.text_color(
|
||||
|
@ -630,7 +630,7 @@ fn paint(&mut self, ctx: &mut PaintCtx, data: &LapceTabData, _env: &Env) {
|
|||
|
||||
let text_layout = ctx
|
||||
.text()
|
||||
.new_text_layout("Keybinding".to_string())
|
||||
.new_text_layout("Keybinding")
|
||||
.font(FontFamily::SYSTEM_UI, 14.0)
|
||||
.default_attribute(TextAttribute::Weight(FontWeight::BOLD))
|
||||
.text_color(
|
||||
|
@ -651,7 +651,7 @@ fn paint(&mut self, ctx: &mut PaintCtx, data: &LapceTabData, _env: &Env) {
|
|||
|
||||
let text_layout = ctx
|
||||
.text()
|
||||
.new_text_layout("When".to_string())
|
||||
.new_text_layout("When")
|
||||
.font(FontFamily::SYSTEM_UI, 14.0)
|
||||
.default_attribute(TextAttribute::Weight(FontWeight::BOLD))
|
||||
.text_color(
|
||||
|
@ -679,7 +679,7 @@ fn paint(&mut self, ctx: &mut PaintCtx, data: &LapceTabData, _env: &Env) {
|
|||
if data.config.lapce.modal {
|
||||
let text_layout = ctx
|
||||
.text()
|
||||
.new_text_layout("Modes".to_string())
|
||||
.new_text_layout("Modes")
|
||||
.font(FontFamily::SYSTEM_UI, 14.0)
|
||||
.default_attribute(TextAttribute::Weight(FontWeight::BOLD))
|
||||
.text_color(
|
||||
|
|
|
@ -493,9 +493,7 @@ fn paint(&mut self, ctx: &mut PaintCtx, data: &PaletteViewData, _env: &Env) {
|
|||
&& data.palette.palette_type == PaletteType::SshHost
|
||||
{
|
||||
ctx.text()
|
||||
.new_text_layout(
|
||||
"Enter your SSH details, like user@host".to_string(),
|
||||
)
|
||||
.new_text_layout("Enter your SSH details, like user@host")
|
||||
.font(FontFamily::SYSTEM_UI, 14.0)
|
||||
.text_color(
|
||||
data.config
|
||||
|
|
|
@ -357,13 +357,15 @@ fn paint(&mut self, ctx: &mut PaintCtx, data: &LapceTabData, env: &Env) {
|
|||
.get_color_unchecked(LapceTheme::EDITOR_BACKGROUND),
|
||||
);
|
||||
|
||||
for (i, text) in ["Core Settings", "Editor Settings", "Keybindings"]
|
||||
static SETTINGS_SECTIONS: [&str; 3] = ["Core Settings", "Editor Settings", "Keybindings"];
|
||||
|
||||
for (i, text) in SETTINGS_SECTIONS
|
||||
.iter()
|
||||
.enumerate()
|
||||
{
|
||||
let text_layout = ctx
|
||||
.text()
|
||||
.new_text_layout(text.to_string())
|
||||
.new_text_layout(*text)
|
||||
.font(FontFamily::SYSTEM_UI, 14.0)
|
||||
.text_color(
|
||||
data.config
|
||||
|
@ -393,7 +395,7 @@ fn paint(&mut self, ctx: &mut PaintCtx, data: &LapceTabData, env: &Env) {
|
|||
);
|
||||
let text_layout = ctx
|
||||
.text()
|
||||
.new_text_layout("Settings".to_string())
|
||||
.new_text_layout("Settings")
|
||||
.font(FontFamily::SYSTEM_UI, 16.0)
|
||||
.text_color(
|
||||
data.config
|
||||
|
|
Loading…
Reference in New Issue