Skip to content
Permalink
Browse files

add "Reset view position when file changes" option to picture browser

  • Loading branch information...
squentin committed Dec 13, 2018
1 parent 4fea670 commit e2cb65fa64c0bd6fa12c1b2ddc3b003abb56599c
Showing with 7 additions and 0 deletions.
  1. +7 −0 gmusicbrowser_layout.pm
@@ -4163,6 +4163,8 @@ our @optionsubmenu=
{ label=>_"Scroll to zoom", mode=>'VP', toggleoption=> 'view/scroll_zoom', },
{ label=>_"Reset view position when file changes", mode=>'V', toggleoption=> 'self/reset_offset_on_file_change', },
{ label=>_"Reset zoom", mode=>'V', submenu_ordered_hash => 1, check => sub {$_[0]{self}{reset_zoom_on}},
submenu=> [ _"when file changes"=>'file', _"when folder changes"=>'folder', _"never"=>'never'],
code => sub { $_[0]{self}{reset_zoom_on}=$_[1] },
@@ -4749,6 +4751,7 @@ sub update_file
delete $::ToDo{'8_ChangePicture'.$self};
if (!$file || $file ne $old) #file changed
{ $self->{view}->reset_zoom if $self->{reset_zoom_on} eq 'file';
$self->{view}->reset_offset if $self->{reset_offset_on_file_change};
delete $self->{select_drop};
}
my $pixbuf= $file && GMB::Picture::pixbuf($file,undef,undef,'anim_ok'); #disable cache ?
@@ -4890,6 +4893,10 @@ sub reset_zoom
$self->{pixbuf}=undef; #force refresh
$self->{fit}=1;
}
sub reset_offset
{ my $self=shift;
$self->{offsetx}=$self->{offsety}=0;
}
sub expose_cb
{ my ($self,$event)=@_;

0 comments on commit e2cb65f

Please sign in to comment.
You can’t perform that action at this time.