Draw the filled part of the slider on float EditorSpinSliders
This makes it more obvious that the slider has a "filled" part on the left, which improves visibility especially in wider inspectors (such as the Project Settings and Editor Settings).
This commit is contained in:
parent
c2470f5298
commit
9d3acbfad9
1 changed files with 14 additions and 7 deletions
|
@ -310,17 +310,24 @@ void EditorSpinSlider::_draw_spin_slider() {
|
||||||
grabber->hide();
|
grabber->hide();
|
||||||
}
|
}
|
||||||
} else if (!hide_slider) {
|
} else if (!hide_slider) {
|
||||||
int grabber_w = 4 * EDSCALE;
|
const int grabber_w = 4 * EDSCALE;
|
||||||
int width = get_size().width - sb->get_minimum_size().width - grabber_w;
|
const int width = get_size().width - sb->get_minimum_size().width - grabber_w;
|
||||||
int ofs = sb->get_offset().x;
|
const int ofs = sb->get_offset().x;
|
||||||
int svofs = (get_size().height + vofs) / 2 - 1;
|
const int svofs = (get_size().height + vofs) / 2 - 1;
|
||||||
Color c = fc;
|
Color c = fc;
|
||||||
c.a = 0.2;
|
|
||||||
|
|
||||||
|
// Draw the horizontal slider's background.
|
||||||
|
c.a = 0.2;
|
||||||
draw_rect(Rect2(ofs, svofs + 1, width, 2 * EDSCALE), c);
|
draw_rect(Rect2(ofs, svofs + 1, width, 2 * EDSCALE), c);
|
||||||
int gofs = get_as_ratio() * width;
|
|
||||||
|
// Draw the horizontal slider's filled part on the left.
|
||||||
|
const int gofs = get_as_ratio() * width;
|
||||||
|
c.a = 0.45;
|
||||||
|
draw_rect(Rect2(ofs, svofs + 1, gofs, 2 * EDSCALE), c);
|
||||||
|
|
||||||
|
// Draw the horizontal slider's grabber.
|
||||||
c.a = 0.9;
|
c.a = 0.9;
|
||||||
Rect2 grabber_rect = Rect2(ofs + gofs, svofs + 1, grabber_w, 2 * EDSCALE);
|
const Rect2 grabber_rect = Rect2(ofs + gofs, svofs + 1, grabber_w, 2 * EDSCALE);
|
||||||
draw_rect(grabber_rect, c);
|
draw_rect(grabber_rect, c);
|
||||||
|
|
||||||
bool display_grabber = (mouse_over_spin || mouse_over_grabber) && !grabbing_spinner && !value_input->is_visible();
|
bool display_grabber = (mouse_over_spin || mouse_over_grabber) && !grabbing_spinner && !value_input->is_visible();
|
||||||
|
|
Loading…
Reference in a new issue