mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-01 16:51:59 +08:00
Enhance scrolling by using font point size as scroll rate
In wxWidgets documentation there are three ways to set the size of the scrolling area. The most automatic (and newest) way is by using SetScrollRate: * http://docs.wxwidgets.org/trunk/classwx_scrolled.html#details
This commit is contained in:
parent
8c77f47638
commit
dfc364af3c
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user