[style] tigher buttons and monospaced DragValue text

This commit is contained in:
Emil Ernerfeldt 2020-06-11 18:07:42 +02:00
parent 097730461d
commit 916e667aa2
2 changed files with 4 additions and 2 deletions

View file

@ -73,7 +73,7 @@ impl Default for Style {
fn default() -> Self {
Self {
window_padding: vec2(6.0, 6.0),
button_padding: vec2(5.0, 3.0),
button_padding: vec2(4.0, 1.0),
item_spacing: vec2(8.0, 4.0),
indent: 21.0,
clickable_diameter: 22.0,

View file

@ -534,7 +534,9 @@ impl<'a> Widget for DragValue<'a> {
.log10()
.ceil()
.max(0.0) as usize;
let button = Button::new(format!("{:.*}", precision, *value)).sense(Sense::drag());
let button = Button::new(format!("{:.*}", precision, *value))
.sense(Sense::drag())
.text_style(TextStyle::Monospace);
let interact = ui.add(button);
if interact.active {
let mdelta = ui.input().mouse.delta;