Merge pull request #3930 from xoan/enhance-scrolling

Enhance scrolling by using font point size as scroll rate
This commit is contained in:
Alessandro Ranellucci 2017-05-11 00:03:13 +02:00 committed by GitHub
commit 0d4cebce71
3 changed files with 10 additions and 3 deletions

View File

@ -101,6 +101,10 @@ our $medium_font = Wx::SystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT);
$medium_font->SetPointSize(12);
our $grey = Wx::Colour->new(200,200,200);
# to use in ScrolledWindow::SetScrollRate(xstep, ystep)
# step related to system font point size
our $scroll_step = Wx::SystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT)->GetPointSize;
our $VERSION_CHECK_EVENT : shared = Wx::NewEventType;
our $DLP_projection_screen;

View File

@ -89,7 +89,9 @@ sub new {
}
$self->SetSizer($self->{sizer});
$self->SetScrollbars(0, 1, 0, 1);
# http://docs.wxwidgets.org/3.0/classwx_scrolled.html#details
$self->SetScrollRate(0, $Slic3r::GUI::scroll_step);
$self->set_opt_keys($params{opt_keys}) if $params{opt_keys};
$self->update_optgroup;

View File

@ -1602,11 +1602,12 @@ sub new {
$self->{title} = $title;
$self->{iconID} = $iconID;
$self->SetScrollbars(1, 1, 1, 1);
$self->{vsizer} = Wx::BoxSizer->new(wxVERTICAL);
$self->SetSizer($self->{vsizer});
# http://docs.wxwidgets.org/3.0/classwx_scrolled.html#details
$self->SetScrollRate($Slic3r::GUI::scroll_step, $Slic3r::GUI::scroll_step);
return $self;
}