use nimbus roman, theme config, lto
license, philosophy, more shippori chars, slight code shuffling
This commit is contained in:
@@ -38,12 +38,12 @@ impl<T: Clone> Component<T> for HighlightButton<T> {
|
||||
vec![
|
||||
//highlight background
|
||||
DrawInstructions::Rect(self.top_left, self.size, theme_info.top),
|
||||
DrawInstructions::Text([self.top_left[0] + 4, self.top_left[1] + (self.size[1] - font_height) / 2], vec!["times-new-roman".to_string()], self.text.clone(), theme_info.top_text, theme_info.top, None, None),
|
||||
DrawInstructions::Text([self.top_left[0] + 4, self.top_left[1] + (self.size[1] - font_height) / 2], vec!["nimbus-roman".to_string()], self.text.clone(), theme_info.top_text, theme_info.top, None, None),
|
||||
]
|
||||
} else {
|
||||
vec![
|
||||
DrawInstructions::Rect(self.top_left, self.size, theme_info.background),
|
||||
DrawInstructions::Text([self.top_left[0] + 4, self.top_left[1] + (self.size[1] - font_height) / 2], vec!["times-new-roman".to_string()], self.text.clone(), theme_info.text, theme_info.background, None, None),
|
||||
DrawInstructions::Text([self.top_left[0] + 4, self.top_left[1] + (self.size[1] - font_height) / 2], vec!["nimbus-roman".to_string()], self.text.clone(), theme_info.text, theme_info.background, None, None),
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ impl<T: Copy> Component<T> for Paragraph<T> {
|
||||
let max_lines = self.size[1] / LINE_HEIGHT;
|
||||
let mut start_y = self.top_left[1];
|
||||
for line in self.actual_lines.iter().skip(self.line_pos).take(max_lines) {
|
||||
instructions.push(DrawInstructions::Text([self.top_left[0], start_y], vec!["times-new-romono".to_string()], line.2.clone(), theme_info.text, theme_info.background, Some(0), Some(MONO_WIDTH)));
|
||||
instructions.push(DrawInstructions::Text([self.top_left[0], start_y], vec!["nimbus-romono".to_string()], line.2.clone(), theme_info.text, theme_info.background, Some(0), Some(MONO_WIDTH)));
|
||||
start_y += LINE_HEIGHT;
|
||||
}
|
||||
instructions
|
||||
|
||||
@@ -37,7 +37,7 @@ impl<T: Clone> Component<T> for PressButton<T> {
|
||||
DrawInstructions::Rect([self.top_left[0], self.top_left[1] + self.size[1]], [self.size[0], 1], theme_info.border_right_bottom),
|
||||
DrawInstructions::Rect([self.top_left[0] + self.size[0], self.top_left[1]], [1, self.size[1]], theme_info.border_right_bottom),
|
||||
//assume normal background colour
|
||||
DrawInstructions::Text([self.top_left[0] + half, self.top_left[1] + 8], vec!["times-new-romono".to_string()], self.text.clone(), theme_info.text, theme_info.background, Some(0), Some(MONO_WIDTH)),
|
||||
DrawInstructions::Text([self.top_left[0] + half, self.top_left[1] + 8], vec!["nimbus-romono".to_string()], self.text.clone(), theme_info.text, theme_info.background, Some(0), Some(MONO_WIDTH)),
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@ pub struct ToggleButton<T> {
|
||||
top_left: Point,
|
||||
size: Dimensions,
|
||||
text: String,
|
||||
draw_bg: bool,
|
||||
pub inverted: bool, //whether is it clicked or not
|
||||
click_return: T,
|
||||
unclick_return: T,
|
||||
@@ -47,7 +46,7 @@ impl<T: Clone> Component<T> for ToggleButton<T> {
|
||||
//the background if self.draw_bg
|
||||
//DrawInstructions::Rect(),
|
||||
//the text (for now, hardcoded top left)
|
||||
DrawInstructions::Text([self.top_left[0] + 4, self.top_left[1] + (self.size[1] - font_height) / 2], vec!["times-new-roman".to_string()], self.text.to_string(), theme_info.text, theme_info.background, None, None),
|
||||
DrawInstructions::Text([self.top_left[0] + 4, self.top_left[1] + (self.size[1] - font_height) / 2], vec!["nimbus-roman".to_string()], self.text.to_string(), theme_info.text, theme_info.background, None, None),
|
||||
]
|
||||
}
|
||||
|
||||
@@ -66,7 +65,7 @@ impl<T: Clone> Component<T> for ToggleButton<T> {
|
||||
}
|
||||
|
||||
impl<T> ToggleButton<T> {
|
||||
pub fn new(name_: String, top_left: Point, size: Dimensions, text: String, click_return: T, unclick_return: T, draw_bg: bool) -> Self {
|
||||
pub fn new(name_: String, top_left: Point, size: Dimensions, text: String, click_return: T, unclick_return: T) -> Self {
|
||||
Self {
|
||||
name_,
|
||||
top_left,
|
||||
@@ -74,7 +73,6 @@ impl<T> ToggleButton<T> {
|
||||
text,
|
||||
click_return,
|
||||
unclick_return,
|
||||
draw_bg,
|
||||
inverted: false,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user