Skip to content
Snippets Groups Projects
Unverified Commit 6c007968 authored by StaffEngineer's avatar StaffEngineer Committed by GitHub
Browse files

Merge pull request #36 from StaffEngineer/rename_to_text

rename set_text to text
parents 4457fcfd c199a6a3
No related branches found
No related tags found
No related merge requests found
......@@ -32,7 +32,7 @@ fn setup(mut commands: Commands, windows: Query<&Window, With<PrimaryWindow>>) {
},
text_position: CosmicTextPosition::Center,
cosmic_attrs: CosmicAttrs(AttrsOwned::new(attrs)),
set_text: CosmicText::OneStyle("😀😀😀 x => y".to_string()),
text: CosmicText::OneStyle("😀😀😀 x => y".to_string()),
..default()
};
......
......@@ -33,7 +33,7 @@ fn setup(mut commands: Commands, windows: Query<&Window, With<PrimaryWindow>>) {
},
text_position: CosmicTextPosition::Center,
cosmic_attrs: CosmicAttrs(AttrsOwned::new(attrs)),
set_text: CosmicText::OneStyle("😀😀😀 x => y".to_string()),
text: CosmicText::OneStyle("😀😀😀 x => y".to_string()),
..default()
};
......
......@@ -49,7 +49,7 @@ fn setup(mut commands: Commands, windows: Query<&Window, With<PrimaryWindow>>) {
},
max_chars: CosmicMaxChars(15),
max_lines: CosmicMaxLines(1),
set_text: CosmicText::OneStyle("BANANA IS THE CODEWORD!".into()),
text: CosmicText::OneStyle("BANANA IS THE CODEWORD!".into()),
})
.id();
......
......@@ -225,7 +225,7 @@ fn setup(mut commands: Commands, windows: Query<&Window, With<PrimaryWindow>>) {
..default()
},
background_color: BackgroundColor(Color::WHITE),
set_text: CosmicText::MultiStyle(lines),
text: CosmicText::MultiStyle(lines),
..default()
};
......@@ -247,7 +247,7 @@ fn setup(mut commands: Commands, windows: Query<&Window, With<PrimaryWindow>>) {
height: Val::Percent(100.),
..default()
},
set_text: CosmicText::OneStyle("Widget 2.\nClick on me =>".to_string()),
text: CosmicText::OneStyle("Widget 2.\nClick on me =>".to_string()),
..default()
};
......
......@@ -37,7 +37,7 @@ fn setup(mut commands: Commands, windows: Query<&Window, With<PrimaryWindow>>) {
transform: Transform::from_translation(Vec3::new(-primary_window.width() / 4., 0., 1.)),
text_position: CosmicTextPosition::Center,
background_color: BackgroundColor(Color::ALICE_BLUE),
set_text: CosmicText::OneStyle("😀😀😀 x => y".to_string()),
text: CosmicText::OneStyle("😀😀😀 x => y".to_string()),
..default()
};
......@@ -58,7 +58,7 @@ fn setup(mut commands: Commands, windows: Query<&Window, With<PrimaryWindow>>) {
)),
text_position: CosmicTextPosition::Center,
background_color: BackgroundColor(Color::GRAY.with_a(0.5)),
set_text: CosmicText::OneStyle("Widget_2. Click on me".to_string()),
text: CosmicText::OneStyle("Widget_2. Click on me".to_string()),
..default()
};
......
......@@ -37,7 +37,7 @@ fn setup(mut commands: Commands, windows: Query<&Window, With<PrimaryWindow>>) {
line_height: 18.,
scale_factor: primary_window.scale_factor() as f32,
},
set_text: CosmicText::OneStyle("😀😀😀 x => y\nRead only widget".to_string()),
text: CosmicText::OneStyle("😀😀😀 x => y\nRead only widget".to_string()),
..default()
};
......
......@@ -32,7 +32,7 @@ fn setup(mut commands: Commands, windows: Query<&Window, With<PrimaryWindow>>) {
},
max_chars: CosmicMaxChars(15),
max_lines: CosmicMaxLines(1),
set_text: CosmicText::OneStyle(
text: CosmicText::OneStyle(
"1 line 15 chars! But this\n is longer\n than is\n allowed by\n the limits.\n"
.into(),
),
......
......@@ -284,8 +284,7 @@ pub struct CosmicEditUiBundle {
/// How many characters are allowed in buffer, 0 for no limit
pub max_chars: CosmicMaxChars,
/// Setting this will update the buffer's text
// TODO sync this with the buffer to allow getting from here as well as setting
pub set_text: CosmicText,
pub text: CosmicText,
}
impl Default for CosmicEditUiBundle {
......@@ -310,7 +309,7 @@ impl Default for CosmicEditUiBundle {
background_image: Default::default(),
max_lines: Default::default(),
max_chars: Default::default(),
set_text: Default::default(),
text: Default::default(),
}
}
}
......@@ -341,7 +340,8 @@ pub struct CosmicEditSpriteBundle {
pub max_lines: CosmicMaxLines,
/// How many characters are allowed in buffer, 0 for no limit
pub max_chars: CosmicMaxChars,
pub set_text: CosmicText,
/// Setting this will update the buffer's text
pub text: CosmicText,
}
impl Default for CosmicEditSpriteBundle {
......@@ -360,7 +360,7 @@ impl Default for CosmicEditSpriteBundle {
background_image: Default::default(),
max_lines: Default::default(),
max_chars: Default::default(),
set_text: Default::default(),
text: Default::default(),
}
}
}
......@@ -1482,7 +1482,7 @@ mod tests {
fn test_spawn_cosmic_edit_system(mut commands: Commands) {
commands.spawn(CosmicEditUiBundle {
set_text: CosmicText::OneStyle("Blah".into()),
text: CosmicText::OneStyle("Blah".into()),
..Default::default()
});
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment